Using JAVA to develop 3D game? help plz.

Started by
22 comments, last by Challenger17 19 years, 11 months ago
A media lab of my university is just started trying developing a 3D game using java for sb. the reason they don''t use C++ is becuz this game under plan is designed to be enable running on various platforms, not just on Windows. And they intend to use OpenGL or JAVA3D as graphics API. to be honest i have only learned Direct3D, once took a glance at OpenGL & i have no idea about JAVA3D. now i have to give them a suggestion on the graphics part of the game. now the question is. among mainstream games(those famous ones of course) on mainstream platforms i''ve ever heard, there''s not even one game was developped using java. java is slow that it doesn''t fit game-developing very well. i''m afraid this project would failed. is here anybody familiar with java-game developping? any experience? any ideas? should we change the plan and use C++ together with Direct3D instead? but by doing that how can we make it cross-platform? thx a lot!
----------------------------------------------------------------------------------------------------------------------In history, only steam engine and electromagnetics impelled human beings to make progress......
Advertisement
quote:Original post by Challenger17
A media lab of my university is just started trying developing a 3D game using java for sb. the reason they don't use C++ is becuz this game under plan is designed to be enable running on various platforms, not just on Windows.


Which platforms, which they plan to target with Java, do not have C++ available to them?



[edited by - dmikesell on March 29, 2004 10:23:36 AM]
quote:Original post by Challenger17
... among mainstream games(those famous ones of course) on mainstream platforms i''ve ever heard, there''s not even one game was developped using java.


Well that''s what''s great about universties... it''s a chance to do something that no one else has done!

There are Java games out there, and Java is getting major support among mobile platforms (mobile phones for example - think I''ve even heard rumors of a GBA JVM). Nokia''s N-Gage has MonkeyBall, Tomb Raider and Tony Hawk on it, which are all Java.

There is no reason why Java cannot be used to create a decent 3d game on todays machines. It''s flexible, powerful and mature. Anyone who says otherwise is just closed minded.

Once upon a time a lot of the C community shunned C++, the way C++ now shuns Java. To dismiss a platform by it''s popularity rather then it''s technical abilities is shortsited.

If you want to keep down the Java route, have a look at:
http://www.amazon.co.uk/exec/obidos/ASIN/1592730051/qid=1080574730/sr=2-1/ref=sr_2_3_1/026-0761487-4754867
"Developing Games in Java" by David Brackeen

As this is for an academic project it makes sense to properly investigate this avenue with Java, it also provides you with a wealth of comparison material with other languages, as at least you on your team know C++. Consider the rest of the team too - there is no point going off one way while they go another.

I get the feeling that you''ve written off Java already, so to answer your last question: http://www.libsdl.org/index.phpprovides cross platform bindings for various things in C++, but the licencing may not suite your needs.
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
quote:Original post by paulsdsrubbish
Once upon a time a lot of the C community shunned C++, the way C++ now shuns Java. To dismiss a platform by it's popularity rather then it's technical abilities is shortsited.


But I get the feeling that the converse often happens: because a language is popular, its technical abilities are sometimes misinterpreted. Java's great for client/server web applications. The fact that the overwhelming majority of games are still done in C and C++, however, says (to me anyway) that Java isn't ready for this arena. Some of its exclusion is likely due to the bias that you allude to, but game companies exist to make money. If Java were truly a better solution than C and C++ for games, I would have expected more widespread adoption by now. Why not switch if you can make games that are just as good and cut your development time? It makes good business sense.

I'm not trying to turn this into a flame war, but I think Java missed the boat for these kinds of applications. If anything, C# will start taking "market share" away from C/C++ in the future, not Java.

[edited by - dmikesell on March 29, 2004 12:14:02 PM]
quote:Original post by Challenger17
now the question is. among mainstream games(those famous ones of course) on mainstream platforms i''ve ever heard, there''s not even one game was developped using java.


I have heard of some games being developed with Java. Admittedly, they were not typically "100% pure java" as tended to use native code for some things.

But a lot of web games exist in Java.

quote: java is slow


I''m afraid you have been misinformed. You are obviously using it incorrectly if you find it too slow (either that or doing something VERY intensive).

If Java does not perform well enough for your game, rewrite the low-level rendering code in C, and call it as a JNI library. That is likely to include only a tiny proportion of your code, but will be making up a large proportion of the runtime (as determined by your profiler).

But a lot of optimisations can be done just by coding it correctly in Java.

quote:
Is here anybody familiar with java-game developping? any experience? any ideas?


Only on J2ME devices. Java is obviously very slow on J2ME devices, but this is largely because they have extremely slow CPUs (and their libraries suck a lot). But that''s just me having a whinge

But developing for J2ME is fun in a kind of masochistic way... having a few 100k to play with, a very slow processor, limited debugging capabilities and a recalcitrant javax.microedition library is certainly challenging

quote:
should we change the plan and use C++ together with Direct3D instead? but by doing that how can we make it cross-platform?


You can make it x-platform without using Java. You can use C++, and openGL - then you will only need to rewrite your UI / Startup / Event handling code.

Or you can use C++, SDL, and OpenGL - then you should (theoretically) have to rewrite exactly nothing. On the other hand, you would then be limited to platforms supported by SDL.

Mark
quote:Original post by markr
You can make it x-platform without using Java. You can use C++, and openGL - then you will only need to rewrite your UI / Startup / Event handling code.


Not if you use a portable GUI toolkit like wxWidgets (formerly wxWindows).

If cross platform dependancy is the reason to use Java, you should use C++ in this case.

Why? Java3D Only supports linux and windows, it does not support mac. Just write it in OpenGL and use glut. You can easily compile the same code in both windows and linux platforms.

Except for a few minor compilier syntax differences, it''s all the same.

If you need to stick with Java, don''t use Java3d. It is very buggy, we''re developing in it right now, and we are moving away from it.

Instead, use something like JOGL, those are wrappers for OpenGL. They are much better, more stable, and perform wayyyy way better.
quote:Original post by paulsdsrubbish
Nokia''s N-Gage has MonkeyBall, Tomb Raider and Tony Hawk on it, which are all Java.


Actually, they''re native C++.
I''m sure this sort of thing has been covered many, many times before. :/

Regarding cross-platformability, remember that C++ needs to be recompiled on/for every target whereas that''s not true for Java. Not that that makes a difference as you''ll still have to debug for multiple platforms.

It''s only a matter of time before Java3D is ported to the Mac. The trouble with JOGL or LWJGL is that they are both lower-level APIs and require OpenGL drivers on all platforms.

And Java may be slightly slower than equivalent code in C++ (or it may not, you never know) but any difference will be near-unnoticable for pretty much everything you''ll want it to do.
[teamonkey] [blog] [tinyminions]
Java3D may not be the answer for you. There is a much faster scenegraph library avaiable called Xith3D. It''s not yet in a 1.0 release, but is very stable and much. much more performant than Java3D (on which it is based). Internally, Xith is currently implemented on top of JOGL, an open source, AWT/Swing-based native OpenGL interface (Linux/Mac/Windows) which was started by Sun (along with other gaming APIs). Finally, LWJGL was written for games from the ground up. It''s a native interface (Linux/Mac/Windows) to OpwnGL, OpenAL, and native input (including DirectInput on Windows). One indie title has been released with it already and several more are under development.

This topic is closed to new replies.

Advertisement