Making a Custom Asteroid
A custom asteroid is a folder in the game's Mods folder that holds a rock.json, a 3D model and the maps of its own materials, if it has any. "New asteroid" in the Mods menu makes one from a model, and "Make a copy" puts a copy of one of the game's own rocks there to see how it is made.
- .glb, .gltf, .stl, .obj
- Models
- Up to 400,000
- Triangles
- 1 to 5 million m³
- Size
- Up to 16
- Own materials
- Up to 24
- Ore entries
- Up to 256 KB
- rock.json
The Mods folder
On Windows the Mods folder is %APPDATA%\No Asteroids\mods; "Mods folder" at the foot of the Mods screen makes it if needed and opens it, and the game writes a README.txt into it that explains the format. One folder there is one rock, and the folder's name is the rock's id: a letter, digit or _, then up to 63 letters, digits, _, spaces, dots or dashes. A folder with another name is not listed, and neither is one whose name holds "..", ends in a dot or a space, or is a Windows device name such as con, nul, com1 or lpt1. A folder holds rock.json (read only up to 256 KB), the model, preview.png, the .png and .jpg maps of its own materials, and shape.bin, which the game makes from the model and makes again whenever the model or a "fill" slot changes. preview.png is the rock's picture in the list and on the Workshop, square and under 1 MB; a rock without one gets a 512 px picture the first time it is played, and a picture already there is never changed.
"New asteroid"
"New asteroid" asks for a model (.glb, .gltf, .stl and .obj, listed as "3D models"), makes a folder named after the file, in lower case with dashes for spaces and numbered when the name is taken, and copies the model and the files it names into it. Its rock.json gets "format": 1, the file name as the name, a "vol" of 2,000,000 and a random seed, and the folder opens. The model's colors become up to 16 materials of the rock's own, the closest colors merged until 16 are left, painted 0.02 m deep, with a tile of 3 m, 2 hit points and no tool power needed.
rock.json
rock.json is a JSON object. Only "format" has to be there: what is left out of the ores, the layers' depths, the geodes and the outcrops is the game's own asteroid's, laid onto the shape, so per m³ the rock plays like the game's asteroid. Keys the game does not know are not read. A material is named by its game name ("regolith", "stone", "deepStone", "core", "ice", "iron", "gold", "crystal", "plasmite", "neutronium", "darkMatter", "antimatter", "basalt", "nickel", "titanium" and "strange") or by the id of one of the rock's own materials.
| Key | What it takes |
|---|---|
| format | Must be 1; the only key that has to be there. |
| name | Text of up to 48 characters, or a map of languages such as { "en": "Mug", "de": "Becher" }. Left out: "Rock". |
| shape | The file name of the model. Left out: shape.glb. |
| vol | 1,000,000 to 5,000,000 m³, rounded to 100,000 and cut to what the shape holds. Left out: 2,000,000. |
| seed | 0 to 2,147,483,647: the same seed and file make the same rock. Left out: 4,242. |
| layers | The materials of "dust", "upper", "middle" and "core" (left out: Regolith, Stone, Deep stone and Core metal), and the depths "middleFrom" and "coreFrom", 0.02 to 0.98, "coreFrom" at least "middleFrom". A depth left out is the game's own asteroid's, laid onto the shape. |
| ores | Up to 24 entries of { "m", "count", "depth", "size" }: count 0 to 12,000 lumps per 2,500,000 m³, depth [from, to] between 0 and 1 (left out: [0.1, 0.9]), size a radius [from, to] of 0.5 to 8 m (left out: [1.5, 3]). Counts above 16,000 in all are scaled down to 16,000. Left out: the ores of the game's own asteroid. |
| geodes | 0 to 400 per 2,500,000 m³. Left out: 71. |
| caves | 0 to 100 per 2,500,000 m³. Left out: 46. |
| pockets | 0 to 300 per 2,500,000 m³. Left out: 70. |
| chamber | The material of the shell of the hollow at the deepest point. Left out: Neutronium. |
| outcrops | Up to 8 entries of { "m", "count" }: m is "gold", "crystal" and "plasmite", count 0 to 40. Left out: 11 of Star gold, 4 of Space crystal and 3 of Plasmite. |
| paint | A material slot of the model, mapped to the material its surface is made of, or to { "m", "depth" } with a depth of 0.01 to 0.16 m (left out: 0.16 m). |
| look | "rock" leaves the paint off, for plain rock. Left out: the model's look. |
| fill | Up to 16 material slots of the model, each mapped to the material its parts are made of all through. |
| materials | Up to 16 materials of the rock's own (the keys are below). |
Details
"Make a copy"
"Make a copy", beside one of the game's own rocks, copies its files without its picture into a new folder of the Mods folder, names the rock "Mug (copy)" for the Mug, and opens the folder.
"Properties"
"Properties", beside a rock of the Mods folder, has "Name" (up to 48 characters; with a name in several languages only the language in use changes), "Size", a slider from 1,000,000 m³ in steps of 100,000 up to the most the shape holds, at most 5,000,000 m³, and, when the rock has paint, "Look" with "Model colors" or "Rock". Every change is written into rock.json at once.
The keys of an own material
| Key | What it takes |
|---|---|
| id | A letter, then up to 31 letters, digits, _ or -. It cannot be a game material's name or be used twice. The id stands for the material everywhere a material is asked for. |
| name | Text or a map of languages, as the rock's name. Left out: the id. |
| color | The color map, a picture file of the folder, tiled every "tile" meters. Left out: the game's Stone tinted "rgb". |
| normal | The normal map (OpenGL, +Y up), a picture file of the folder. |
| mask | Red is the roughness, green the metalness and blue where it glows, a picture file of the folder. |
| rgb | The color of its dust and chips, [r, g, b]. Left out: [128, 124, 120]. |
| tile | 0.5 to 8 m. Left out: 2.5 m. |
| hp | Its hit points, 0.5 to 10: Stone has 2, Deep stone 3 and Core metal 5. Left out: 2. |
| gate | The tool power it needs, 0 to 3: 0 is any tool, 1.2 as for Deep stone, 1.9 as for Basalt, 2.3 as for Core metal. Left out: 0. |
| glow | ["#rrggbb", strength], the strength 0 to 2 (left out: 0.5). |
| unbreakable | true: nothing breaks it, and it is not counted in the rock's m³. With "fill" it makes the walls of a maze. |
The materials a custom asteroid brings are rock: each is dug with the hit points and tool power its rock.json gives it, and none is ever collected or sold. Its name shows wherever the game names a material. A material marked unbreakable is broken by nothing: blasts and tools leave it and what lies behind it, the bolts, cuts and ship guns stop at it, and a drill rig stops with the note "Rig stopped". It is not counted in the asteroid's m³.
The model
The model is a .glb (the default for any other file name), a .gltf with its buffers beside it or inside it, a binary or text .stl, or an .obj, whose usemtl names are its material slots. It has at least one triangle and up to 400,000, without Draco or meshopt compression. The game turns it into rock on a grid of 256 cells a side. Open, hollow, flat or thin models are filled, and when the inside is less than a quarter of the shell, the shell is thickened by 2, 4, 6 and 8 cells in turn. At 1,000,000 m³ the rock must fit a grid of 320 cells, and the margin around the shape is made smaller in steps of 0.025 up to 0.25 until it does.
Error texts
| Text | When |
|---|---|
| Can’t read rock.json: {detail} | rock.json is missing, is not valid JSON, has no "format": 1, or breaks a rule: more than 16 materials, a bad material id, an unknown material name, an outcrop of another kind, or a bad file name. |
| Can’t read the model: {detail} | The model cannot be read for another reason. |
| The model is too thin: there is no rock inside | The model has no inside, even after the game thickens it. |
| The model is too long | The rock does not fit the game's grid, even with a smaller margin. |
| The model has over {n} triangles | The model has more than 400,000 triangles. |
| The model is compressed: {detail} | The model uses Draco or meshopt compression; the detail names it. |
| The model has no triangles | The model has no triangles. |
| No model file: {detail} | The model file, or a buffer file of a .gltf, is missing. |
| Can’t read shape.bin | shape.bin is damaged and there is no model to make it again. |
| Steam didn’t answer: {detail} | Publishing failed: no Steam Workshop, rock.json or shape.bin missing in the folder, or another error, named in the detail. |
| The host has another version of this mod | Co-op: the host's copy of the rock differs from the guest's. |
| The host plays a mod you don’t have | Co-op: the guest does not have the host's rock. |
| Steam didn’t answer | The list of Workshop rocks could not be fetched. |