1.9 KiB
1.9 KiB
Leader-Targeter Bot Implementation (Bead bf-3rr)
Summary
The leader-targeter bot was successfully implemented in Java with Maven build system.
Implementation Details
Strategy
The bot implements multi-player game theory by:
- Score Calculation: Estimates opponent scores based on visible bots (10 points each) and active cores (2 points each)
- Target Selection: Identifies the score leader and directs all units toward them
- Tiebreaking: Uses nearest distance when scores are tied
- Core Defense: Detaches 2 bots to defend own core when enemy is within 6 tiles
- 2-Player Fallback: Falls back to straight aggression when only one opponent exists
Files
bots/leader-targeter/src/main/java/com/acb/targeter/App.java- HTTP server with signature verificationbots/leader-targeter/src/main/java/com/acb/targeter/LeaderTargeterStrategy.java- Core strategy implementationbots/leader-targeter/src/main/java/com/acb/targeter/GameState.java- Game state parsingbots/leader-targeter/Dockerfile- Docker build configurationbots/leader-targeter/pom.xml- Maven build configuration
Build
- Maven shade plugin creates executable JAR with bundled dependencies
- Javalin HTTP server on port 8085
- Jackson for JSON processing
- Java 21 target
Retrospective
What worked
The Maven project structure with Javalin and Jackson provides a clean foundation for bot implementations. The strategy correctly models the N-player problem and applies the kingmaker dynamic.
What didn't
N/A - implementation was straightforward
Surprise
The bot was already fully implemented in a previous commit, so this task primarily involved verifying the build and pushing existing work.
Reusable pattern
- Maven shade plugin configuration for executable JARs
- Toroidal distance calculations for grid-based games
- Centroid calculation for targeting multiple assets