This repository contains my original experiments on modeling StarCraft as a multi-stage optimization problem. The goal was to decide how to spend limited resources over time in order to maximize the resulting army / discover an optimized build order.
The notebooks explore multi-stage integer models, continuous relaxations, different StarCraft rule sets (including Wings of Liberty and Heart of the Swarm), and an early PySC2 agent.
I am revisiting this project and using it as the starting point for a new, cleaner project: RTS-Optimization.
The new project will formalize the problem as:
Given an initial RTS state, game rules, and a time horizon, find a legal sequence of decisions that optimizes a specified objective, such as army value at a deadline or the earliest timing for a target army.
The new implementation will move from the original abstract "stages" toward a time-aware state-transition / scheduling model with:
- real StarCraft II costs and build times;
- resources, workers, supply, buildings, units, and prerequisites;
- construction and production durations;
- simultaneous production and other forms of parallelism;
- a deterministic simulator for validating solutions;
- exact methods on small instances (including brute force / dynamic programming);
- mathematical optimization methods such as MILP or CP-SAT for larger instances;
- generated build orders as the primary output.
The new repository is intended to preserve the mathematical idea of this project while making the model reproducible, testable, and extensible.
Original repository: this repository is kept as the historical research/prototype record.
New project: RTS-Optimization.