Template Files

Documentation for writing template files.

On this page you learn:

  • The format template files are written in

  • How to write your own template files

  • About meta files

  • About template file methodology

Writing Template Files

Template files are written in JSON format, which uses key-value pairs (much like Python dictionaries) to serialize data. You can read up on JSON here.

Complete Template File

{
    "name": "my-system", // name of the system
    "author":  "My Name", // author of the system
    "limit": "365d", // time the simulation 
    "delta": "30min", // change in time (calculation frequency)
    "t": 0, // starting time (0 in template files)
    "radius_multiplier": 1,
    "bodies": [ // list of bodies
        {
            "name": "name", // name of the body
            "mass": 1, // mass of the body in kg
            "radius": "1km", // radius of the body
            "color": "red", // color of the body
            "r": [0, 0, 0], // starting position
            "v": [0, 0, 0] // starting velocity
        }
    ]
}

Writing Meta Files

Meta files are JSON files that contain metadata for a system (e.g author, name, license etc.) and are normally placed in a directory with a catalog.ax file (read more on that here)

Example Meta File (from solar-system.meta.ax in v1.11)

{
  "name": "solar-system", // name of the system
  "author": "jewels86", // author of the system
  "license": "MIT", // usage license
  "description": "Template for Solar System.", // a description of the system
  "path": "solar-system.tmpl.ax" // the path to the system relative to the catalog file
}

Template File Conventions and Methodology

  • Template files can and should be edited! Any changes you need to add to the simulation, change the file!

  • Systems are generally named after their main body and the group the smaller bodies belong too (e.g earth-satellite.tmpl.ax or jupiter-moons.tmpl.ax) or just the system's objective in general (e.g rocket-launch.tmpl.ax).

Last updated