Is a game made with Java viable?

336    Asked by AnilJha in Java , Asked on Oct 13, 2022

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.

Answered by Anisha Dalal

Not really. A game made with Java is not viable. Here's the thing- firstly, there's very little in terms of existing libraries for Java compared to virtually everything that is for C++.


  Secondly, Java as a language simply doesn't lend itself well to game development- I mean, for example, if you're dealing with GPU buffers then Java does not provide a language feature which will aid you in ensuring they are correctly locked and unlocked or disposed of, which C++ does. Plus, there's the performance problem- and the GC is non-deterministic, which is super-bad for a game.

I have never observed any non-indie game which spent significant time in a language that was not compiled to native code prior to execution, and even the indie games which do so are a rarity. So my belief right now is that it simply cannot be done. Also, if I continue to learn and improve Java now, and it turns out that later I am required to learn C++, will making the switch be difficult? Yes, absolutely it will. Java and C++ are vastly different, despite their superficial syntactic similarities. Java experience counts for virtually nothing when learning C++. Gameplay over graphics is a viable choice, and you can see it in the success of games like Terraria and Minecraft. But if you intend on creating srs graphics, then it's not going to be doable in Java.



Your Answer

Interviews

Parent Categories