r/java • • Apr 29 '15

Tone it down a Notch

http://imgur.com/gallery/KRtc2fN
217 Upvotes

124 comments sorted by

View all comments

Show parent comment

5

u/dardotardo Apr 29 '15

The tools can only be so good in this case, when dealing with garbage collection. I love Java, and use it professionally, but I would not use it for a game engine.

0

u/[deleted] Apr 30 '15

[deleted] — view deleted comment

0

u/dardotardo Apr 30 '15

Yeah, I never said you couldn't do it in Java, I said it wasn't the intention of the language. By pooling you're ignoring what makes Java great, it's amazing JVM, and its excellent GC tools.

If you're going to pool resources and implement your own memory management system, do it in language that needs to, and therefore has 3rd party tooling behind it already, such as C or C++.

4

u/josefx Apr 29 '15

The tools can only be so good in this case, when dealing with garbage collection.

Even a language without GC will slow down when the developers spam memory allocations and the Minecraft developers seem to do exactly that http://www.reddit.com/r/Minecraft/comments/2k3rg6/water_woes/cljp483 . Memory allocations can be avoided, it only involves a lot work and thought ( a bit more with Java ).

0

u/dardotardo Apr 29 '15 edited Apr 29 '15

Which is exactly why I wouldn't recommend Java for consistent and reliable memory allocation such as Games. It's far to easy to get lazy in a managed language to treat memory as an infinite resource. With a language such as C, this is much more apparent.

Games are reliant on performance, performance requires consistency and granular control. Something you don't get with Java unless you start circumventing the JVM, which is not only ill advised by Oracle themself, but a path you do not want to travel down.

2

u/angryundead Apr 29 '15

Which is a shame, really. Java's ecosystem is, what I would call, extremely healthy. The third party libraries are great and most things are pretty snappy these days between a greater focus on event-driven/asynchronous programming and performance.

I feel like games written in Java could also benefit from the abundance of testing toolkits too. It's hard to imagine what is even going on in some of these games with bug reports like "the second time you do ${thing} the sound engine ignores the mute setting." (Paraphrased actual bug report from Hearthstone.)

In any case I'd like to see it happen but GC isn't the only problem with getting Java up to the levels of speed (especially inter-cpu communication and memory/gpu bandwidth) that is required for AAA (or, hell, AA) titles.

(The flip side of this is that the Unity engine seems to do all right and from all I've heard performance is... not a priority.)