Jump to content
  • Advertisement
Sign in to follow this  
JWollin

[java] Java 3d game engine?

This topic is 5105 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, I am not a coder, nor do I ever claim to be. I understand all the lingo, just don't know what all 'dem pretty words mean... Okay, the real idea here is I have some buddies who are graduating from school with degrees in CS and specialize in Java programming. One of them has recently informed me that they are starting their own dev. company to write a 3d game engine based entirely in Java... Is it just me or does that seem ENTIRELY whacked? Please, no flames, just facts. I am not trying to knock Java, correct me if I am mistaken, but isn't java a pisspoor choice for a 3d game engine? Again, just asking, factual explainations would be greatly appreciated as I am in fact a lead designer/developer for a studio, I just don't know jack about java. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
The discussions about whether Java is to be used when doing games have been plenty in these forums and I don't think a correct or complete answere can ever be given to this question. What can be said however is that java is definetely speeding up and with external OpenGL libs it becomes great at rendering as well.

Oh and if you haven't you should check the Forum FAQ thread and the actual FAQ. There are quite alot on the speed issues that jave has.

Share this post


Link to post
Share on other sites
Thanks. I'm a n00b to java related issues, and I have never been in this part of the forums, thanks for the advice, I will look into it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The ultra short answer is: java can make 3D engines every bit as good and fast as C++ ones.

The more useful answer is to look back through the last 2 weeks of threads (not much, really) in this forum and you'll find one with screenshots from a recent java commercial 3D engine. The use of realtime shadows should be enough to convince you that java is a fine contender, irrespective of debates over precisely waht it can or can't do.

The long answer is that Java can theoretically be faster than c++, but the compilers for java are less than 10 years old whereas the C++ ones are effectively 20+ years old. Java running on a modern JVM can in many cases outperform well-compiled C++ by around 20%, but C++ outperforms java by a similar margin in just as many cases. These are all exceptional - on almost all "real" programming tasks, the two languages are within 5% of each other, performance wise.

redmilamber

Share this post


Link to post
Share on other sites
Given that many graphics engines spend most of their time on the GPU, Java is ok.


Although given the amount of time Doom 3 spends on the CPU, even in the graphics engine (things like shadow volume generation), I don't know.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I'm going to have to disagree.
While java performance in many applications is fairly good, it really still isn't up there.
One of the fundamental problems is that object instanciation is very expensive in java, and in a 3D engine, you are often required to create many samll objects on a per frame basis (Think vertices, matrices, quaternions). Apart from the overhead of object instanciation, this also impacts you generation size for collection purposes.
With very careful object management (as in reuse of old objects rather than disposing them and creating new ones), careful lifetime management (ie references), and well timed work, this impact can be reduced, but it will always be a fundamental issue with a managed language.
Managed DirectX under c# has a lot of crutches to help performancewise which are simply unavailable in java using openGL, through any of the JNI implementations.
Obviously i don't claim its impossible, but i feel that a lot of the energy required to make it run well would balance many of the advantages of coding in java.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
One of the fundamental problems is that object instanciation is very expensive in java...

Not to contradict you or anything (I agree memory allocation is expensive compared to other operations), but memory allocation in Java will most likely be quicker than memory allocation in C++, as Java has a garbage collector to more efficiently locate free memory and prevent memory fragmentation. Ideally, though, one would try to reuse allocated memory in either language, where possible, as opposed to reallocating it.
As a game platform, Java seems pretty suitable, with 3D APIs that are easier for beginners to learn than most, that still (as mentioned before) maintain good performance since the heavy-duty stuff is handled by the GPU.

Share this post


Link to post
Share on other sites
as said before this question cannot be answered correct nor in some sentences...
java HAS definitly some advantages to other languages and some disadvantages... thats vice versa to all languages... even german ^^°...
no, to get back to the point... java can be very quick, but to be that quick, a java programmer has to programm for the jvm, not as c++ programmer who programs for a specified os or cpu... advantage here is, that java runs nearly everywhere, if nothing specific is implemented, disadvantage is that the jvm is no os, no cpu, it runs on those... therefore a game can be good an win but terrible on mac... that is something the jvm programmer has to solve the best... and there we can say, they did pretty damn good the last years, and i am eager to se java5 not only in beta, which is better already as i think...

i would never say you could not do a great engine in java, therefore i have seen to many stuff that changed my mind... great stuff, opengl accellerated with everything we can dream of... i am working myself on a 3d engine for 2 month now my point to this topic should be clear ^^... and i am doing this, because i think java IS fast, and what i am very sure off java WILL BE faster...

Share this post


Link to post
Share on other sites
If you want an example of a good 3D engine written in Java, go to http://www.mascotcapsule.com, they have a complete CLDC compliant java 3D engine. It doesn't run as fast as the C version but it's a good proof of concept.

Share this post


Link to post
Share on other sites

Here are 2 more examples of java 3d engines

http://www.bytonic.de/html/jake2.html a nearly complete quake 2 engine. This puts the figures at about 60% the speed of c.

and

http://www11.brinkster.com/chapter23/divergence/divergence.html

a quake 3 viewer only, i.e. no game.

My personal opinion only but I think that the quake 2 conversion gives a very good indication of relative performance. This puts java a bit behind C but not a total write off.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!