Need tips for achieving certain graphic/game features


I’m an experienced Java programmer, but new to jMonkeyEngine.

I would like to start developing a game, but I need some guidance about some topics.

As I can see by the tutorials, the way to create a 3D world is well documented, at least for beginners. Anyway, I would like to know what frameworks are used to do what I want.

I want a 3D world, with players moving, for that I believe jMonkeyEngine would do the trick very nicely.

Now for the following features, I would like to ask the best way to achieve them:

1. Overlay graphics

Looking at screenshot (or video), we can see some 2D objects laying around the screen, like the map, player stat bars, and action buttons.

Is it achievable by using only this engine? How would I do it?

In a 3D world, I could display a cube with minimal depth, and apply a texture … but that would not be the best method, since the camera can change, and the cube would also need to be translated/rotated accordingly … and the textures would need to be dynamically updated …  :expressionless:

2. Multiple games/zones

I also need to have 3 main zones … 1 menu zone, where I could load, save, quit, change settings, and then in the game, I would have 2 zones … one map, with a detailed map where I would choose a section, and would have several options to play with, and selecting a section, would bring me to a detailed 3D world of that same section, with players and all.

Something like Simcity4 where (as I recall) we have a main map, where we can do certain actions, then when a player selects a zone, it enters the 3D mode of the city. As I can imagine, I would need 2 classes that extend BaseGame, one for the map mode, and the other for the 3D section mode … correct?

How would they interact? Because a specific action on the 3D section mode could trigger a game action on the map mode (like the section becoming conquered, and so it would change color and certain statistics).

Thank you in advance. I’m looking forward to implement something using this engine.


hi and welcome, its all in the wiki:


Hello, wecome to JME.

Looks like you have a pretty good idea of what you're doing already.

Overlay graphics: This is quite easily done with JME, using the ortho render queue. Ortho items are positioned with screen coordinates rather than world coordinates. You can place things on the screen and they will stay there regardless of what the camera does. I can't link the URL but a wiki search for ortho will turn up some example code.

A common approach, and what I do for my all my menu and hud elements, is along the same lines as your idea. Use texture mapped quads in the ortho queue. This allows you to display absolutely anything with full control over transparency and blending. For more sophisticated and heavyweight UI's it might be easier to use one of the GUI libraries already written.

Multiple games:

If I follow you, then a lot of people use GameStates with StandardGame for that. You don't need to though.

BaseGame doesn't do any black magic. Essentially it just runs a simple loop and makes calls to abstract methods where you will set up the display and do game logic.

So your application is doing everything important. You can maintain entirely seperate scenes and choose which to render in your own code, for example - since you implement the render method.

So one BaseGame which sets up the display and runs the game loop. Then within its update and render methods your own app can decide which parts of your code to invoke.

Hope that helps.