Thursday, June 27, 2019

Is Java viable for serious game development?



I have scoured the internet, but there are not very many resources for Java game development, not nearly as many as C++. In fact, most engines are written in C++. I tried to play a game made with jMonkeyEngine, but the game was terribly slow, to the point where my computer froze. I had no other Java applications running, and nothing too resource intensive. In contrast, my computer can play most modern 3D games with ease. If I continue to learn and improve Java now, and it turns out that later I am required to learn C++, making the switch might be difficult.


Is Java an acceptable language for serious game development? By serious, I mean high quality graphics, without much lag on modern computers. I also want to consider making games for consoles.



Answer



Yes it is, check this list for a proof. Those are some games made with Java using The Lightweight Java Game Library (LWJGL). It is a low-level framework, which provides OpenGL for high quality graphics and OpenAL for sounds. It also provides input API. With these you can quite easily get started to serious game development in Java.


I am currently writing my second 3D game as a hobby project in Java, and I just love it. In the past I used to write my games with C++, but after switching to Java there is no going back. Supporting multiple operating systems with Java can be very easy, for example my previous Java game, which I developed in Windows for a year, worked in Linux right away and in OS X with only one bug without any need to compile anything on those platforms.


On the other hand, with Java you have couple of problems.




  1. Garbage collector. As others have stated, non-deterministic memory management is a problem, and you need to code that in mind.

  2. Lack of 3rd party libraries. Most of the available libraries do not support Java. On the other hand you always have the option to call these native libraries from Java also, but it's more work to do so. There are also Java ports or ready-made wrappers available for popular libraries, for example I'm using JBullet - Java port of Bullet Physics Library. On the other hand Java has a huge class library built-in, which reduces the need for third party libraries that are not game related. The lack of libraries has not been a problem for me, but I can imagine that it can be for others.

  3. Java is not supported by popular game consoles and there is no easy switch to those from Java as far as I know. On the other hand Android, which is a popular mobile platform, uses some form of Java. This is an option also, but don't except the same Java code to work both on a PC and Android device.

  4. Smaller community. Most game programmers use C++ and in my experience often dislike Java. Don't expect to get as much help from others. Don't expect to get a job in game development without C++ skills.


1 comment:

  1. This is so true, and In order to make use of the features of AngularJS, you need to hire an angular JS developers or a team of developers who have expertise in using this framework. Well, one can hire a professional freelancer from Eiliana.com, which is a global freelancing platform, and all the freelancers are highly skilled.

    ReplyDelete

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...