AI plays a small escape room game, written in rust
AI learns escape a room.
This is a rust based implementation of a genetic algorithm and reinforcement learning simulation that trains an AI named Zoe to escape from five rooms of increasing difficulty. The simulation is built using the macroquad library.
git clone [email protected]:bones-ai/rust-escape-ai.git
cd rust-escape-ai
cargo run --release
src/configs.rs
player
, keys
, door
, walls
, spikes
, enemies
and background
. I suggest taking a look at how other maps are built to understand how things are to be setup.src/configs.rs
Spacebar
- Pause/Unpause the simulationTab
- Show/hide the egui control menur
- Restart the simulationBackspace
- Slow modeBackslash
- Enable AI, start the AI training process (Use this to play the game yourself, using keyboard inputs wasd)Right Shift
- Run at 5x speedMouse wheel
- Zoom in/outMouse wheel with ctrl
- Large zoom in/outRight mouse click drag
- Pan through the worldShow Multi
. Caution, if you have too many game rooms being simulation, this could freeze your machine.r
). It's impossible to get the same results as in the youtube video as every simulation run is random. Sometimes Zoe might get stuck (or spend a lot of time/steps) in a region, letting the simulation run for a longer is an option (but it'll take a long time).NUM_FRAMES
to a larger value. Once the room is solved, Zoe will try to solve the room more efficiently (i.e taking less steps)Right Shift
). Some rooms can take a lot of generations to solve.