One simulation for
factories and armies.

Phylactory is a fantasy factory game that fuses factory management with real-time strategy. I designed and built its prototype at Tomeato Studios from 2022 to 2023, including the game systems, engine architecture, Godot 4 integration and pixel art. Its custom C++ Entity-Component-Space system (ECSS) lets movement, logistics, energy, and rendering share simulation data without inheriting one another's behavior. When the studio shut down, Tomeato gave me ownership of the ECSS, and I have kept developing it. The videos on this page are recordings of the playable prototype; the game is not released.

The Game

Phylactory is set in a fantasy world where players build sprawling factories while commanding armies of units called Thralls. Every system had to work at two scales at once: pipe flow and crafting recipes in the factory, and large formations of Thralls on the battlefield.

Thralls organizing into configurable formations in real time.

The Architecture

I wrote the ECSS in C++ and connected it to Godot 4 and GDScript through GDExtension. Typed component storage holds position, velocity, inventory, and commands, and systems compose behavior through that data instead of forcing buildings and units into one class hierarchy. Queries and archetypes decide what each system processes: a query names the component combination a system handles, and archetypes group the matching entities so the system can iterate over them in batches. Processing follows data requirements rather than entity-specific branches.

Systems share state through Spaces, which hold the simulation context for movement, logistics, energy, and rendering. Each system reads the state it needs without becoming another system's owner, so no single Godot node has to own every subsystem. Godot's shader pipeline handles the rendering effects.

The Systems

Phylactory's gameplay emerges from a web of interconnected systems. The Wumbo energy network powers buildings that process resources moving through pipes, while trains carry materials between factory zones and Thralls organize into formations for combat, all running at once on the ECSS.

Inventory, grid placement, crafting, and skill unlocks connect that movement to the player's next decision. Thrall flocking, A* pathfinding, group movement, selection, commands, and the configurable formations they fight in all read the same component state.

The Wumbo energy network powering factory buildings.

The crafting system tied into the factory pipeline.

The Visual World

I drew the sprites and tilesets in Aseprite and built matching normal and emissive maps for the day-night lighting system. The same visual pipeline supports rain, underwater transitions, and the Lorenomicon, an interactive book that carries the world's lore.

Silhouette and palette studies of the Wizard established the game's color language. The final design pairs him with Tomey, his tome familiar, whose personality comes from animation timing, eye direction, and offsets between the cover and pages.

Wizard character iterations in AsepriteThe Wizard and Tomey, his tome familiar