PAUL GUERRERO software engineer
← projects

lighthouses-bot

  • rust
  • heuristics
  • game-bot

For a programming contest I built a Rust bot that played a territory-control game. In three days it went through eight generations, and the journey was a lesson in when complexity helps and when it just gets in the way.

I tried the flashy stuff: MCTS-style tree search, reinforcement learning, Thompson Sampling to pick a strategy. Almost none of it survived. In eight-player games, the bot that «learned» made better decisions on average but lost, because any miscalculation was punished instantly by the rivals. The explicit heuristic won — the one that decided in under a millisecond.

The clearest moment was a version I rewrote to be more sophisticated: more layers, more nuance. It won 34% of games. The previous, simpler one won 53%. I reverted the change and kept a lesson: complexity adds failure modes faster than it adds value.

The other lesson wasn’t about AI, but about reading. The rulebook said one thing and the game engine did another; five edges came from reading the code instead of the docs. The bot that followed the rules to the letter came last.


How it’s built — Rust · explicit heuristics · no AI dependencies