I'm lost with StandardGame

I have read through all the things in the wiki that I could find regarding StandardGame but I am still finding myself at a loss with it. Nothing really seems to start from the beginning.



Could someone please point me to articles that will help me with getting started with it? I have read about gamestates and multi threading etc… but I don't really understand how to implement them. Let alone how to organise them.



I'm sure once I get the fundamentals under my belt I'll be able to progress by myself but at the moment I am completely stuck.



If someone could explain it to me I'd be grateful? Or just some articles that start from the beginning would be very helpful.



Thanks



Neilos

You mentioned you’ve read some of the wiki about standard game.  I’m not exactly sure what you’ve read, but have you looked at this it might help a bit more: =simplegame&s[]=standardgame]http://www.jmonkeyengine.com/wiki/doku.php/simplegame_to_standardgame?s[]=simplegame&s[]=standardgame

The question is, do you really need it right now? StandardGame can make you crazy if you don't not know what you are doing (and I'm speaking about me as I got crazy). It can be very confusing about what have to be set in the queue and what not, and to understand that "executing" something in the queue is executed in the future, so if you don't wait for the result there is no result after adding it to the queue etc.



A good thing to be prepared to switch to standardgame someday is to know the concept of the gamestates (which is not bound to standardgame only).

You mentioned you are using BaseGame, so it is quite easy to switch to GameStates. Create a new BaseGame and init the GameStateManger in your init-method:

GameStateManager.create();



This creates a GameStateManager-singelton which itselfs is just a GameStateNode.To that you can add more gamestates. Gamestates can be switched on and off (like controllers).

In your update-method:

        GameStateManager.getInstance().update(tpf);



In your render-method:

GameStateManager.getInstance().render(tpf);



That's it for handling GameStates.

Your former main-programm can be turned into a BasicGameState (there are several gamestates that have already lights and standard-movement like DebugGameState). There you also have an update- and render- method. Actually I think there shouldn't be much difference beside you have to add your init stuff in the constructor.

Once you have created your new GameState e.g. with the name PowerGameState you can add an instance of it to the gamestate-manager in your basegame:

PowerGameState pwr = new PowerGameState();
pwr.setActive(true);
GameStateManager.getInstance().attachChild(pwr);



GameStates can be combined as you want. YOu could create a hud-gamestate or menu-gamestate and just switch it on and off by activating/disabling the gamestate.

Ok,..don't know how useful that post was as you asked for standardgame. StandardGame uses the GameStateManager as well, so you don't have to create it on your own. But working with the queues makes it too complicated for starting with jME. jME still have enough other traps you should jump over before :D

Good luck

The thing with StandardGame is that it seems completely different from the other game types. I just about understand the concept of game states and I think that I need to implement a few in BaseGame as ttrocha says. I think that that is a great idea rather than tackling them straight away in StandardGame (I didn't realise that I could implement the GameStateManager in BaseGame) I'll take baby steps and get a game state manager, with a few gamestates, up and running in BaseGame before I tackle StandardGame. Hopefully by that point game states will be second nature to me and I'll just have to worry about all the OpenGL errors I'm bound to create rather than all of it at once.



Thanks guys, StandardGame was keeping me up at night so, at least for now, I can sleep soundly  :lol:



Neilos