Skip to content
You're reading the docs for Railroader 0.6 (the MoW Update), currently available on the Experimental branch.

Asset Packs

Mods in Railroader are packaged in Asset Packs, a directory with a specific layout.

An asset pack is a directory containing an Info.json file and one or more assets: JSON files, Relay scripts, or a Unity asset bundle.

The directory name is not important; asset packs are uniquely identified by their identifier in Info.json.

This example Info.json file contains the mod’s unique identifier in domain/id format, the display name, author, version, license, and dependency information. For more, see Info.json.

{
"identifier": "rr/bigboy",
"name": "Big Boy",
"author": "Anonymous",
"version": "40.1.4",
"license": "CC BY 4.0",
"dependencies": {
"required": [ "rr/game >=0.6.0" ]
}
}

Definitions.json is used to define new in-game objects (rolling stock, props, whistles, horns). We recommend using the in-game editor to work with this file. Its structure is documented in Definitions (the object kinds you can define) and Components (the building blocks you attach to them).

Asset packs may contain special scripts like Data.rl (runs as part of the definition loading sequence) and Main.rl (runs once the world loads). For more, see Relay.

The files described above (Info.json, Definitions.json, Relay scripts) are included directly in the asset pack as regular files. Binary assets like models, textures, materials, and sounds must be built into a Unity asset bundle using the ADK.

The following Unity asset types at the root of the asset pack source directory are automatically built into the bundle:

  • Prefabs (t:Prefab) (models)
  • Materials (t:Material)
  • 2D Textures (t:Texture2D)
  • Audio Clips (t:AudioClip)

These assets can be referenced using asset identifiers. For example, my-engine.prefab in the somebody/my-engine-pack asset pack would have the identifier somebody/my-engine.

Materials and prefabs in your pack can use the shaders, materials and textures in rr/shared. The game supplies those (see Shared Assets).

Using another mod’s assets this way isn’t fully supported yet. Depending on where an asset sits in that mod, your pack either gets its own copy of it, or links to the copy of that mod built alongside yours. A link breaks when players have a different build of that mod, such as the one its author published, and the asset shows up missing in game. We plan to improve this in a future update.

Definitions don’t have this problem. A definition can name another pack’s asset by its asset identifier.

See Installing Mods for how players install, enable, and manage mods.

For development, Railroader also loads packs from %HOME%/Documents/Railroader/ModDev/. Packs here override any pack with the same identifier, regardless of where it came from — this is how you test changes to an existing pack (including built-in ones) without touching it. The in-game editor reads and writes here.

Steam Workshop is not presently supported but we plan to support it in the future.

To build an asset pack, continue to Building Asset Packs.