By early October we had quite a few demos: a twin-stick shooter, a couple of platformers, three small 3D games, a dungeon crawler and a tactics prototype. Every one of them had been written to show off something the engine could already do, which meant none of them pushed into the areas that didn't work yet.
Picking one game
On 5 October we ran every demo headless to see where things stood, archived the old IDE demos, and chose one game to focus on: Ember Colony, a 3D colony sim. A colony sim is useful for this because it needs nearly everything at once. You get lots of characters making their own decisions, needs and moods, an economy, production chains, a tech tree, a lot of UI, and random maps that have to come out the same for the same seed.
The design doc sets out the rule:
Every feature should run through NAL (state machines, events, ui blocks, arrays, typed fields, host builtins), not engine-side special cases. Where NAL or the engine falls short, the gap goes in GAPS.md and, if it blocks the design, becomes an engine task.
Each gap gets written up the same way: what we tried, what we expected, what actually happened, the workaround, and the fix we'd want. There are fourteen so far. These are the ones that changed the engine the most.
Reading a string from another entity
The HUD needed to show what each colonist was doing. That's a string, stored on a different entity. World.get_field only returned floats, so the string came back as 0.0. It now returns the value with its real type: int, float, bool, string, entity reference, vector or array. Since state-machine states can now be read as strings, a whole layer of code that copied each state into a number field went away.
Setting up something you just spawned
Placing a building means spawning a blueprint and then giving it a kind, a cost, a rotation and a model. A watchtower firing has to spawn an arrow and then aim it. Both wanted to be written like this:
let e = Entity.spawn_at_3d("BlueprintT", vec3(x, 0.0, z));
World.set_field(e, "Blueprint", "kind", kind);
World.set_field(e, "Transform3D", "rot_y", rot);Spawns don't happen until the end of the frame, though, so at this point the entity had no ID yet, and spawn returned a "not found" value. The workarounds were ugly. One system copied the ghost's rotation onto every new building when it started up, and arrows aimed themselves on their first frame.
The fix, which we called spawn references, reserves the ID at the moment the spawn is queued. A set_field on the not-yet-spawned entity gets queued as well, and it's applied in order when the entity appears, before its on_start runs. If you destroy the entity before then, the spawn is cancelled. We deleted both workarounds.
A real interface
The original HUD was text placed at fixed positions, and Ember Colony quickly showed how limited the text renderer underneath was. UI text could only be centred, and each glyph was drawn as a scatter of one-pixel squares. There was no HiDPI support, big scenes overflowed a 16-bit index buffer, and layer order was ignored.
We moved all on-screen drawing to egui and then designed a ui block for NAL on top of it. You describe the interface, its expressions are re-read every tick, and button actions run on the next tick. Ember Colony's Colony, Build, Inspector and Research windows all work this way now.
Making it look like a game
Moving to 3D meant loading real models. The native player gained glTF/GLB support with textures, instancing, directional shadows, sky lighting and fog. If a model is missing, you get a magenta cube and an error with the file name, which is much easier to spot than an empty space. Blueprints had to be see-through, and transparency only looks right if you draw objects in the right order and keep the ghosts from casting shadows. Clicking on things in the world needed World.pick, Camera.screen_to_ground and Camera.world_to_screen.
Lists
A tech tree is a list of finished techs plus a research queue. Traits are a list, and so is the pool of colonist names. NAL had no collections at all, so we added the smallest version that would do the job: array[T] for simple values, entity references and vectors, holding up to 256 items, copied when assigned and looped over as a snapshot. There are no arrays of arrays and no maps, and we left those out on purpose.
Two weeks in
In about two weeks Ember Colony went from a 2D prototype through four rounds of content. First came 3D, with an RTS camera and building placement, then colonist detail, then construction and workshops, and finally research. Of the fourteen gaps it has logged, ten are fixed, one is partly fixed, and three are still open. One of the open ones is that the headless MCP renderer still can't draw 3D.
It also led us to the worst quiet bug of the year, Entity.id() always returning 0. We only found it because a real game needed its colonists to actually go to bed. (That's covered in another post.)
Next
There are three more rounds before Ember Colony is ready to show at the alpha. The first adds seasons, weather and lighting controlled from NAL. The second adds random events (raids, wanderers, traders, sickness) that get harder over time. The last is balancing and performance, where we're aiming for 60 FPS with around 60 colonists and 500 models. We expect each one to need something the engine doesn't do yet.
Every engine feature we added in October was one the game was actually waiting on. Not having to guess what to build has been a relief. And keeping a GAPS.md next to the game has given us a better backlog than any roadmap we'd written by hand.