skip to content

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 assets

dvui handles the ui framework. supports both native (opengl) and web (wasm/canvas) backends from the same codebase.

build targets

commanddescription
zig buildbuild and run native
zig build ccompile native only
zig build webbuild web and open browser
zig build wccompile web only
zig build wsserve web on localhost:8000
zig build wpoptimized 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