For everyone — The same film, projected on three different screens
Think of a movie: the film itself never changes, but you can watch it on a smartphone, on the living-room TV or on a very large screen — and the story doesn't change by an inch. That is exactly the principle this article tells: in the Yokul project, the "film" is the simulation of the virtual world (the beings, their decisions, their movements), and the "screens" are the different ways of visualizing it. JMonkeyEngine, an open source 3D game engine for Java, served one of those screens. Its secret is component-based construction: every game object is assembled like a model kit, with physics on one side, appearance on another, behavior elsewhere — independent blocks that can be swapped without tearing everything down.
Why is this interesting? Because it is how the video games you know work, but also flight simulators for training pilots, virtual apartment tours, or rehabilitation with a VR headset: the rich content and the rendering must move forward separately.
For Yokul, it was a proof at full scale: after some 3D rendering trials in 2012, the same behavior models were shown in 2016-2019 in a virtual reality headset, with nothing rewritten. The promise of blocks assembled "like Legos" held up.
One honest caveat, which the full text owns: those trials never aimed at a "game". The actors were deliberately simple, the 3D models royalty-free or roughly shaped — the ambition was the proof, not the spectacle. It is also a way of showing the blocks: no artistic diploma required.
The full text
JMonkeyEngine is an open-source game engine for Java, which lets developers create 3D games using graphics and physics libraries.
JMonkeyEngine uses a component-based design model to create in-game objects. This model is based on the principle of separation of responsibilities and makes it possible to create modular objects that can be easily reused and extended.
The component-based design model
In the component-based design model, an in-game object is made up of several components, each with a specific responsibility. For example, a game object may have a physics component, a graphics component and a behavior component. Each component is responsible for its own logic and can communicate with the other components to create complex behavior.
An example of using the component-based design model in JMonkeyEngine is the creation of a game character. The character can have a movement component, a physics component, a graphics component and a behavior component. The movement component handles the character's movement, the physics component handles collisions with other objects in the game, the graphics component handles the character's appearance, and the behavior component handles the character's behavior in response to specific situations.
The component-based design model offers several advantages for game developers. First, it allows the creation of modular objects that can be easily reused and extended. In addition, it makes code maintenance easier by reducing complexity and avoiding excessive dependencies between the different components.
The engine also provides the usual foundation of a 3D game: a scene graph to organize the models (terrain, biotopes, individuals) hierarchically, a game loop that processes inputs, collisions and state updates every frame before rendering, and a dedicated physics engine. These are precisely the mechanisms that Yokul was able to put to work — or leave aside — without touching the rest of its architecture.
A first 3D rendering: replacing the base graphics components (2012)
Our first attempts at rendering the virtual world relied on Java's base graphics components (AWT/Swing). That choice, classic for a prototype, quickly reached its limits: two-dimensional and schematic representation of the entities — animals, plants —, interactions that were hard to read, and no feeling of presence in the simulated environment. The rendering, hostage to interface-design widgets, was holding back the visual validation of our behavior models.
It was in 2012 that we adopted JMonkeyEngine as an experimental rendering layer. This move to a real 3D engine allowed us to:
- represent the entities of the world (animals, vegetation) as 3D meshes within a textured and lit scene, instead of simple 2D graphics components;
- take advantage of the engine's scene graph to organize the models hierarchically (terrain, biotopes, individuals), and animate movements, growths and interactions smoothly;
- clearly separate visual representation from logic: the entities' state data (position, energy, life cycle) fed the engine's graphics components, without ever mixing responsibilities.
Creating a game rendering is — at least at the time, before large language models started assisting the production of code and assets — a very complex and time-consuming task. We therefore deliberately limited our ambition: the actors were intentionally simple, represented by royalty-free 3D models or roughly shaped in Blender, and we did not try to turn these trials into an actual "game". Likewise, the engine's 3D physics was not connected to the actors' data: only their position was fed to the rendering, which proved largely sufficient for perception management — that is, determining, for each entity, what it perceives of its environment and its peers.
This move to 3D did, however, have one direct consequence on the simulation layer: the proximity-management algorithms had to be slightly adapted. Moving from a 2D topology to a continuous three-dimensional space changes the formulation of distances and detection volumes around each entity. To do so, we drew on the notions of comfort and ignorance zones from proxemics, i.e. the theory of relational distances (intimate, personal, social, public) formalized by the anthropologist Edward T. Hall (The Hidden Dimension, Doubleday, 1966), and on the principle of local perception within a bounded neighborhood popularized by Craig Reynolds's group behavior models (boids, Flocks, Herds and Schools: A Distributed Behavioral Model, SIGGRAPH '87). Here again, the separation of responsibilities paid off: this adaptation stayed confined to the perception layer, with no impact on the behavior models or on the rendering.
These trials convinced us, from that early stage, that a third-party rendering engine could be integrated into our architecture without trouble, and that the design of behaviors could be done in a way fully independent of its visual rendering.
Immersive virtual reality visit (2016 – 2019)
Between 2016 and 2019, we went further by using JMonkeyEngine no longer only as a rendering test bench, but as the support for an immersive virtual reality visit of the virtual world, through a port covering the headsets supported by Steam (SteamVR).
The goal of this phase was not to produce a final product, but a proof of concept coupled with methodical learning:
- validate, through practice, the actual separation between the engines and the behavior design, on the one hand, and the actual implementations of the renderings, on the other: the same entity models — same decisions, same states, same interactions — had to be served indifferently to a historical 2D rendering, a desktop 3D rendering, then a stereoscopic VR rendering, with none of them modified;
- measure concretely the constraints of VR rendering (consistent frame rate, latency, user comfort) and their impact on the architecture: moving simulation computations out of the game loop, limiting state transfers to the essentials;
- gain direct experience of immersed interactions: moving through the world, observing entities at real scale, aiming the camera with the head — all elements that inform the design of future interfaces for exploring our worlds.
This feedback was decisive: it confirmed that our separation of responsibilities — behavioral design on one side, rendering implementations on the other — delivered on its promises across three radically different rendering channels. It also guided our later choices: openness to technological alternatives, clean communication interfaces between simulation and visualization, and the ability to change rendering engines without rewriting the models.
See also
- Behavior Model
- Separation of concern — the principle carried by the component model