Java Game Engines

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.


Generally everything said here was a reason not to port to Java for game development; was. The gaming industry is currently hitting a paradigm shift. Three things have changed or are currently changing the gaming industry:

  • Piracy
  • Client-server program models
  • Modular-networking program models

A game is not entirely dependent on itself anymore. The key advantages that existed in the former (low level languages) are slowing being out weighed by the advantages that exist within languages such as C# and Java (high level languages). Two crude but undeniable examples are games that work on Facebook, and remote medias such as phones, tablets, etc.

It is important to state that in all two scenarios, all three concerns listed above are dissolved. A game that can not work without a server need not worry about being copy infringed (private hosting through reverse engineering not included). The demand for network dependent games requires a language which can balance out system performance with network performance (usually a stalemate between Java and C/C++, favoring C/C++ strictly due to the abundant of pre-existing libraries). However, a game designed in a modular-networking program module would be impractical to develop in low level languages such as C/C++. A company who would be interested in designing a game in C/C++ for a Modular-networking program model would have to create a virtual machine entirely devoted to that one game, or reprogram/recompile the game a number of times too insane to think. IMO, while it may be too early to state which language be the preferred, I'm putting my bets on Java for three key reasons.

  • 1) The JVM allows Java based applications to run virtually on any platform, whether Apple, Android, Windows 8, or Linux/UNIX derived (virtually supportive on any hardware platform as well).

  • 2) Java uses OpenJL (the OpenGL derivative, which will run on OpenGL as a client - jMonkey is a engine designed in OpenJL). It is important to note that only Microsoft Windows uses DirectX, as good as it may be, it has but one draw back. Virtually every OS that can run games will be capable of rendering in OpenGL and modular design is pushing on this like never before. (Please note, Microsoft is trying to deviate this issue through monopolizing on the distribution of Windows 8).

  • 3) Java supports threading internally within the JVM, which allows it to take full advantage of multi-core processors without the use of any third party library. Currently, this is a handicap for all other languages (especially ones developed for phones).

While the JVM does pose a latency concern, it should be noted that such concerns could be expunged through threading. I also wouldn't be too worried about Windows 8 and the push of Microsoft. Google has a stock share of $720/share, Apple having $526/share, Microsoft being $27 to date. While Apple is likely to be effected by Microsoft's push mainly due to using C#, Google on the other hand is likely to profit from it. Microsoft has never had much lucky when competing against Google and Google/Android heavily uses Java. Angry Birds was originally designed in Java FYI, and ported to C# for the iPhone. If Google/Android enforces standardization, Microsoft will drop like a fly, taking Apple with them.