micromouse maze simulator built in zig with dvui. runs natively on mac/windows/linux and in the browser via wasm.
why
wanted to tinker with mms but it uses qt. cpp is fine, qt is not. also wanted an excuse to build something real in zig.
the name: “azem” is “maze” with the m cycled to the back.
architecture
src/├── azem.zig # entry point├── App.zig # application state├── Engine.zig # rendering engine (dvui)├── Maze.zig # maze data structures and parsing├── Solver.zig # pathfinding algorithms├── Theme.zig # theming system├── Color.zig # color utilities├── fonts/ # embedded fonts└── theme/ # theme assetsdvui handles the ui framework. supports both native (opengl) and web (wasm/canvas) backends from the same codebase.
build targets
| command | description |
|---|---|
zig build | build and run native |
zig build c | compile native only |
zig build web | build web and open browser |
zig build wc | compile web only |
zig build ws | serve web on localhost:8000 |
zig build wp | optimized web build for deploy |
current state
working:
- basic maze loading and rendering
- native builds (tested on mac)
- web wasm builds
- basic theming
- console logging
roadmap
next up
- render detailed maze info (numbering, detected walls, goal)
- modular theme system
- settings panel
- mouse rendering
- wall following algorithm
- stats (time, speed)
- better pathfinding algorithms
future
- maze file formats (standard text, compressed)
- mms-compatible api
- accurate physics simulation (turn rate, slip, sensor errors)
- sensor input simulation
- remote debugging with actual hardware
- hot reloading for algorithm development
- mac app packaging
references
- micromouseonline/mazefiles - standard maze file formats
- tcp4me maze archive - maze collection
- mms-zig - another zig mms implementation
- bipul018/something-something-maze-related - maze solver reference
- cztomsik/ava - zig web framework exploration
- cztomsik/tokamak - zig web framework exploration