Inspiration

The Case Closed Tron challenge presented an interesting problem: how to build an agent that can navigate a dynamic game board while avoiding trails and outlasting opponents. The torus topology and boost mechanics added complexity that required sophisticated pathfinding and strategic decision-making.

What it does

  1. Analyzing the game board in real-time to identify safe moves
  2. Using flood-fill algorithms to calculate accessible territory
  3. Evaluating opponent positions and trail patterns
  4. Making strategic decisions about when to use speed boosts
  5. Adapting its strategy based on game progression and available space

How we built it

The agent is structured around several key components:

Pathfinder Class: Implements flood-fill algorithms to determine connected empty spaces, accounting for the torus wrapping topology of the game board. TronAgent Class: Contains the core decision-making logic, including:

Move validation with torus coordinate normalization Multi-factor move evaluation system Safety distance calculations using breadth-first search Territory control analysis comparing accessible spaces

Flask API Server: Provides the required endpoints for judge communication (health check, state updates, move requests, game end notifications).

The move evaluation system scores potential moves based on:

Accessible space after the move (weighted heavily for survival) Safety distance from nearest trails Opponent proximity (avoiding close encounters) Territory control differential Corner avoidance in the early game

Challenges we ran into

The main challenges included:

Torus Topology: Implementing correct coordinate wrapping for a board that wraps around horizontally and vertically required careful normalization in all pathfinding algorithms. Performance: Flood-fill operations on every potential move needed to be fast enough to respond within the judge's timeout constraints. Strategic Balance: Tuning the weights for different evaluation factors to balance survival (staying alive) versus aggression (controlling territory). Boost Timing: Determining optimal moments to use limited speed boosts required analyzing both spatial advantage and opponent proximity.

Accomplishments that we're proud of

We ended up delivering a stable product that passed all agent-level tests, and has a "smart" predictive strategy.

What we learned

Effective grid-based pathfinding techniques for games with non-standard topologies API design for real-time game agents using Flask The importance of defensive play in adversarial games Trade-offs between computational complexity and decision quality under time constraints

What's next for Mosher Monsters - Case Closed

We will continue to update our code, increasing the agent's proficiency

Built With

  • 3.12
  • api
  • client
  • collections
  • deque
  • efficient
  • flask
  • for
  • framework
  • http
  • lock
  • management)
  • python
  • requests
  • server)
  • state
  • thread-safe
  • threading
  • trail
  • updates)
  • web
Share this project:

Updates