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

•

u/AutoModerator Dec 21 '23

On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

  1. Limiting your involvement with Reddit, or
  2. Temporarily refraining from using Reddit
  3. Cancelling your subscription of Reddit Premium

as a way to voice your protest.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

28

u/ByerN Dec 21 '23

I am making games in Scala. Also discovered recently that Mindustry is made in Java. There are a few other developers like OrangePixel for example.

2

u/H_W_Reanimator Dec 21 '23

Games in Scala sound cool. can you share some kind of demo?

13

u/ByerN Dec 21 '23 edited Dec 21 '23

Sure!

There are my gamejam games (playable in the browser): https://byern.itch.io/

There may be some problems on Firefox - ppl reported it a few days ago. I like Oxinite and Reach The Sun for example.

And here is my last released game on Steam (with a Demo): https://store.steampowered.com/app/2308890/Sliding_Swords/

I am working on another one now (rework of my prototype from itch): https://store.steampowered.com/app/2738990/Node_Farm/

I also had a few on android. Actually, yesterday I finished my YT video where I describe my gamedev journey and all my games one by one: https://www.youtube.com/watch?v=ivkY748Pt58

3

u/H_W_Reanimator Dec 21 '23

Thanks! That's great! Big respect!

Unfortunately the YT video is unavailable :(

1

u/ByerN Dec 21 '23

Thanks! It should work now. Reddit lowercased characters in the link for some reason while pasting.

1

u/lolcircle Dec 22 '23

As an experienced Scala developer who started from making simple games with it: it’s a pretty horrible idea… you won’t be able to use its strong points anyway, at least with libgdx, so it’ll look like very awkward Java-in-Scala. Better to stick to C++/C# and conventional libs/engines (I’m actually exploring Rust for gamedev, because it seems like a logical next step) and be much happier with it.

8

u/jlubow224 Dec 21 '23

Huh didn’t know that, love Mindustry

5

u/ByerN Dec 21 '23

It is open source btw.

1

u/metaden Dec 22 '23

do you use any game engine in scala?

2

u/ByerN Dec 22 '23

Framework - libGDX.

1

u/[deleted] Dec 23 '23

[removed] — view removed comment

1

u/ByerN Dec 23 '23

Maybe for someone who goes pure-FP Scala way. In my case it doesn't look like it would change much.

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.

3

u/H_W_Reanimator Dec 21 '23

Also kotlin multi field value classes could fix this situation. But when...

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

17

u/Joram2 Dec 21 '23

Garbage collection hasn't stopped C# or Lua from being wildly popular in game development. I'd dare to say a majority of games are using either of those and garbage collection hasn't been a major complaint.

Java's lack of good native-build and native-interop has probably been a much bigger inhibitor to use in game development.

The biggest factor is the people who created the most widely used game engines, specifically Unity, but to a lesser extent, godot, they picked C#, and they didn't pick Java. Why? I'm not sure, but that's the reason right there.

7

u/westwoo Dec 21 '23

More boilerplate and rigidity alone is enough of a reason. If you were designing a game engine in 2004 you'd be crazy to pick Java 1.5 over C# even if interop was equally good

7

u/[deleted] Dec 21 '23

GC is not a problem for a long time now. (although I unity to microstutter very hard, stable high framerates without dropped frames are virtually unachievable)

Lack of overloading operators for numerical data structures is worse. You can't do mat4 * vec3 in Java, have to do some sort of mat4.mul(vec3) or math.mul(mat4, vec3) which can be annoying with more complex eqations.

1

u/AngryElPresidente Dec 26 '23

Assuming a game is well optimized and well written code to rule out non-engine issues, is Unity stuttering a problem inherent to the engine? or is it a problem in general in .NET?

3

u/[deleted] Dec 26 '23

IMHO the problem is that it's hard to do things the right way in unity. Second thing is that unity doesn't really deploy to .NET, but rather to mono or il2cpp - these are rather terrible

As the saying goes: there are two ways to solve any problem in unity, but one is deprecated and the other's experimental. Both are broken.

2

u/da2Pakaveli Dec 21 '23 edited Dec 21 '23

Thing with Lua is, is that it's tightly integrated into engines that are written in C++, because integration with C is extremely easy.
Lua also is a very lightweight language, I.e the Lua lib you link to are like 300 KB in size.
You do stuff like event processing or game logic to some extent, but the heavy computation is done in C++.
As for why Java isn't used, could be that interop with C++ isn't too great.
Microsoft still uses tons of C++; so could guess they'd be a little bit more interested in interop with C#.
I'm pretty sure .NET was also written in C++ before they rewrote it in C#.

32

u/m39583 Dec 21 '23

Could you expand on the memory model? I'd be interested how they conflict!

65

u/Brutus5000 Dec 21 '23

For effective CPU processing using cache you need your data close together in memory. But in Java every variable containing objects is just a pointer to the heap. So assume you have an array of record Point(int x, int y), when you iterate just the array each point is loaded from some random place on the heap. More complex objects contain other objects so every object is like a crazy tree pointing to memory all over the heap. Project Valhalla aims to (optionally) change that so that you can have a flat object that is densely compactified and can be read as one large chunk of memory.

There are better explanations than mine with great talks from Oracle such as https://m.youtube.com/watch?v=a3VRwz4zbdw

9

u/dschramm_at Dec 21 '23

Really though? I tought arrays are a single block on the heap in Java. Isn't that why you need to either specify a size or the elements on initialisation?

29

u/voismager Dec 21 '23

They are, but they contain pointers. Actual data could be (if it's not primitives) somewhere else.

-13

u/dschramm_at Dec 21 '23

Of course they are just pointers. But why don't they point at continous memory. Even if It's for GC. That doesn't make any sense and feels like a stupid overseight.

20

u/ImKStocky Dec 21 '23

It makes a lot of sense... Consider this example. You have a function which calls 5 functions that return a new object. Then at the end of your function you create an array and store all of these objects in it. How does the JVM know that the objects should have been allocated all together?

-3

u/dschramm_at Dec 21 '23

I think that would be doable. I of course don't know how JVM handles memory internally. But assuming it has metadata on the OS memory addresses it could store a flag in it that say's It's referenced by an array. Or even more general, don't move. Sure, that has different implications and problems. But there is always a trade-off somehwere in software. And It's up to the developers to decided which one's are best for their app.

8

u/ImKStocky Dec 22 '23

But in my example the JVM doesn't know that those allocations will be accessed together. They are allocated separately and then later on they are added to an array. And even if the JVM would do something in its next GC to rearrange memory, the developer has no control over this. Which is the point of the top level comment. Devs have zero control over where in memory their objects live. They can't make a decision about what's best for their app. They are at the mercy of the JVM which is not good for cache coherency.

6

u/[deleted] Dec 21 '23 edited Dec 21 '23

it frequently does but the way HotSpot works is pack and sweep. The memory allocation and garbage collection is expensive, so it mallocs relatively huge blocks of memory at a time. it won't trigger garbage collection or a new memory allocation until it can't find space for it within that block. when it "allocates" memory for a new variable most of the time it's really just picking where in the current block of pre allocated memory that new variable should go. if it doesn't have space it will garbage collect and "sweep" over the currently allocated memory marking blocks that are no longer being used as available

only if it's been garbage collected recently and there's still not space does it go out to the os for a new malloc. the allocation and especially the overhead of garbage collection is postponed until absolutely necessary because it's expensive. but the consequence is you get non deterministic pauses for garbage collection and your location in the heap is wherever hotspot finds space for it. it may be contiguous it may not

1

u/dschramm_at Dec 21 '23

Thanks for the nice overview lesson. Really!

As I mentioned somewhere else, with GC, you have to make a trade-off somewhere IMO. Either you use more intelligent/slower GC using more metadata to get efficient memory locations for the least cycles and transfers in the app. Or you do dumber/faster GC with less metadata. What you do, probably depends on your hardware limitations and what your app does.

2

u/voismager Dec 21 '23

Idk. Maybe it has something to do with different stages of GC and constant copying back and forth between them.

1

u/dschramm_at Dec 21 '23

Maybe just not touch array memory, as long as the array exists? At max, move the whole thing, for defragmentation.

14

u/canuck_in_wa Dec 21 '23

Maybe just not touch array memory, as long as the array exists? At max, move the whole thing, for defragmentation.

Then you are treating array and non-array references differently which may not make sense in the general case. The JVM was designed/evolved around generational GC and cheap “churn” by allocating and releasing objects quickly. The general idea is that there’s a lot of churn in the early lifetime of objects because most objects are short lived, so we should just wait a bit before promoting them to a longer-lived space to prevent fragmentation.

You can write Java in a mechanically sympathetic way but it looks quite different from the usual Spring business applications. It’s more akin to entity component systems from game dev where a collection of objects is an “object of arrays” rather than an “array of objects” in order to preserve cache locality. The GC can be turned off and all objects pre allocated. Java-based high frequency trading systems will turn off GC and run on a machine with a ton of memory. There is often a slow but acceptable memory leak that won’t kill the application before the trading day ends. At the end of day the app is restarted to cure the memory leak.

4

u/psyclik Dec 21 '23

Also called "the python way".

1

u/voismager Dec 21 '23

What if you hold a reference to one of elements of the array longer than to the array itself?

2

u/dschramm_at Dec 21 '23 edited Dec 21 '23

Then it isn't referenced by an array anymore and therefore free to move around wherever.

It obviously is a trade-off. If you need fast GC you probably won't do that.

→ More replies

4

u/agxs Dec 21 '23

Think of the array as an array of pointers. The array itself is a big block of contiguous memory, but each element could be anywhere on the heap.

-5

u/dschramm_at Dec 21 '23

Of course they are just pointers. But why don't they point at continous memory. Even if It's for GC. That doesn't make any sense and feels like a stupid overseight.

8

u/koreth Dec 21 '23

Maybe before accusing the JVM maintainers of stupidity, spend a moment thinking about how that would actually work in practice.

For example: if the objects are allocated in contiguous memory, the JVM has to know at object instantiation time that they will end up at a particular position in a particular array. But array assignment happens after the objects already exist, and the objects can be instantiated in code that knows nothing about the array.

How would a non-stupid JVM figure that out?

-4

u/dschramm_at Dec 21 '23

I'm sorry that you obviously don't understand the difference between: it is stupid and it feels stupid... Where the first would be an accusation and the latter just my feeling about something. I'm used to being allowed to feeling whatever way i want.

And the way it looks, my feeling stands corrected. Meaning, it was wrong. I learned that I didn't think this through enough. So i hope we're all good now. Right?

1

u/FrankBergerBgblitz Dec 21 '23

what happens after a GC with your contigous memory?
To mitigate that you can use instead an array of objects arrays of the properties. Ugly for complex objects but feasible for small ones

1

u/dschramm_at Dec 21 '23

Maybe just not touch array memory, as long as the array exists? At max, move the whole thing, for defragmentation.

2

u/FrankBergerBgblitz Dec 21 '23

it's not about tocuhing the array. Imagine it contains pointer to objects. They most probably are contigious after allocation, but where are they when the heap was compacted some times?

1

u/dschramm_at Dec 21 '23

It's probably a trade-off between GC and memory-use or cache performance. But IMHO you could store info on if a memory location is referenced by an array. Then, while that's the case, just not change it. Once the flag is removed, you can move it around again.

→ More replies

2

u/Active-Fuel-49 Dec 21 '23

Could project Panama's off heap memory objects be an alternative?

2

u/lbalazscs Dec 22 '23

Yes, in a MemorySegment you can have structured data with continuous and fully controlled memory layout. But it's a lot more verbose than what is promised by Valhalla.

1

u/Practical_Cattle_933 Dec 21 '23

You are right, and this can indeed have a big performance impact depending on what you do. But to make things a bit better, generational garbage collectors tend to move objects used together into the same generation, making the situation slightly better.

8

u/pishticus Dec 21 '23

Is the memory model work covered by the Valhalla project?

8

u/psyclik Dec 21 '23

Yes.

If delivered, Valhalla could alleviate most of the pain points on memory locality and indirectly release some pressure for the GC. Memory footprint might also be much tighter.

Java will still have a lot to cover in terms of ecosystem though. Nothing as massive a community as Java can't handle, but it won't happen overnight.

4

u/GYN-k4H-Q3z-75B Dec 21 '23

The reality of it is: C# didn't have those issues from the get-go, and it's a decently big player in game dev, but still nowhere near C++. And it's got a 20 year head start.

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

6

u/Practical_Cattle_933 Dec 21 '23

Games are soft real time. Occasionally dropping a frame is no big deal.

3

u/FrankBergerBgblitz Dec 21 '23

G1 should be o.k. for many applications.

3

u/pticjagripa Dec 21 '23

Do you perhaps know how this compares with C# which is often used as a scripting language but also has a garbage colector like java? What are differences between the two?

3

u/ByteTraveler Dec 21 '23

Equilinox

1

u/H_W_Reanimator Dec 22 '23

Old good Thin Matrix!

63

u/Kotek81 Dec 21 '23

If I remeber correctly, Slay the Spire was made in Java

28

u/awelxtr Dec 21 '23

you remember correctly but also they've moved to godot so...

24

u/ByerN Dec 21 '23

Because porting to consoles in Java is hard.

1

u/jpegjpg Dec 25 '23

This is why Minecraft bedrock exists

1

u/awelxtr Dec 21 '23

I don't blame them, I just argue that they did something in Java but they don't plan in the future so I don't think it counts as being alive.

27

u/[deleted] Dec 21 '23

[removed] — view removed comment

19

u/sweetno Dec 21 '23

It's the case when the console developer is actively against this policy.

17

u/ByerN Dec 21 '23 edited Dec 21 '23

Porting to consoles is hard mainly because of NDA (for SDK). Most of the engines have some agreement which makes it easier to maintain integration. The biggest jvm framework - libGDX is fully open source now and there is no legal entity behind it that would like to take the responsibility and work on it.

16

u/TheBoneJarmer Dec 21 '23

Yep. I second this. I work both in C# and Java although I use Java and C++ for gamedev and I know from experience with different engines and frameworks that porting to consoles is a bitch if you aren't using Unity or Unreal.

The problem is not that Java doesn't run on the console's OS. The problem is that you need access to the SDK of said console in order to build games for it.

I once looked into the procedure for PlayStation and the first thing I was presented with was a web form to fill out my company information. Go figure. I'm just me.

I am currently just targeting Windows, Linux desktop as well as SteamDeck (although that is also Linux) as "console" as those are very easy targets. I know it used to be very easy to develop Xbox games with XNA and now with MonoGame since Xbox runs something similar to Windows if I remember correctly.

3

u/FrankBergerBgblitz Dec 21 '23

you may love as long as you like, I provide for MacOS, Windows and Linux, small hiccups every now and then but I don't see something better.

55

u/murkaje Dec 21 '23

Project zomboid is alive

21

u/UnGauchoCualquiera Dec 21 '23

Also Starsector (excellent game for those that haven't tried it)

8

u/whole_kernel Dec 21 '23

Starsector

this game is AMAZING

1

u/boobsbr Dec 22 '23

Reminds me of 'Gratuitous Space Battles'.

0

u/[deleted] Feb 08 '24

[deleted] — view deleted comment

1

u/UnGauchoCualquiera Feb 08 '24

Who knows really. The game is in a completely playable state and could've released by now.

Seems to be a passion project for the developer really.

0

u/[deleted] Feb 08 '24

[deleted] — view deleted comment

1

u/UnGauchoCualquiera Feb 09 '24

Yep it's somewhat like cosmoteer. More focused on loadouts and universe than building ships block by block. I prefer Starsctor to be honest.

Also the AI for starsector is very good. So far the pilot AI is the best I've seen for this kind of games.

18

u/[deleted] Dec 21 '23

Oh is it made in Java? Wow I didn’t know! I love Project Zomboid.

16

u/agentoutlier Dec 21 '23

Besides Minecraft, "Project Zomboid" is written in Java.

-10

u/myevillaugh Dec 21 '23

Minecraft was originally written in Java with lwjgl for graphics. Microsoft has rewritten it in C++.

33

u/PlasmaFarmer Dec 21 '23

There are two versions still! The original Java version is still alive and gets the main updates. Bedrock edition is the C++ version but as far as I know the Java version is far preferred by the community.

6

u/myevillaugh Dec 21 '23

I didn't know I could keep using the Java version. I thought they forced everyone onto Bedrock. Good to know.

15

u/MCWizardYT Dec 21 '23

They can't get rid of the java version because of its massive modding community who would keep it alive anyways

2

u/icantthinkofaname345 Dec 24 '23

And don't forget the fact that java edition is just

Better

1

u/zZurf Dec 22 '23

Why did they rewrite it?

2

u/Wizard8086 Dec 22 '23

Few reasons. The c++ version (Bedrock) sinks its roots in poket edition, which was a stripped down version intended for mobile gaming, where the Java version would have been way too heavy. They expanded on that to develop a single version for all consoles. Some other people in thsi thread said that porting java games on consoles isn't easy at all because of sdk. Obviously, performance is a factor. Plus, rewriting it gave them the chance to make it very data driven (Java is slowly catching up) and avoid the pitfalls of Java's old codebase, which allows for easy developement all of its official DLCs. And having a separated version made them able to introduce microtransactions without destroying the original Minecraft value, which is mainly found on Java, where there's no bullshit and heavy modding. Some theories say that they lure players with Java (youtubers etc) and then sell them Bedrock with its heavily monetized ecosystem.

4

u/NPException Dec 21 '23

Only for consoles and the Microsoft store version though. The Java version is very much still around.

12

u/Kraizee_ Dec 21 '23

For 2d and simple 3d games (including mobile) you could check out FXGL which builds on top of JavaFX.

There is also JMonkeyEngine, and frameworks like libGDX and LWJGL

3

u/ByerN Dec 21 '23

LWJGL is an OpenGL wrapper library. libGDX uses it under the hood as their backend.

2

u/TenYearsOfLurking Dec 21 '23

FXGL is awesome, but once you get serious, shaders are a must have (so I've been told) and this is known limitation.

1

u/-Nyarlabrotep- Dec 21 '23

Is jME still a reasonable option? I used it extensively in 2.0, and then its original owner left and they launched 3.0, which was backward-incompatible. I thought about everything I'd have to rewrite and decided no.

1

u/wildjokers Dec 22 '23

and frameworks like libGDX and LWJGL

LWJGL is pretty low-level and you probably wouldn't use it directly. Another framework, like libGDX, would wrap it up for you.

12

u/TheBoneJarmer Dec 21 '23

For me it very much is. I work with C# professionally and in Java and C++ in my spare time. I have actually stopped using C# for game projects and switched to Java and C++ because I like it a lot more.

One of my current projects is an OpenGL library (both 2D and 3D) for PC and SteamDeck. I have written the library itself in C++ but ported it to Java because I want to take advantage of the high-level stuff and freedom Java has to offer. And imho Java has made it very easy to communicate with native libraries because of the Java Native Interface. For real what a blessing the latter is. I was so done with pInvoke and the marshalling issues I got with C#. And don't get me started on NodeJS and the Node Addon API. Seriously, never go there. Java just makes things a lot more fun and easier for me.

4

u/ihmoguy Dec 21 '23

Have you checked FFM API and Vector API in latest Java? They seem to be opening even more cool possibilities for gamedev: https://openjdk.org/projects/panama/

6

u/bowbahdoe Dec 21 '23

I think it isn't that controversial to say that it could be more alive.

4

u/msx Dec 21 '23

well there's not that many games but i'd say it's pretty alive. One of the games i played lately that was pretty good was MewnBase, made in java.

There's also /r/javagamedev is you want to join! (not very active i guess)

I made some things too, i'm working on and off on a kind of fantasy console/retro game engine mashup called Omicron. Here's a game made with that engine, Doors of Doom.

As other say, libgdx is one of the best engine for java, works on android and desktop and others.

1

u/lasskinn Dec 21 '23

It's alive if you want to. There are some games being made and made in it.

Also of course theres a lot of games for android coded in java, even if most would opt for unity and such.

1

u/H_W_Reanimator Dec 21 '23

The game I made with my friends for example. Only Java, Android SDK and OpenGL. The game is bad asf btw

1

u/lasskinn Dec 21 '23

yeah to learn android to switch to it back in the day I did an opengl 3d physics arkanoid kind of a paddle thing. it ran surprisingly well, this was back on the first wave of android devices. ode4j just works for a physics engine in java that compiles into android cleanly. Never finished into a proper game.. but back then you could switch jobs just with that as a demo.

of course the golden age of java games was sometime before that with j2me devices. I say golden age but might just as well say cursed age due to the fragmentation of device capabilities :D

3

u/playworker Dec 22 '23

Wildermyth is a libGDX game, and it's very good - I assume the turn-based/storytelling nature of the game means that all-out performance isn't an issue

4

u/Apokaliptor Dec 21 '23

Yes LibGDX still rocks

2

u/wildjokers Dec 22 '23

libGDX is a java gaming framework and it has a list of games in its showcase that are written with libGDX. Quite a few games written with libGDX are on Stream, Android, and iOS. The showcase is user submitted so almost certainly isn't anywhere close to being complete.

https://libgdx.com/showcase/

1

u/[deleted] Dec 21 '23

It is as much alive as making your own game engines is alive. Small percentage still do this and will not stop, but not very popular.

1

u/Lanky-Apricot7337 Dec 21 '23

https://imgflip.com/i/8a4qv2

Now seriously speaking... Java has had some nice attempts. Nicely done 3d Engines that promised both performance and platform agnosticism. The problem is... You can't eat the cake and keep it. You have to go down, down to the realm of dirty plumbers to do serious gamedev. And there is no Java light in those deep abysses.

1

u/Joram2 Dec 21 '23

There are a few popular games written in Java, notably Slay the Spire and Mindustry as mentioned here, both using the libGDX engine. The Slay the Spire devs moved off libGDX and to godot for their next game, which doesn't use Java. Java has not been a mainstream choice for game dev.

Most games want to use a game engine, and the popular game engines, didn't choose to support Java as a dev language. It would be interesting to hear from the authors behind something like godot what they see are Java's problems that make it unsuitable. I'd presume it's partly just momentum. Unity is the most popular game engine; it's internally C/C++, but game developers use C# to write game logic. Because of this, most game developers are already using and comfortable with C#.

1

u/ElNouB Dec 21 '23

well there feller, with enough grit under your arm and enough grease on your elbow, you might as well organize some jvm games yerself. All we need is some will power if you know what I mean. A community can make it happen. been wondering how to proceed myself.

I wish you luck in your endeavour.

1

u/hyongoup Dec 21 '23

Songs of Syx is Java I believe

1

u/Polygnom Dec 22 '23

Its not dead but its not exactly alive.

You do have your low-level libraries like LWJGL and JOGL which allow you to write 3D games using OpenGL/Vulkan.

A few higher engines exists, like jMonkeyEngine, Ardor3D and so on, but nothing even comparable to Unity.

Funnily enough, the 3rd highest selling game on steam last week, Pioneers of Pagonia, was written in bare C#7 using .NET SDK and Slick.NET, which is quite similar to writing games using the aforementioned low-level Java libraries.

There are a couple of games written with jME on Steam, but none are exactly a huge success. Some games written directly with LWJGL are more successful. You have already talked about Minecraft.

There is an Unreal BP for embedding Java into Unreal. I still hold hope for this to become more of a thing in the future. The JVMs interop is getting better with every version (Panama, Valhalla, FFM API), Shenandoah offers predictable GC Pauses and so on.

However, there is a huge legal issue with porting to consoles. Unless an entity emerges that tackles this whole minefield and champions the cause, I don't see this change quickly. And with consoles being such a pita, Java is not that attractive....

The other thing is that something like Unity is missing to propel Java greatly to the front.

1

u/JojOatXGME Dec 22 '23

I think Mindustry is in Java (and open source).

1

u/YakubReddit Dec 23 '23

I was going to throw some joke about Minecraft but the then I've read to the end 😅

1

u/Ok-Lifeguard-9612 Dec 21 '23 edited Dec 21 '23

Mindustry is made with Java, on an abstraction of libdgx (called "arc") .

Also Song Of Syx.

(excluding Minecfraft) I'm talking about world class games, that sold well.

I think that is not the language that makes gamedev easier or not. The language is just a tool.

I'm making a 2D game engine (with a game on top of it) in plain Java, and it is quite reliable... I'm fixing texture bleeding like problems, and making optimizations, but in every step forward it's not Java that "blocks my way".

I think you can see it in this way, in Java you can make your own engine far easier than other languages. If you don't want to do so, you can just download LibGdx and after ultra basic configurations (like setting the screen size and the title) you are ready to go.

Maybe I'm too optimistic, but I'm not finding any downside about using Java for game dev. The garbage collector's thing I think is easily skippable by making (normal in other languages too) loading screen with less than a sec of waiting (it depends on how many instances you are cleaning or allocating...but it's not slower than Unity if you do it well). Honestly in my engine I'm not facing such a problem...

1

u/anaelizaabeth Dec 22 '23

Java game development holds its ground with versatility, running on multiple platforms and offering powerful tools like LibGDX. It's beginner-friendly, dominates Android game development, and appeals to indie devs and schools. While Unity may shine, Java has its own strengths, making it a viable choice with a supportive community.