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?
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.
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.
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/