Everything references something
A crate is five files
Section titled “A crate is five files”Look at one crate in the hideout. It’s drawn because the hideout’s level places a model. The model names a mesh for its shape and a material for its wood, and the material names the texture that paints it.
Each one uses the ones to its right.
- Levelhideout_
master. places the cratelevel - Modelcrate.
model - Meshcrate.
gr2. its shapeimport - Materialcrate_
wood. its surfacematerial_ instance - Texturecrate_
wood_ its colouralbedo. png. import
Each of those links is a referencereference: One file naming another it needs: a level names its models, a model its materials, a material its textures.: one file naming another. Almost every change you make touches this chain somewhere. Swap the texture and every crate using that material changes. Point the model at another material and only that model changes.
References use identity, not names
Section titled “References use identity, not names”Every asset carries a permanent ID, its identityidentity: The permanent ID every asset carries. References use it rather than the path, which is why a file can be moved without breaking what uses it., given when the file is made and kept for good. When a model names its material, it names that ID, not the file’s path.
So you can reorganise files safely. Move a texture to another folder or rename it, and everything that uses it still finds it, because its identity didn’t change. Studio also rewrites the few places that name a file by its path (the package lists that tell the game what to load, and the odd text field), in the same step. A move is one undo, and afterwards everything still resolves.
The same idea explains two Studio commands that look alike:
- Replace rebuilds a file you made from a new source, a new image or a new GLB, and keeps its identity. Everything that used the old one uses the new one, with nothing to re-link.
- Delete, then create again gives the new file a new identity. Everything that used the old file now points at nothing.
The game loads what’s listed
Section titled “The game loads what’s listed”Referencing a file isn’t quite enough on its own. The game doesn’t search for files as it goes: for each packagepackage: A bundle of files the game loads together, such as everything one map needs. Studio keeps the lists of what is in each package for you., such as one map, it keeps a list of every file to load, in order, with each file ahead of the ones that need it.
So a new texture your model uses has to be on the list of every package that loads that model. You don’t manage this by hand. Whenever you save, Studio follows the references from your files and puts what they need on the right lists, in the right order. The Package window shows the result if you’re curious.
What a broken reference looks like
Section titled “What a broken reference looks like”When a reference points at nothing, whether its file was deleted, or edited outside Studio, or never listed, the game doesn’t stop to explain. What needed the file goes wrong: a model draws without its material, a prop never appears, a script can’t find what it was looking for.
Each one uses the ones to its right.
- Levelhideout_
master. level - Modelcrate.
model - Meshcrate.
gr2. still fineimport - Materialcrate_
wood. deletedmaterial_ instance - Texturecrate_
wood_ nothing reaches italbedo. png. import
Studio checks for exactly these problems. A reference to a missing file, a list naming something that’s gone, a file nobody lists: each shows up in the Problems panel with where it is and, usually, a one-click fix. See When things go wrong.
For programmers
Identity is a GUID, minted when a file is created and never re-minted. References between assets are by GUID, like foreign keys; only package lists (the per-package load order, dependencies first) and a few string fields name files by path. Studio’s save re-derives the lists from the reference graph, so you never hand-edit them.
Where to go next
Section titled “Where to go next”Shipped files and yours: what happens when you change a file the game already has.