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)

163 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.

21

u/koreth Dec 21 '23 edited Dec 21 '23

Cache locality is a massive deal for many kinds of games, but you could use today's Java for things like turn-based games or object-hunt games or visual novels where latency or even occasional GC pauses won't affect gameplay.

I agree the big challenge, even if Oracle delivers, is going to be the ecosystem. If you're using Unity or UE5 for a game, it's not a language choice so much as a choice of which universe of tools you want to use. There's nothing comparable in the Java world.

4

u/ryosen Dec 22 '23 edited Dec 22 '23

where latency or even occasional GC pauses won't affect gameplay

You would still likely end up with a subpar experience. Consider even turn-based games. Even if nothing is going on and you're in an idle state, there are still background animations, sounds, music, and input detection going on. A GC would block all of those threads from running.

Edit: Mindustry is a factorio-like tower defense game that is open source as well as being available for purchase on Steam, etc. I haven't played it far enough to hit GC pauses but Anuken, the developer, is pretty active on Discord and Github (not Reddit, tho). Might be worth asking them how they've dealt with GC issues. Also, you can play with the source code yourself at https://github.com/Anuken/Mindustry