Kastle: the Engine the Four Games Share

A house engine is an expensive decision, and we took it for a simple reason: three games in one week, each needing the same 3D world, the same creatures, the same sound, the same HUD, the same Steam, the same saves and the same deterministic multiplayer. Kastle is all of that, extracted from Castle Survivors on October 9, and no game rule. A game is a folder next to it, with its own simulation, content and words. The engine never imports a game, and an automatic check fails if one day it does.
What the engine holds
The shell: title, menus, options, credits, the room with seats, colours, teams and chat, a match's life, replays and the frame loop. The network: rooms through Steam, LAN or offline, and deterministic lockstep with checksums, catch-up, rejoin and host migration. The simulation: a fixed-step loop, a seeded random, a spatial hash, navigation with flow fields and A*, and the Warcraft III runtime, with the damage table by attack and armour type, buffs, attacks and missiles. The renderer: sky, weather, day and night, island terrain, scenery, fauna, post-processing, creatures, shots and every effect. The audio, the interface with its four HUD layouts, saves with schema migrations, Steam, mods and the Workshop. And the asset library: 164 creature models with 705 skins, 1,115 scenery models in nine packs, 17 island themes, 4 nebula skies and deep space, 235 effects and 74 sounds. The packs the games bought moved into this library, and each game ships only the folders it loads.
The first two weeks
Kastle was born with replays and desync reports, GPU creature animation, an effects atlas for towers, positional weapon sounds, and controller and Steam Deck support. The next day it became a package of its own, with tests, tools, compressed textures, content mods, an example game called Kastle Skirmish and Portuguese. It gained a Warcraft III map importer that reads encrypted entries, and the game's hero rules.
On October 24 versions 0.2.0 and 0.3.0 came out, and with them continuous integration: types, the engine-game boundary, tests with coverage floors, lint, the example played inside Electron, an audit and releases. The room and the lockstep were hardened against hostile peers, with a secret key per seat, the window's security is now enforced by the engine, and the checksum covers the whole world. The renderer gained a single table of quality tiers, scenery culling per ground cell, particles that fly on the GPU, creature detail by screen size and the fog of war overlay. The simulation gained crowd separation, fog and triggers. An offline match can be saved and resumed, a rejoining player starts from a checkpoint instead of replaying the whole match, and observers watch a lobby or a running match. Large files now go through Git LFS.
And the effects, which are what you see: sword slashes, a volley of 19 magic missiles, an RPG's school of fire, 18 glowing missiles, 16 MOBA hero ultimates, ki auras in eight levels up to dragons of light, 15 cartoon projectiles, and a new atlas with flipbooks. All procedural, and the blow of every attack clip lands the instant the blade touches.
The October 25 round
The last round was the biggest, on seven fronts at once. The Warcraft III runtime gained orders (stop, hold, move, attack, attack-move, patrol, follow, shift-queued), abilities as data (approach, cast point, mana and cooldown paid there, backswing or channel, interrupts) and a six-slot inventory, allocating no memory during the step. Navigation learned unit sizes, congestion costs and a steering that joins the flow with separation.
In the lockstep, a dropped player's commands survive the rejoin, and the checksum is split into named parts: a desync report says which system diverged, and the Studio's Replays tab marks the first one. A determinism lint flags, in the simulation's code, everything that makes two computers disagree: an unseeded random, the wall clock, a sort without a comparator, order-dependent iteration. A soak runs whole matches over simulated networks, with latency, loss, reordering and partitions, and it already found a real bug: a guest whose countdown started after the host's lost the first turns. A performance gate measures the example and a 500-body crowd against a baseline, locally, because CI minutes cost. A simulation inside a worker was measured: it saves 0.1 to 0.2 ms per frame at 5,000 units, and no game has adopted it yet. Colour-blind team palettes keep every pair of colours a minimum distance apart, in normal and in simulated vision. And the engine's screens speak Spanish and Simplified Chinese, besides English and Portuguese.
Closing the day, CI went green again on servers without a GPU: a software renderer draws the lowest tier, and the visual regression's reference images are now the server's own.
Who uses what
Line Tower and Custom Hero Survival run entirely on Kastle and have adopted the new round. Castle Survivors uses only the renderer, by decision: its simulation, network, interface, saves and replays stay its own. Castle Arena has its own lockstep and does not use the engine, but talks to Kastle Studio like the other three. The engine has 948 tests of its own today, which every game runs alongside its own.
— The team
