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.

2 Likes

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.

Ok

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.

3 Likes

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.

11 Likes

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.