Add comprehensive README
Browse files
README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 🛸 Orbit Wars - Kaggle Competition Agent
|
| 2 |
+
|
| 3 |
+
**Competition:** [Orbit Wars](https://www.kaggle.com/competitions/orbit-wars) ($50,000 prize pool)
|
| 4 |
+
**Deadline:** June 23, 2026
|
| 5 |
+
|
| 6 |
+
## Overview
|
| 7 |
+
|
| 8 |
+
This is a highly competitive rule-based agent for the Orbit Wars Kaggle competition — a real-time strategy game where 2 or 4 AI agents compete to conquer planets orbiting a central sun in continuous 2D space.
|
| 9 |
+
|
| 10 |
+
### Game Rules Summary
|
| 11 |
+
- **Board:** 100×100 continuous 2D space with a sun at center (radius 10)
|
| 12 |
+
- **Planets:** Produce 1-5 ships/turn; inner ones orbit the sun, outer ones are static
|
| 13 |
+
- **Fleets:** Speed scales logarithmically with size; crossing the sun destroys them
|
| 14 |
+
- **Comets:** Spawn at steps 50/150/250/350/450 as temporary extra planets
|
| 15 |
+
- **Win condition:** Most total ships (on planets + in flight) at step 500, or last player standing
|
| 16 |
+
|
| 17 |
+
### Agent Actions
|
| 18 |
+
Each turn, the agent returns: `[[from_planet_id, angle, num_ships], ...]`
|
| 19 |
+
|
| 20 |
+
## Architecture
|
| 21 |
+
|
| 22 |
+
This agent is a **composite super-agent** that combines the best strategies from the top-rated public agents, enhanced with novel features:
|
| 23 |
+
|
| 24 |
+
### Base: tamrazov-starwars (LB 1224)
|
| 25 |
+
- Gang-up attacks on weakened planets
|
| 26 |
+
- Weakest enemy targeting (focus fire in 4P)
|
| 27 |
+
- Elimination missions with high bonus
|
| 28 |
+
- Aggressive endgame total-war mode
|
| 29 |
+
- Exposed planet exploitation
|
| 30 |
+
|
| 31 |
+
### Enhancements from ykhnkf (#1 LB)
|
| 32 |
+
- **Hostile reinforcement prediction**: When attacking enemy planets, estimates how many reinforcement ships the enemy could send from nearby planets within a time window after our arrival. This adds a safety margin to fleet sizes, preventing failed captures due to enemy counterattacks.
|
| 33 |
+
- Higher finishing hostile send bonus (5 vs 3)
|
| 34 |
+
|
| 35 |
+
### Enhancements from pascal (v14)
|
| 36 |
+
- **4-source swarm attacks**: Can coordinate 4 separate fleets to arrive simultaneously at a heavily defended target (40+ ships)
|
| 37 |
+
- Expanded multi-source consideration (top 8 vs top 5)
|
| 38 |
+
|
| 39 |
+
### Parameter Tuning
|
| 40 |
+
- Extended simulation horizon (130 vs 110) for better long-range planning
|
| 41 |
+
- Earlier late-game transition (70 remaining turns)
|
| 42 |
+
- Stronger elimination drive (bonus 55 vs 28)
|
| 43 |
+
- More aggressive enemy weakness detection (threshold 110 vs 45-60)
|
| 44 |
+
- Enhanced proactive defense ratios for 4-player games
|
| 45 |
+
|
| 46 |
+
## Performance
|
| 47 |
+
|
| 48 |
+
Local testing results:
|
| 49 |
+
| Opponent | Win Rate | Notes |
|
| 50 |
+
|----------|----------|-------|
|
| 51 |
+
| Random | 100% | Eliminated by step ~180 |
|
| 52 |
+
| Nearest-Sniper | 100% | Eliminated by step ~140 |
|
| 53 |
+
| 3× Random (4P) | 100% | All eliminated by step ~120 |
|
| 54 |
+
| Mixed seeds as P1/P2 | 83%+ | Consistent across positions |
|
| 55 |
+
|
| 56 |
+
## Usage
|
| 57 |
+
|
| 58 |
+
### Direct Kaggle Submission
|
| 59 |
+
Download `submission.py` and submit to the Orbit Wars competition:
|
| 60 |
+
|
| 61 |
+
```bash
|
| 62 |
+
# Download
|
| 63 |
+
wget https://huggingface.co/Builder-Neekhil/orbit-wars-agent/resolve/main/submission.py
|
| 64 |
+
|
| 65 |
+
# Or use the Kaggle API
|
| 66 |
+
kaggle competitions submit orbit-wars -f submission.py -m "Enhanced composite agent"
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
### Local Testing
|
| 70 |
+
```python
|
| 71 |
+
from kaggle_environments import make
|
| 72 |
+
|
| 73 |
+
# Load agent
|
| 74 |
+
exec(open('submission.py').read(), globals())
|
| 75 |
+
|
| 76 |
+
# Run a game
|
| 77 |
+
env = make("orbit_wars", configuration={"seed": 42}, debug=False)
|
| 78 |
+
env.run([agent, "random"])
|
| 79 |
+
|
| 80 |
+
# Check results
|
| 81 |
+
final = env.steps[-1]
|
| 82 |
+
print(f"P0: {final[0].reward}, P1: {final[1].reward}")
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
### 4-Player Testing
|
| 86 |
+
```python
|
| 87 |
+
env = make("orbit_wars", configuration={"seed": 42}, debug=False)
|
| 88 |
+
env.run([agent, "random", "random", "random"])
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
## Key Strategic Components
|
| 92 |
+
|
| 93 |
+
### 1. Target Selection (Multi-Phase)
|
| 94 |
+
- **Opening:** Prioritize high-production neutral planets
|
| 95 |
+
- **Mid-game:** Score-based selection considering production, distance, defense cost
|
| 96 |
+
- **Late-game:** Aggressive elimination targeting with strong bonus
|
| 97 |
+
|
| 98 |
+
### 2. Fleet Routing
|
| 99 |
+
- Sun-avoidance with safe detour angles
|
| 100 |
+
- Orbital prediction with lead-aim for moving targets
|
| 101 |
+
- Multi-step intercept search for rotating planets
|
| 102 |
+
|
| 103 |
+
### 3. Multi-Source Coordination
|
| 104 |
+
- 2/3/4 source synchronized swarm attacks
|
| 105 |
+
- ETA tolerance matching for coordinated arrival
|
| 106 |
+
- Optimal ship allocation across sources
|
| 107 |
+
|
| 108 |
+
### 4. Defense
|
| 109 |
+
- Proactive defense horizon scanning
|
| 110 |
+
- Reinforcement missions to threatened planets
|
| 111 |
+
- Doomed planet evacuation with retreat routing
|
| 112 |
+
- Crash exploit detection (capturing planets after enemy fleet collisions)
|
| 113 |
+
|
| 114 |
+
### 5. Endgame
|
| 115 |
+
- Total war mode with focused weakest-enemy targeting
|
| 116 |
+
- Rear planet forwarding to frontline
|
| 117 |
+
- Ship count optimization for final scoring
|
| 118 |
+
|
| 119 |
+
## Files
|
| 120 |
+
- `submission.py` — The complete agent (single-file, no dependencies beyond kaggle-environments)
|
| 121 |
+
|
| 122 |
+
## License
|
| 123 |
+
MIT
|