Creating a terrain for Rigs of Rods is quite technically involved and largely manual process. This page aims to give you an overview of required work, as well as guides and advice for your own projects.
Anatomy of terrain
Before you start making your own terrain, you need to know and understand what does a terrain consist of and how it all works together.
Obviusly the most signifficant part of the terrain. Ground provides a surface for land vehicles to drive on, airplanes to take off from/land on etc. Ground has shape, physical properties like friction and visual attributes.
In RoR, the primary method of defining ground shape is using a heightmap. A heightmap is a grayscale image where black represents lowest areas and white represents highest areas. A visual 3d ground is generated by RoR when map is loaded.
Physics properties are defined using a configuration file which defines surface types, as well as a set of images which define areas of effect for the surface types.
Visual appearence is archieved using tiling textures, texture blending (a.k.a splatting) and built-in shader effects (normal mapping, specular mapping).
An alternative approach to creating ground is to implement it as static object. In this case, none of the above applies. The shape would be defined by the mesh (3d model) geometry. Physics property setup is different. Visual appearence is specified by material script.
Another typical part of a landscape. Bodies of water can vary in size from small ponds to lakes and seas.
RoR implements water as a single body covering the whole map and penetrating all objects. It’s specified as “water height” attribute of the map. All areas below the specified height will be flooded.
Anything that doesn’t move. Mostly buildings of all kinds, but also roads, structures like bridges, and finally roads and other tracks.
Each of these objects must have a visual mesh (3d model). RoR uses OGRE’s “.mesh” format.
Static objects may also have a collision mesh and associated friction settings. Those which don’t are ethereal - vehicles just drive through them.
Static object may also trigger special events. A “truck shop” building will, when entered, will display a vehicle menu. A “load spawner” deck will bring up a menu with trailers and loads. And so on.
Stationary dynamic objects
Stationary or semi-stationary objects like cranes, hall doors, bridges or wind turbines are made from dynamic physical model, just like vehicles, except they’re completely or partially fixed to the ground.
The basic structure
Terrains are distributed as ZIP archives containing a set of terrain-definition files and various resources. A terrain must be in a ZIP archive, otherwise it doesn’t load correctly.
- .terrn2: Entry point for the terrain. This is the only required file for a terrain to have.
- .otc: “Ogre Terrain Config”. Configures the OGRE::Terrain subsystem which RoR uses for terrain display.
- .os: Caelum system (sky/weather) config. Visuals only.
- .hdx: Hydrax config (0.4.5 and up). Water display.
Note that, to this date (04/2016), there is no editor which would create these files for you. You need to copy a template and work manually from there.
As said above, RoR’s primary mechanism for shaping a terrain are heightmaps. We use 8-bit or 16-bit unsigned integer RAW heightmaps. These can be converted from images or generated in a specialized tool. We provide tutorials for several of them.
To use the heightmap in a terrain, you must configure it in “.otc” file (filename, size, bit depth…) and include it into terrain’s ZIP archive.
You can use ImageMagick to convert to and from the .raw heightmap files:
- To convert from a .raw file to a bitmap image file issue the following command:convert -depth 16 -size 1025x1025 -endian LSB gray:mymap.raw mymap.bmp
- To convert back to a .raw file for RoR execute: convert mymap.bmp -resize 1025x1025 -endian LSB -flip gray:mymap.raw
- For more information, see ImageMagick’s command-line processing page.
The system is designed for texturing by several tiling textures combined via built-in texture blending (aka texture splatting). Other build-in effects: normal mapping, specular mapping, parallax mapping.
Terrain supports “Global Light maps” (Mountains will shadow the terrain if the sun is low, etc…), but this feature is not currently used by RoR.
To be written…