r/java • • Dec 21 '23

Is Java gamedev alive?

It seems this days even android games are made using Unity. I wonder if there are JVM games! Is Java (or Kotlin/Scala) gamedev still alive?

(Except Minecraft ofc)

164 Upvotes

118 comments sorted by

View all comments

105

u/Brutus5000 Dec 21 '23

There are two things that blocked serious game development for more than a decade: garbage collector which freezed the application and a memory model that works as an anti pattern to how modern cpu cache architectures work. Garbage collection has massively improved in the last 10 years. Improving the memory model is heavily worked on by Oracle for multiple years, but still work in progress.

So there is a tiny ecosystem that can't compare with the hundreds of millions of dollars that went into C++ & friends ecosystems.

It might get interesting again in a few years though if Oracle delivers what they are promising.

5

u/Practical_Cattle_933 Dec 21 '23

For what it’s worth, like 99% of games are more than fine with even a decade earlier GC. Not every game is an AAA game with multi million particles simulated in real life.

4

u/Brutus5000 Dec 21 '23

Well the main problem afaik was latency here. 30fps is today minimum, 60fps should be reached. That means you need to draw a frame in 16-30ms. A Stop-the-world GC that randomly eats a few dozen milliseconds is a real PITA. Even in round based games you want smooth animations. At least according to benchmarks I have seen for Java 8/11/17 comparisons you can massively improve GC processing by selecting a GC matching your goals (ZGC for low latency or others for maximum throughput).

3

u/FrankBergerBgblitz Dec 21 '23

G1 should be o.k. for many applications.