A high-performance, protocol-compliant remake of the Filler game engine, written in Rust. This engine was developed to provide a strictly fair competitive environment, deterministic debugging, and a fix for the common "Dead Zone" coordinate bug found in legacy engines.
-
Fixed "Dead Zone" Bug
Original engines often include empty padding in pieces, making board edges mathematically unreachable.
This engine implements atrim_and_buildalgorithm to ensure 100% of the Anfield is playable. -
Board-Aware Scaling
Pieces are dynamically scaled based on map dimensions (30% max, clamped 3β9), ensuring strategic depth on all map sizes. -
Deterministic Auditing
Uses 64-bit seeding for every match. Any game can be perfectly reproduced using the-sflag. -
Built-in Logging
Automatically generatesmatch_history.csvfor win/loss tracking andengine_debug.logfor troubleshooting bot crashes.
filler-game-engine/
βββ src/
β βββ game/
β β βββ mod.rs # Module definitions & re-exports
β β βββ anfield.rs # Map parsing and coordinate representation
β β βββ piece.rs # Piece generation & trim_and_build logic
β β βββ config.rs # CLI flag parsing and help menu display
β β βββ game_engine.rs # Core game loop and rule enforcement logic
β β βββ token.rs # Player token management
β βββ process.rs # Subprocess handling & bot I/O communication
β βββ main.rs # Entry point and handshake initialization
βββ results/
β βββ tournament/ # π Final Evidence
β β βββ season1_final.csv # (Tracked via !)
β β βββ season1_report.png # (Tracked via !)
β βββ benchmark/ # π§ͺ Development History
β βββ evolution_rinbo.png # (Tracked via !)
βββ scripts/ # π Python & Shell Audit Suite
βββ maps/ # Standard .txt map files for testing
βββ robots/ # (Ignored via .gitignore - Download via Release)
βββ Cargo.toml # Rust manifest
βββ requirements.txt # Python manifest
βββ match_history.csv # (Ignored via .gitignore - Local only)
Make sure you have the Rust toolchain installed.
git clone https://github.com/Rinrino/filler-game-engine.git
cd filler-game-engine
cargo build --releaseTo run matches, you need map files and bot executables.
- Option A: Automated Setup (Recommended)
Download the filler-assets.zip and run the setup command for your system:
- π§ Linux / WSL:
unzip filler-assets.zip && mv linux_robots robots && chmod +x robots/*
π macOS (Apple Silicon):
unzip filler-assets.zip && mv mac_robots robots && chmod +x robots/*
- Option B: Use your own maps and bots by providing their paths to the flags.
βΉοΈ Permission Denied? > If you get a "Permission Denied" error when running a bot, make sure it has execution permissions:
chmod +x ./robots/*
This engine comes pre-configured to test against:
-
Community robots from fellow students.
-
Terminator & Bender (Standard curriculum robots)
./target/release/game_engine -f [map_path] -p1 [bot1_path] -p2 [bot2_path] [options]
- Standard Match:
./target/release/game_engine -f maps/map00 -p1 robots/bender -p2 robots/rinbo
- Debug & Diagnostic Mode: (Generates timing statistics and
engine_debug.log)
π‘ Deterministic Tip: If a bot crashes, find the Seed in the match_history.csv and rerun the match with the -s flag to see the exact board state that caused the failure.
./target/release/game_engine -f maps/map00 -p1 robots/rinbo -p2 robots/megatron -d
| Flag | Required? | Description |
|---|---|---|
-f |
Yes | Path to map file |
-p1 |
Yes | Path to Player 1 bot |
-p2 |
Yes | Path to Player 2 bot |
-s |
No | Seed for reproducible games |
-d |
No | Enable logging to engine_debug.log |
-a |
No | Animate board with ANSI refresh |
-q |
No | Quiet mode (suppress stdout) |
-r |
No | 50ms visual refresh delay |
-t <s> |
No | Max thinking time in seconds (default: 10) |
-h |
No | Show help menu |
The engine implements the standard Filler protocol with modern stability improvements, deterministic behavior, and enhanced debugging capabilities.
- Performs the canonical
$$$ exec p[1|2]handshake - Runs bots in isolated subprocesses with strict pipe handling and timeout protection
- Remains responsive even if a bot hangs, crashes, or enters an infinite loop
- Adaptive scaling: Piece size is dynamically calculated as ~30% of board dimensions, clamped to 3Γ3 β 9Γ9
- Dead-zone elimination: The
trim_and_buildalgorithm removes all padding (leading/trailing empty rows/columns), enabling full edge utilization without coordinate offsets
- Enforces exact βone-cell overlapβ connectivity and zero-tolerance collision / out-of-bounds checks
- Implements Winnerβs Lap: when one player is stuck, the other continues playing until no moves remain, maximizing legitimate territory score
- High-resolution move timing using
std::time::Instant - Post-match summary includes total thinking time, average turn duration, and per-player statistics
- Captures and preserves bot stderr output and crash information in
engine_debug.log - Maintains complete game state and match history even after bot failure
This engine has been primarily tested and confirmed working with the following student projects:
-
Fillbert β Adaptive strategist using center-of-mass targeting and late-game gap filling.
-
maximilian β Aggressive proximity attacker. Uses repeated BFS (Breadth-First Search) to minimize distance to the opponent, effectively "hugging" and suffocating the enemy's line of play.
-
Megatron β High-reliability bot utilizing Heatmap/BFS to minimize distance to opponent.
-
Mochi β Proximity-based attacker using Manhattan distance heatmaps for aggressive pursuit.
-
Rinbo β Strategic expansionist. Uses state-machine logic and frontier analysis to optimize territory control and future move availability.
-
Standard robots from the 01Founders curriculum (Bender, Terminator, etc.) are also fully supported. Most protocol-compliant bots will work without modification.
β οΈ Community robots are currently provided as Linux-only binaries.
This engine includes a statistical suite to eliminate "luck" from your AI development. By running multiple matches and aggregating results, you can see true performance deltas between versions. Please see π Analysis Suite guide
Contributions are welcome! Whether you want to add a new bot to the benchmark list, report a bug, or suggest an engine feature, please follow these steps:
If you've built a Filler bot and want it featured in the Included Robots list, follow these steps:
- Fork the repository
- Place your compiled binary in the
linux_robotsorm1_robots/folder
β Please name it in lowercase (e.g.myawesomebot) - Add a link to your bot's source code in the π€ Compatible Bots section of the README
- Submit a Pull Request with a brief description of your bot's strategy
If you encounter issues β such as:
- A coordinate edge case that
trim_and_builddoesn't handle correctly - Subprocess handling hangs on your operating system
- Any unexpected behavior during replay or tournament runs
Please help us improve by doing the following:
- Open an Issue with a clear description of the bug or feature request
- If possible, provide the Seed (
-s) used when the error occurred so I can reproduce it perfectly.
Thank you for contributing to this project!
This project is licensed under the MIT License.
See the LICENSE file for full details.
- Rin
GitHub: @Rinrino