Example projects

I am new to JMonkeyEngine and returning to Java after twenty years. To get a better understanding of the architecture of a multiclass game, I am looking for example projects. Does anyone know where I can find some?

I keep running into scoping problems and am looking for ways to - i.e. - use assetmanager in other than the main class.

Is there also a place where I can find extensive documentation on all classes, their properties and methods with a somewhat more explanation than the JavaDocs? And why are the JavaDocs not searchable?

2 Likes

We have the jMonkeyEngine Documentation :: jMonkeyEngine Docs.

Using assetmanager… Appstates is typically the way to go. They have the binding method where you can get the assetManager reference. But surely you can just pass the instance around to any class you have. Just modifying the actual scenegraph you need to be in render thread (or enqueue it to be processed on the render thread).

We have also the examples. But these are typically very small specific examples rather than architectural examples. You can find these from jME Github. Or if using the SDK you can just create a new project with the said examples initialized for you.

For more complete examples… I’d search Github with jme & jmonkeyengine tags. Also semi frequent topic here in the forums.

2 Likes

There are some examples here:

They are mostly networking examples but can show how a game can be broken up into different classes and have examples of app states and so on… all of which are useful to understanding recommended JME game structure.

sim-eth-basic - is a simple networked spaceship “game” (no actual shooting implemented or anything) where you can login and fly spaceships around. This is using a classic “game object” architecture.

sim-eth-es - is the same “game” except using an entity system instead of plain game objects.

Either one shows how to decompose a game into app states, etc… but if you are not into learning about entity systems then sim-eth-basic makes more sense.

If you ARE interested in learning about entity systems then there is the single player example of a full asteroids clone:

But “entity systems” (entity component systems) are a big topic on their own with a significant (but super rewarding) learning curve.

2 Likes

Thanks, the projects help a lot.

I did read the online documentation, but I am still left with a lot of questions. Like:

  • what are the primitives JME can create out of the box?
  • why are Uniforms I define suddenly prefixed with ‘m_’ in the shaders? And are there any examples how to use shader nodes?
  • What types of lights, camera’s, controls and other stuff is there and how to use them?

It would be a great improvement if the Javadocs and the tutorials could be linked.

I will get there anyway, and I am having fun with my first project.

2 Likes
1 Like

I am looking for example projects. Does anyone know where I can find some?

Short answer: GitHub!

I maintain a large number of open-source projects that use JME—mostly libraries, tech demos, and tools (not games). For summaries of all my projects, see https://stephengold.github.io/

Of particular interest for your situation:

  • jme3-maze is an embryonic game: link (4k LoC)
  • More Advanced Vehicles includes 3 demo apps, each with a different UI: link (15k LoC)
  • Maud is a sophisticated editor: link (41k LoC)

JME-based open-source games at GitHub (that I’m not involved in):

There are also JME topics at GitHub containing many interesting projects, including games and game templates:

JME also has its own project library, which presents various open-source projects in a uniform format: https://library.jmonkeyengine.org/

2 Likes