How c22dev/muguet works
Muguet runs the game’s WebAssembly as a native Apple-platform app, providing filesystem, host-import, graphics, audio, and input support. The usual workflow is to supply a game ZIP, import its files, configure startup, then launch the game; multiplayer adds a UDP server and in-game synchronization. The excerpts show only parts of the runtime, so some documented capability links are attributed to the README, while unsampled implementation details are not inferred.
Main entry points: main.rs Runtime Entry · app.rs App Lifecycle · mp.rs Game Synchronization · input.rs Input State
Components 23
Startup and Game Files
- Game Launcher
launcher/Launcher.swift - ZIP Import
src/import.rs - Startup Config
src/config.rs
Native Game Runtime
- Runtime Entry
src/main.rs - App Lifecycle
src/app.rs - Wasm Host
src/host.rs - Game Filesystem
src/fs.rs - Game I/O
src/io.rs - Graphics Runtime
src/gpu.rs - Audio Runtime
src/audio.rs - Multiplayer Hooks
src/patch.rs
Display and Controls
- Input State
src/input.rs - Touch Controls
src/touch.rs - Gamepad Controls
src/pad.rs - Keyboard Controls
src/keyboard.rs
Multiplayer
- Game Synchronization
src/mp.rs - UDP Protocol
src/proto.rs - UDP Server
src/server.rs - Server Command
src/bin/muguet-server.rs
Other components
- Player
- Metal Graphics
- Wasmtime Engine
- UDP Network
Connections 24
- Player → Game Launcher: starts or configures
README.md - Player → Runtime Entry: supplies game ZIP
README.md - Runtime Entry → ZIP Import: imports ZIP
src/main.rs - Runtime Entry → Startup Config: loads startup settings
src/main.rs - Runtime Entry → App Lifecycle: starts app
src/main.rs - Runtime Entry → Multiplayer Hooks: patches Wasm
src/main.rs - Runtime Entry → Wasmtime Engine: runs Wasm
README.md - Wasm Host → Game Filesystem: handles filesystem calls
src/host.rs - Wasm Host → Game I/O: handles I/O calls
src/host.rs - App Lifecycle → Graphics Runtime: creates surface
src/app.rs - Graphics Runtime → Metal Graphics: renders through
README.md - App Lifecycle → Input State: routes key events
src/app.rs - App Lifecycle → Startup Config: reloads settings
src/app.rs - App Lifecycle → Game Synchronization: reports key presses
src/app.rs - Touch Controls → Input State: publishes touch input
src/touch.rs - Touch Controls → Game Synchronization: reports key presses
src/touch.rs - Gamepad Controls → Input State: publishes controls
src/pad.rs - Keyboard Controls → Input State: publishes keys
src/keyboard.rs - Game Synchronization → UDP Protocol: encodes and decodes
src/mp.rs - UDP Server → UDP Protocol: uses packet format
src/server.rs - Server Command → UDP Server: runs server
README.md - Player → Server Command: starts standalone server
README.md - Game Synchronization → UDP Network: exchanges game state
README.md - UDP Server → UDP Network: relays player packets
src/server.rs