JME versus JOGL

Hi,

I’m experiencing OGL via JOGL to eventually make a 2D based game with OGL. While I’m still exploring the various Java graphics API I was wondering what about JME? Do you think it would be more productive to use it for a 2D based game or is it just as painful as any OGL API? Is JME simple and high level enough for 2D? Note that I’d like to use it while beign able to use advanced OGL features such as lighting and blending for example.

Thanks

JME isn’t an OpenGL binding, it’s a scenegraph like Java3D (or Xith, or the Agency 9 stuff). Not really comparable to something like JOGL. It’s not really suited to 2D games development, the emphasis is very much on 3D - check out hte JME demos for more examples.

Kev

OK thanks for the info. I didn’t express myself correctly. I know that JME abstracts the underlying rendering API. What I was wondering is: is it possible or simply a good idea to use JME to do 2D gaming? A lot of 3D APIs are able to do 2D as well.

I find it pretty easy to set up for 2D stuff. It supports orthographic projection mode.

If your wanting to do a 2d game in opengl then lwjgl might be the best place to look. I think you might find yourself fighting against the design of jME if you try and use that for a 2d game.

Dan.

There already are some people, as CaptainJester seemingly, who use it for 2D. It does not seem they struggle much with the design. Maybe you should post over at jmonkeyengine.com and ask if they like it for 2D, too. It might be easier than using lwjgl or jogl directly.

My point is that doing 2D in OGL requires many operations that could be done by default by a higher level API above OGL. For example when you load translucent textures you have to enable blending and this in 2 calls. You have to call methods such as viewport, matrix mode, ortho, etc. All these sort of setups that could be done by default in a 2D based API above OGL. It’s not that complicated once you’ve learned OGL but the learning curve is rather high when you only want to do 2D.

I’ve looked at GTGE but it doesn’t seem to be maintained actively and version 1.0 hasn’t been reached yet so there is a high risk of API changes and I don’t like to develop with an API that is at a version far far from a final release.

Here is what I found in JME forums about 2D games with JME:

http://www.jmonkeyengine.com/jmeforum/index.php?topic=2416.0

To me, it is very easy to use JME’s Quads as 2d sprites. And you even get the extra benefit of having a scene graph (which is suprisingly very helpful - even for 2d) The only difficult thing you might have trouble with is getting precise pixel level type collision detection (if using Quads). If you choose to use Quads, I would not try collision detection at the pixel level (there are several other approaches that should give close enough results and be faster).

I’d recommend something far more lightweight, just a sprite engine really, rather than a whole big scenegraph thing. It’s quite fun learning to write a sprite engine but if you want some pointers take a look at my Shaven Puppy Game Library code which has quite a nice one in it you can learn a few tricks and tips from.

Cas :slight_smile: