YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
π Orbit Wars Agent - Kaggle Competition Submission
A strong hybrid agent for the Orbit Wars Kaggle Competition designed to achieve top-5 ELO.
Architecture
This agent combines rule-based strategy with adaptive opponent modeling for maximum performance:
Core Engine (Rule-Based)
Forward Simulation - Simulates every planet's future for 110 turns, accounting for all incoming fleets, production, and combat resolution
Multi-Mission Dispatch - 7 mission types with priority ordering:
- REINFORCE - Send ships to hold threatened planets
- RESCUE - Emergency reinforcement for planets about to fall
- RECAPTURE - Take back lost planets immediately
- CAPTURE - Standard planet conquest
- SNIPE - Arrive at neutrals right after enemy fleet battles
- SWARM - Multi-source coordinated attacks
- CRASH_EXPLOIT - Arrive after inter-enemy fights
Target Valuation - Sophisticated scoring:
score = (production Γ remaining_turns) / (ships_sent + arrival_turns Γ 0.5 + 1)With multipliers:
- 2.05Γ for enemy planets (gain + deny)
- 1.65Γ for static enemy planets
- 1.4Γ for static neutrals
- 0.7Γ for contested neutrals
- 2.0Γ for exposed (just-captured) planets
Orbital Mechanics - Predicts rotating planet positions and computes intercept angles
Sun Avoidance - Routes fleets around the central sun
Dynamic Game Phases - Early expansion β mid-game control β finishing mode β total war
Adaptive Layer (Learning)
- Opponent Modeling - Tracks enemy behavior patterns:
- Expansion rate
- Aggression level
- Fleet deployment patterns
- Dynamic Parameter Tuning - Adjusts strategy multipliers based on opponent behavior
- Weakest Enemy Targeting - In 4P games, focuses on eliminating the weakest opponent first (1.5Γ value multiplier)
- Elimination Bonus - Extra incentive to finish off weak opponents
Key Strategies for ELO Climbing
Production Snowball
The game is won by production advantage. Every ship not heading to a planet is wasted. This agent:
- Computes exact
keep_neededfor each planet via forward simulation - Sends surplus ships immediately (surplus-based dispatching)
- Prioritizes high-production targets early
Fleet Speed Exploitation
Fleet speed scales logarithmically with size: speed = 1 + 5 Γ (log(ships)/log(1000))^1.5
- 5 ships: 1.1 speed
- 50 ships: 2.2 speed
- 500 ships: 4.5 speed
This agent sends optimally-sized fleets for speed/cost balance.
4-Player Strategy
- Target weakest enemy first (1.5Γ value multiplier)
- Elimination bonus when enemy < 110 ships
- Gang-up exploitation (arrive after enemy inter-fights)
- Conservative defense in crowded games
How to Submit
Kaggle Submission
- Download
submission.py - Create a new Kaggle notebook
- Copy the content into the notebook
- Make sure the
agent(obs, config)function is defined - Submit
Local Testing
from kaggle_environments import make
from submission import agent
env = make("orbit_wars", debug=True)
result = env.run([agent, "starter"])
print(f"Result: {'WIN' if result[-1][0].reward == 1 else 'LOSS'}")
Performance
- vs Random: ~100% win rate
- vs Starter: ~90%+ win rate (dominates the baseline)
- 4-Player Mixed: Strong performance, adapts to multi-agent dynamics
- LB Expected: 1200+ ELO
Game Mechanics Summary
- 100Γ100 board with central sun (radius 10)
- Planets orbit the sun; outer planets are static
- Each planet produces ships per turn
- Send fleets:
[from_planet_id, angle, num_ships] - Fleet speed scales with size (logarithmic)
- Combat: largest fleet wins, excess fights garrison
- Win: most total ships at step 500, or eliminate all opponents
Files
submission.py- Full agent code (3379 lines)main.py- Usage instructions
License
MIT