GardenTrains developer's technical documentation, writen by Quintus Hegie for computer geeks.
With this documentation you'll be able to develop new levels and create new game objects (locomotives and/or wagons).
If you're a web developer and you have a question about 3D progamming and/or BabylonJs, please contact me on HTML5GameDevs.
If you're a game player instead of a developer, then you can find the manual here.
The game specific soure code is protected with legal copyright!
The code may be changed at any time without any notification, rendering any custom additions maybe no longer compatible with the latest version.
The player generally has a good camera view over the whole level.
Therefore most meshes are visible and need to be rendered most of the time.
This creates a challenge for keeping a constant and high framerate.
That is why I use some specific scene optimization techniques for this train game.
A level mainly consists of a terrain or playing ground, that is visible in full or in large part.
Next in line of frequently visible meshes are the train tracks.
The train tracks may be observed from very close by (when camera is set to train drivers view mode) as well as from a large distance (when camera is set to level map view).
A technique to speed up rendering when using various distances to view the same mesh is to apply Level of Detail (LOD).
A locomotive is equiped with a motorblock and is controllable by a player.
A wagon is not motorized and needs to be pushed/pulled by a locomotive.
The tracks within the game are laid out within the trainline system.
Each segment within the TrainLineSystem is called a TrainLine.