Making games

Projects and assets

A project is a folder. Everything your game needs lives inside it, so you can copy it, zip it or put it in version control like any other folder.

my-game/
  project.otter.json        the project's name, version and settings
  assets.db.json            every asset's id (see below)
  config/
    input_actions.otter.json    the game's controls
    collision_layers.otter.json the names of the physics layers
  assets/
    scenes/                 your scenes (.otsn)
    scripts/                Cog scripts (.cog)
    materials/              materials (.omat)
    ...                     anything else you add
  build/                    where Build Game writes the finished game

File → Project Settings edits project.otter.json and the two config files: the name and version, which scene the game starts in, the window size, the lighting limits, the controls and the physics layers. See Input and Building your game.

The Assets panel

The Assets tab at the bottom of the editor shows the assets folder: folders on the left, their files on the right. From there you can:

  • Import… files from anywhere on your computer into the project.
  • Make a New Folder or a New UI Document.
  • Right-click a file to Open, Rename, Duplicate, Show in Explorer or Delete it. A rename keeps everything that used the file working (see Addresses and ids below).
  • Filter by name, or by kind with the buttons beside the filter.
  • Double-click a scene to open it, a UI document to edit it.
  • Place a prefab in the scene with the + on its row.

What you can import

KindFiles
Models.glb, .gltf, .obj
Images.png, .jpg
Sounds.wav, .mp3, .ogg, .flac
Scripts.cog

Importing a model

Importing a glTF model brings in everything in it:

  • Each mesh inside the file becomes something you can pick on its own, for a Mesh Renderer or a mesh Collider. The file itself stays as the artist exported it, so exporting it again updates your game.
  • Each material becomes a .omat file and each texture an image file, in a folder beside the model. You can edit them like any other material.
  • The model’s objects become a prefab, and an instance of it is placed in the scene.

Addresses and ids

Inside Otter, a file in your project is named by an address such as assets://materials/wood.omat. You’ll see addresses in the Inspector and use them in scripts (Scene.load("assets://scenes/level2.otsn")). A mesh inside a model has an address too, ending in the mesh’s name: assets://models/house.glb#mesh:Roof.

Behind every address is an id that never changes, kept in assets.db.json. Scenes and prefabs store ids, not addresses, which is why renaming or moving a file in the Assets panel doesn’t break anything that uses it.

There are two other kinds of address:

AddressWhat it names
assets://...Your project’s files. In a built game, the packed copy of them.
user://...Files the game writes while it runs, such as saves. They live in a folder the computer keeps for each user, named for your game (see Saving data and Files).