|
UpcId | findSourceUpc (State *s) |
|
virtual void | process (State *state, int srcUpcId) |
|
void | formGroups (State *state, TacticsState &tstate, std::vector< Unit * > &leftoverWorkers, std::unordered_set< Unit * > &wasInAGroup) |
| Create groups based on distance rules, useful for the scouting/worker/search and destroy functionality. More...
|
|
void | distributeLeftoverWorkers (std::unordered_set< Unit * > &unitSet, std::vector< Unit * > &leftoverWorkers, std::unordered_set< Unit * > &wasInAGroup) |
| Return unused workers, doesn't rely on group creation, just on existance of leftoverWorkers which specifies the workers and wasInAGroup which specifies which will automatically be reassigned based on attachement to a previously existing task. More...
|
|
void | processNonFightFleeGroup (State *state, TacticsState &tstate, TacticsGroup &g, std::vector< Unit * > &leftoverWorkers, std::unordered_set< Unit * > &wasInAGroup) |
| Takes the scouting & search and destroy groups created in formGroups and issues the commands, also returns leftoverWorkers. More...
|
|
void | moveUnit (State *state, UpcId srcUpcId, Unit *u, Position target) |
| Creates a move upc for unit with given target. More...
|
|
std::pair< double, double > | distributeFightFlee (State *state, TacticsState &tstate, TacticsGroup &g, std::vector< Unit * > &fightUnits, std::vector< Unit * > &fleeUnits) |
| Uses combat sim + rules to put each unit into a fight or flee vector. More...
|
|
void | processOrders (State *state, TacticsGroup &g, int srcUpcId, double deleteScore, double moveScore, std::vector< Unit * > &fightUnits, std::vector< Unit * > &fleeUnits, std::vector< Unit * > &leftoverWorkers, std::unordered_set< Unit * > &wasInAGroup) |
| Takes a group and the fight/flee assignments and issues commands. More...
|
|
virtual bool | alwaysFight () |
|
| Module () |
|
The Tactics module decides where on the map to allocate combat units.
- Identifies clusters of enemy units, and which allied units are currently engaged with them.
- Allocates other allied units to various jobs like attacking, defending, and scouting.
- Uses a combat simulator to identify which clusters of allies should fight and which should flee (and where they should go)
Finally, outputs a UPC for each group of units indicating where they should go or what they should fight.