About to start my second jME project, unsure about design pattern

My previous jME project was finished almost a year ago: http://www.youtube.com/watch?v=mThJ5LNAOX0



The coding part went alright. I made it up on the go. However for my next project I want to prepare more in advance. It is going to be bigger and I am aware that big projects need structured code, or else it will turn into a mess. So I’ve made this design in UML. I’m not very good at UML so I may have gotten something wrong. It’s not entirely finished obviously. Are there any UML examples for jME projects?



http://i.imgur.com/0Z5yl.png



The game itself will be a singleplayer RPG game. It will have quests and you can battle monsters to advance in levels as an ordinary RPG game. I’ve never worked with AppStates before so I’m wondering if they work as I think. When the game start I will have a main menu using nifty GUI. If the player selects New Game then GameAppState will be loaded and a cinematic will be played at the start of the game. One AppState for the menu and on while in the game. That’s how it works right?



I’ve looked at the MonkeyZone source to get ideas. Also went through almost every tutorial. I feel there is a lack of tutorials on how to design your code. Does my design pattern look good? It’s far from finished as you see and I would like suggestions and feedback before I continue.

Any global (ie: non-node specific) component should be an app state. And sure, there is nothing wrong with having a GameAppState set them up. In fact, if it were me, the main menu is an app state, the playing of the cut scene is an app state, the loading screen is an app state, etc.



If you have a HUD with components then they can be app states, too.

All my screen are app states :D. My custom nifty components too :D.

More app states then! Is it good practice to have multiple app states at the same time? Lets say I have GameAppState when I’m in the game. Then CinematicAppState is used to show cinematics. And one app state that listens for key inputs while there is no cinematic? If the player pauses the game I can have a PauseMenuAppState that lets the user click on options.

I have 8 or 10 app states at any given time in various states of enablement.

Yes. It’s fine. AppStatesare the GLOBAL states.

I have started programming now. Going smooth so far. I’m doing it on GitHub: GitHub - WASDi/BigGameProject: Made with jMonkeyEngine

Currently I just have a main menu. And when you click it the terrain gets loaded (will implement a loading screen eventually).



It would be great to get comments on how my code is as of now so that I can fix potential problems before they get big.

Cool, glad to see it will be open source :slight_smile: