I have been looking into game development recently and my first programming language is Java. After playing many stunning games developed in c++ I wondered why Java is not heavily used in the games industry. I looked at jMonkeyEngine 3 and a few other game engine environments but the screenshots I saw are far less stunning. Titles like Need for Speed Hot pursuit form EA and Assassins Creed from ubisoft convey such realism. Why can't Java produce such industry strength games ? Is it the art work?
Java and C# has automatic garbage collection and c++ doesn't. The programmer has to pay closer attention to memory usage to avoud dangling pointers and so on.
Thanks guys.
jMonkeyEngine is a modern developer friendly game engine written primarily in Java. Its minimalistic and code first approach makes it perfect for developers who want the support of a game engine while retaining full control over their code with the ability to extend and adapt the engine to their workflow.
One of the biggest reasons Java and other Virtual Machine languages are not used for games is due to Garbage Collection. The same thing goes for . NET. Garbage collection has come a long ways and works great in most types of applications.
Java is a versatile language commonly used by small game development companies. It's powered some of the world's top iOS and Android games including Minecraft and Mission Impossible III. Plus, Java is a cross-platform language, so it runs on nearly any system including Microsoft and Linux.
Java and C# has automatic garbage collection and c++ doesn't. The programmer has to pay closer attention to memory usage to avoud dangling pointers and so on.
You yourself have answered your question.
In games programming garbage collection is not an advantage. Even if the performance of Java is more or less in par with C++ for most tasks, and the JIT can even do very aggressive optimizations that beat those that can be done during the static analysis; the garbage collection can make the framerates drop at the worst moment.
Also, for graphics intensive tasks Java is not very appropriate, as there are many things that are considered unsafe by the runtime, and thus are forbidden (like casting pointers to reinterpret data).
Another important matter is the already settled know how in the industry. The inertia of C++ in the games industry is huge. All game developers today know C and C++. Having a large developer pool to hire from lessens one of the management hazards that is key people leaving the company.
But despite that, there have been some successful games with some parts written in Java, like Vampire: The Masquerade - Redemption.
A more recent game like Minecraft is written completely in Java; but it does not feature state of the art graphics, as the emphasis is put more into the dynamic nature of the virtual environment.
And many other games and engines have a runtime that supports a managed (safe automatic memory allocation and collection) scripting language built on top of a high performance rendering and networking platform (written in C/C++), like Unreal Engine for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With