I hear Java in general is slow with 3D games, especially good graphics?

Is this a problem in JMonkeyEngine to?

http://lightspeedfrontier.com this runs on jme. Does it have good enough graphics for you? It took a couple years to get it where it is now, so I kinda doubt that you’ll make good enough graphics to have problems with that.

I mean, maybe, although I can’t tell much because it’s quite blocky. And I’m still not sure how well it would handle a person running around inside a ship that is also moving.

Oddly enough the game seems to be pretty much what I want to do , except mine is multiplayer and less combat-based, although there will be combat

My other ideas that I’m considering are Unity and UE4, although I’d have to learn a new computer language for those

Basically, could you make graphics like Kerbal Space Program in JME if you tried hard enough, without it being a slow, laggy mess?

It is as fast as you are capable. If you’re a bad programmer it doesn’t matter if it’s written in oil on a downward slope, it’ll still be slow.


Any advice for optimimizin Java code?

Experience :slight_smile: there are no shortcuts, but I have a plethora of good reading material I will happily share.

Sure; also, is there any ways to optimize code just in general tho?

How? In order to make something better you have to understand how it works.

Java isn’t slow. People just presume it is because they heard something one day. It’s just not the case anymore.

Oh ok; although just my text-based game that I’m making for class sends BlueJ into “Not responding” for a little bit before compiling, so I could see where those rumors might come from

To expand slightly on the other answers, the title line is false. I’m not surprised you found it - it’s a common misconception, but it’s just not true (especially as stated). Java can run very, very fast (competitive with C++, which is generally the gold standard), but if you write crappy code it will run slow. Same with C++, except that it’s far easier to write fast Java code than fast (or even crash-proof) C++. The rumor is especially false for 3D graphics. ALL 3D graphics are happening on the GPU, and the GPU is programmed by writing shaders in the GLSL language and running them bare-metal on the hardware. JME has an excellent shader system.

So, the (hopefully :wink: ) golden takeaway: Java isn’t slow, and the graphics performance you get depends on your graphics hardware + the graphics code you write.

1 Like

Note that this has nothing to do with Java and everything to do with how BlueJ was written. You can write crappy, slow code that freezes up at any moment like that in any language.


And if you eventually reach the point that you need to do things that cause un-avoidable freezes or drop in framerate, then these are usually things that can be solved by pre-loading assets, loading screens, and multi-threading.

I didn’t know very much about Java prior to using JME, but it’s been a very good environment to learn much more than I ever thought I would about Java and coding in general :slightly_smiling_face:

1 Like

Even if you had the need for performance, you could still use some c++ code (and thus even assembler !!111) for performance critical tasks, you can “easily” embed c++ in java, not so much the other way round.

Also don’t try to write fast code, write working code and when everything is done, then you MAY optimize, but only things you could actually identify, not because you THINK it’s faster (sometimes it does the opposite).

You can also get Unreal laggy pretty fast (just think of ARK) and Unity even allows you to use UnityScript (which is Javascript), so if Unity allows you to use JS, then Java Performance should be out of question.

That being said, your game might have a bad performance right from the beginning, which is why dev machines usually have a strong gpu/cpu. Techniques like Batching and Instancing are required in UE/Unity as well, except that Unity sometimes does it automatically.

Btw: Not Responding Applications means that someone did a slow task in the UI/Main Thread instead of delegating this to another Thread. Much like what happens when you try to load assets in the MainThread.

And there was recently a topic about jme vs unity, keep in mind that in the other engines you can buy your game together, not even touching code. And If you don’t like coding that’s probably a better option.


I find coding fun, I just don’t want to learn yet another coding language right now. Furthermore, I…don’t have any money, so buying stuff and cobbling my game together from that is not really an option

The worst thing with java is that you constantly get trolled about it being slow.


I guess that is the reason for this perception: Theres a lot of Java games done by begineers because Java is often used as a beginner programming language. That results in lots of „slow“ games written in Java.

I have a friend in his 50s who is convinced Java is slow. He hasn’t used it since the late 90s. My current project is CPU intensive running simulations and I have not run into any ‘java is too slow’ problems, and graphics wise it’s opengl so I think you’re gonna be fine.