I’m a Chinese senior school student addicted to Java Game Programming. I’m new to Java 3D technology.
Lots of 3D technology, such as Java 3D, JOGL, LWJGL, Xith3D, are to choose. I want to be a 3D game developer.
Reading the book, “Killer Game Programming in Java”,introducing developing game with Java 3D and trying the example in that book, I feel the speed can’t satisfy the speed of games. If I want to develop well speed game, which technology should I learn despite the difficulty of the technology?
I’m looking forward to you suggestion, please help me to solve this problem.
It might sound odd, but if you’re just starting out, Java3D may be the fastest. It’s not the fastest architecture, but it is the simplest to understand, and writing well designed programs will usually give you much better performance over raw processing speed.
JOGL and LWJGE will give you the fastest performance from a raw speed point of view. I’m using JOGL for that reason. Xith lies half way between Java3D and JOGL, giving you good speed while also supplying an easy to use scenegraph.
Good luck!
Mark McKay
Thanks for your advice, I will learn JOGL.
I have learn parts of the Java 3D, it’s really the easiest to learn.
I’d recommend JPCT.
Good things about it:
- API is simplier than other existing java 3d APIs - comprehensive and easier to start with
- it has software renderer - could be used inside applets (works also under ms jvm)
- it has opengl support (via LWJGL) - could be used in desktop apps
I’'d not recommend you looking for great performance before you start your first project - remember Knuth’s “premature optimization is the root of all evil” ? First make it work, then make it work fast. I saw lots of projects where people got stuck at the very starting point right after Hello World in java3d. Therefore i’d recommend to look at APIs and start with getting something done - try different engines and see which one fits you.
p.s. When it comes to performance - you can write anything to be either dog slow or superfast - no matter what engine you use. Tweak/profile your code every 2 weeks and see if you can get better results.
gl
Justa c omment…
Used right Java3D is plenty fast. There have been many demos and a few comemrcial games that all ran great written in Java3D. One of our demo games for this GDC is in fact a Java3D based commercial racing/combat game being written by IMI that does real-time physics against real-time deformable terrain. My own Java 3D based RPG client JNWN gives me frame rates faster then the native C/OGL NWN client does on the same map.
Saying “OGL is faster” just isn’t true. Calling OGL has less over-head, BUT that overhead is there in Java3D in order to accelerate complex scenes that simple polygon pushing through OGL would do MUCH slower. In order to match Java3D’s speed for any compelx environmental game like an RPG or 3D shooter you will end up rewriting most of what Java3D does-- and likely not as well given the maturity of the J3D implementation and the epxerience base of the folks who wrote it.
So it really depends on what you are trying to do. If all you are doing is moving handful of polygons around the visible screen space, such as when you do a 2D game using OGL, then yes using any scene-graph APi is over-kill and liekly to slow you down.
But if you want to write serious 3D apps then you’ll only beat J3D’s speed if you (a) are an expert at writing renderers and (b) take advantage of application-specific information that Java3D by definition can’t.
There is a big difference between JOGL and Java 3D in terms of what you get out of the box - using one over the other (or any other API) should be decided based on your objectives.
I started with Java 3D then decided I wanted to write my own engine instead in JOGL - That was a year ago this month and I am still tweaking and adding features to the engine. I did it for a challenge - if that’s your goal then I say go for it, but if your goal is to write a game then J3D is a good way to start. Be fore warned - there is alot of math and knowledge that goes into a 3D engine. Far more then you can probably imagine if you are just starting out. Things as simple as rendering text or picking an object with the mouse or loading a model are not simple when you have to write them from scratch.
I’ve started my 3D games section of my FAQ. You might find some of this useful:
So, please give me some advice about the path learning 3D game programming.
I’m reading Developing Games in Java written by Brackeen for the software mode 3D game programming and
Killer Game Programming in Java written by Andrew Davision for the Java3D mode 3D game programming.
With the comments given above, I read a book about mathmatics knowledge on 3D programming, and learnt
some useful algorithm by reading another book about Java algorithm.
If I want to learn further more, what should I do after finishing the books listed above?
Thanks for advices you give me. With different comments above, I also feel a bit confused.
ps: Thanks for your article, Jeff. It help me a lot indeed.
Thank you for your recommended book. But I’m reading the Chinese first version of that book. There’s no Chinese translation for the second version. I found the knowledge about mathmatics in foreign language isn’t easy to understand.
Hi Seto
Please describe some more, what you want to archieve and how much time you want to spent on it.
I agree with the posters above that you should use an existing engine/scenegraph, if you want to write a game. J3D is a good choice for this. If it is not fast enough for you after you have actually finished your game, you could port it to Xith3d. This engine tries to reproduce the API of J3D in some respect and might give better results for 3d games. It is however not as complete as J3D.
If you still are not satisfied with performance or constraints given by the engine you should start using OpenGL directly either by changing parts of Xith3d or by writing your own engine.
As you can see, getting started might involve rewriting your first work several times, so you should choose the size of your project with care. Most people get stuck by starting out too big, at least thats what happened to me more than once
Conclusion:
If you want to write a game: start by writing a game with an existing engine.
If you want to be a engine programmer: start by writing a game with an existing engine, too.
This way, you will learn most needed concepts and the common vocabulary necessary to communicate with other engine developers this way.
cylab
Cy’s advcie is pretty good. We get there by small steps, any of us.
My first question is this… have you ever written any kind of action game? ( I am assuming actiosn is what yo uwant to do in 3D.) By action I mean something real-time as oppsoed to tunr based. If not, I’d actally recommend you start witha simple 2D game. You will learn all the core parts of game writing on that: the game loop, handlign input, handling AI, even doing multi-player networked if thats where yo uwant to go eventually in 3D.
Once you know all that, the step to 3D is not all that hard, but to try to learn it all at once is pretty tough.
OTOH if you just want to write 3D apps and arent concerned about real-time game type performance, you can dive straihgt in with Java3D. Its an excellent leg up. The only thing you can;'t so with it today (and I need toa dd this to the FAQ while I’m thinking of it) is some of the very latest cuttign-edge graphics things like multi-pass rendering and redner-to-texure (which is necessary for many of the latest, coolest pixel shader algorithyms.) This is because the Java3D team needs time to add these things, and because they always wait til a standard emerges before they encorporate it so they don’t have to destroy backward compatability like they would if they implemented a solution and then a different one became the standard. (The stuff I just mentioend is planned for Java3D 1.5, the next major version. By then though tehre wil llikely be OTHER new stuff… )
I knew what to do now. Cylab, thanks for your advices.
Is there any open source game engine written with JOGL? May I have the name of it? So I can do as cylab said start with a game engine and study it.
Xith3d has two renderers (the software-component, that actually draws the geometry managed by the engine), one is written using LWJGL and the other one using JOGL. Both libraries implement the OpenGL standard.
Nevertheless I would start using Java3D, since it is better documented and Xith3d uses the same basic architecture, so you could easily change to Xith3d once you have masteres the basic concepts.
Okay, thanks a lot.