A solid starting point: jME + FengGUI (with RenderPasses)

Let me first tell you that I'm relatively new to jME, and a junior java programmer. I've been browsing the tutorials, wiki, articles, these forums and I think I now have a decent understanding of what jME is and how it's structured. However, I'm still having trouble with finding 'the right tool for the job'.



What I mean is; there are a lot of choices to be made in order to write a game. Although I understand how everything works, I miss some feeling for what to use. Let me give you a real life example here:



I've got plans (like all of you) to build a game. Here's a list of what my game should be able to do:


  • Preset the player with a login dialog (username/password) after the game starts

  • A simple 3D environment (a Quad being the terrain and a Box being the player) after the login button was pressed.

  • A chat window to see chat messages and enter new ones



The thing is, all the articles and tutorials I find take the most basic approach to illustrate what jME can do. But how do I approach this?

I've read that FengGUI is ideal for making the chatbox. But should I use a separate FengGUI game state or should I opt for the RenderPass solution?

I've been able to write a class that can create a lot of things (skybox, the terrain Quad, the player Box, handle input etc.). But is this a good approach? I don't think it's a very maintainable solution.

I think the current documentation available for jME is great at explaining what all bits and pieces do. But I'm missing a 'big picture' kind of tutorial. I would be happy to write it, but I just don't have enough experience and knowledge at the moment to do it. (If I get through my example successfully, I'll be happy to write an article about it).

So, my question to you jME'ers is: what would be a good way to construct my example project? (Or a larger project in general?) How have you constructed your games in the past or how would you do it in the future?

Thanks for sharing!

Well a quick answer would be - check existing code that is available. Here are some:

Monkey-Mahjongg, Stardust, FlagRush tutorial series, Aircarrier (perhaps), Java Classic RPG, Prince of Blades, Radakan (here is SVN)… and there are probably many more I just do not have a ready link to…

Yes, existing code is very useful. I've been reading about component based designs, loading game data from XML (instead of hard coding it all) and GameController. All very useful for the greater scheme, so to say.

Did you see this wiki entry?

http://www.jmonkeyengine.com/wiki/doku.php?id=fenggui_jme_appl_using_standardgame

In this Tutorial i tried to cover all possible Problems that one can encounter when using jME + FengGUI.

It also shows why you need to use RenderPasses.



I think this would be a good perfect base for your game. :slight_smile:

You can start implementing your game logic in the InGameState and create the chatbox in the  FengGUIGameState and go from there.


Core-Dump said:

Did you see this wiki entry?
http://www.jmonkeyengine.com/wiki/doku.php?id=fenggui_jme_appl_using_standardgame
In this Tutorial i tried to cover all possible Problems that one can encounter when using jME + FengGUI.
It also shows why you need to use RenderPasses.

I think this would be a good perfect base for your game. :)
You can start implementing your game logic in the InGameState and create the chatbox in the  FengGUIGameState and go from there.


Core-Dump: yes, I saw it, and I'm currently trying to implement it with the passes, but I'm really confused about GameStatePass and BasicGameStatePass and all that. This is probably due to a lack of knowledge on my part.

Anway, it's a good start. But don't think putting all my game code InGame state is a good idea.

I don't want to tell you to discard FengGUI but I hit the same issues. My game client used several game states and a GUI using Swing. Then I had some problems with forcing focus on some components and I've been told that FengGUI is much faster than JMEDesktop so I gave FengGUI a try.

Sooner or later I had to find out that the seperation of render passes for jME and FengGUI just does not fit into game states in a more complicated scenario. It's OK if you use only two game states or maybe none at all, but the more you take advantage of game states the bigger problem the common render pass will get.

Meanwhile I'm back to Swing and that allows the game states be defined as they should, i.e. with their own update and render functions and no dependencies on other game states and a common render pass.


ariejan said:

Core-Dump: yes, I saw it, and I'm currently trying to implement it with the passes, but I'm really confused about GameStatePass and BasicGameStatePass and all that. This is probably due to a lack of knowledge on my part.

Anway, it's a good start. But don't think putting all my game code InGame state is a good idea.


I guess the GameState  / RenderPass  combination thing should be covered in its own wiki entry.

Basically you have a GameState which contains a RenderPassManager, this GameState calls the update/render Methods of the RenderPassManager.

Now you can add other GameStates to this RenderPassState which add the GameStates to the RenderPassManager when being added.

All GameStates added to this RenderPassManager are rendered as a RenderPass.

This seems to work for FengGUI

mjsimpson made a good point there.

jMEDesktop has some problems on MacOS Paltform (still i think?) and FengGUI can be hard to play together with jME nicely, so, i guess it would be a good idea to take a look at GBUI.