Loren Lisk

One small mouse, one cage, and a simulation engine to keep it busy

MouseMind: a mouse in a cage, simulated

Status: prototype (Feb 2026). The source lives in a private repository, so there is no link or code here, just a short write-up.

What it is

MouseMind is a browser simulation of a mouse in a cage. Homeostatic drives (hunger, thirst, energy and sleep need) push its behaviour: it heads for food when it is hungry, water when it is thirsty, and sleep when it is tired. A day-night activity cycle shapes when it is active, and pause and speed controls let you watch it go about its day.

How it is built

The simulation engine is written in Go and streams its state to the browser over WebSockets. The frontend uses Svelte 5 for the UI and PixiJS 8 for rendering. The engine is fully decoupled from the renderer, so it also runs headless, which is how it gets tested.

+---------------------+   WebSocket   +----------------------+
|  Go engine          | ------------> |  Svelte 5 UI         |
|  (headless-capable) |     state     |  + PixiJS 8 renderer |
+---------------------+               +----------------------+

Approach

It was built spec-first: the specs were written before the code, and the implementation follows them.

"If I had more time, I would have made this shorter."

Top Of Page