It appears you have not registered with our community. To register please click here ...
Username
Password
void AIWaveThinkDefault (int player, wave w, int type) { point pHome = AIGetTownLocation(player, c_townMain); int pDist; int pDistMax = 9999999; int i = 1; unit u; if (AIWaveUnitCount(w) < 1) { return; } while(i <= AIWaveUnitCount(w)) { u = UnitGroupUnit(AIWaveGetUnits(w),i); pDist = FixedToInt(DistanceBetweenPoints(pHome, UnitGetPosition(u))); //* retreat idle groups when far away from base * if (AIWaveGetTimeInCombat(w) == 0) { pDistMax = 32; } else { pDistMax = 38; } if ((pDist >= pDistMax) && (type == c_waveMain)) { if ( (AIWaveState(w) == c_waveStateIdle) || (AIWaveState(w) == c_waveStateDefend) ) { AIWaveSetType(w, c_waveStateRetreat, AIWaveTargetGatherO(player, c_townMain)); return; } } i = i + 1; } if (type == c_waveMain) { AIWaveMain(player, w); } else if (type == c_waveDefend) { AIWaveDefend(player, w); } else if (type == c_waveAttack) { AIWaveAttack(player, w); } else if (type == c_waveDivert1) { AIWaveDivert(player, w, e_divert1State); } else if (type == c_waveDivert2) { AIWaveDivert(player, w, e_divert2State); } else if (type == c_waveClearObs) { AIWaveClearObs(player, w); } else if (type == c_waveHome) { AIWaveHome(player, w); }}
void AIManageSupply (int player){ string supplyType; string p_race = PlayerRace(player); int supply_made = PlayerGetPropertyInt(player, c_playerPropSuppliesMade); int supply_gap = supply_made / 9; if (supply_gap < 5) { supply_gap = 5; } if(p_race == "Terr") { supplyType = c_TB_SupplyDepot_Alias; } else if(p_race == "Prot") { supplyType = c_PB_Pylon; } else if(p_race == "Zerg") { supplyType = c_ZU_Overlord_Alias; } if ( (PlayerGetPropertyInt( player, c_playerPropSuppliesUsed ) >= PlayerGetPropertyInt( player, c_playerPropSuppliesMade ) - supply_gap ) && (AITechCount ( player, supplyType, c_techCountIncompleteOnly ) == 0 )) { AISetStockUnitNext( player, AITechCount( player, supplyType, c_techCountCompleteOnly ) + 1, supplyType, c_stockAlways); }}
void AIBalancePeons(int player){ int a = 0; int gas = PlayerGetPropertyInt(player, c_playerPropVespene); int minerals = PlayerGetPropertyInt(player, c_playerPropMinerals); int totalTowns = AIGetTotalTowns(player); int nRefinery = 0; int gcount = 0; int totalPeons = 0; int needPeons = 0; int gasPeons = 0; string refine; string worker; string mbase; string p_race = PlayerRace(player); if(p_race == "Terr") { refine = "Refinery"; worker = "SCV"; mbase = c_TB_CommandCenter_Alias; } else if(p_race == "Prot") { refine = "Assimilator"; worker = "Probe"; mbase = c_PB_Nexus; } else if(p_race == "Zerg") { worker = "Drone"; refine = "Extractor"; mbase = c_ZB_Hatchery_Alias; } a = 0; while(a != 8 ) { gasPeons = 0; if (AIGetTownState(player, a) == c_townStateEstablished) { nRefinery = AIGetBuildingCountInTown(player, a, refine, c_techCountCompleteOnly); if(AIGetCurPeonCount(player, a) > 12) { AISetStockEx (player, a, 2, refine, c_makeCollector, 0); if (gas > minerals + 1200) { gasPeons = 0; } else if (gas > minerals + 900) { gasPeons = 1; } else if (gas > minerals + 600) { gasPeons = 2; } else if (gas > minerals + 300) { gasPeons = 3; } else { gasPeons = 3 * nRefinery; } } else if(AIGetCurPeonCount(player, a) > 6) { AISetStockEx (player, a, 1, refine, c_makeCollector, 0); gasPeons = 3; } else { gasPeons = 0; } } AISetGasPeonCountOverride(player, a, gasPeons); a = a + 1; } //making zerg spam hatchs //AISetStockUnitNext(player, totalTowns, mbase ,c_stockIdle); // build peons totalPeons = AITechCount (player, worker, c_techCountCompleteOnly); if(p_race == "Zerg") { needPeons = totalTowns * 28; } else { needPeons = totalTowns * 33; } if (needPeons > 90) { needPeons = 90; } if (needPeons < totalPeons) { needPeons = totalPeons; } AISetStockUnitNext(player, needPeons, worker, c_stockAlways);}
The first 2 are interesting. I hope they're good, but I can't tell just looking.The gas one I disagree with. First, it should only ever consider removing gas workers if there are fewer than 2 per patch on minerals (18 usually). Even then, it should focus on spending gas unless it has one base and is struggling to replace dead mineral workers. Also, 3 workers on gas saturates it on every map released so far.
void AIWaveThinkDefault (int player, wave w, int type){ point pHome = AIGetTownLocation(player, c_townMain); int pDist; int pDistMax; int i = 1; unit u; if (AIWaveUnitCount(w) < 1) { return; } while(i <= AIWaveUnitCount(w)) { u = UnitGroupUnit(AIWaveGetUnits(w),i); pDist = FixedToInt(DistanceBetweenPoints(pHome, UnitGetPosition(u))); //retreat idle groups when far away from base if (AIWaveGetTimeInCombat(w) == 0) { pDistMax = 32; } else { pDistMax = 38; } if ((pDist >= pDistMax) && (type == c_waveMain)) { if ( (AIWaveState(w) == c_waveStateIdle) || (AIWaveState(w) == c_waveStateDefend) ) { AIWaveSetType(w, c_waveStateRetreat, AIWaveTargetGatherO(player, c_townMain)); return; } } i = i + 1; } if (type == c_waveMain) { AIWaveMain(player, w); } else if (type == c_waveDefend) { AIWaveDefend(player, w); } else if (type == c_waveAttack) { AIWaveAttack(player, w); } else if (type == c_waveDivert1) { AIWaveDivert(player, w, e_divert1State); } else if (type == c_waveDivert2) { AIWaveDivert(player, w, e_divert2State); } else if (type == c_waveClearObs) { AIWaveClearObs(player, w); } else if (type == c_waveHome) { AIWaveHome(player, w); }}void AIManageSupply (int player){ string supplyType; string p_race = PlayerRace(player); int supply_made = PlayerGetPropertyInt(player, c_playerPropSuppliesMade); int supply_gap = supply_made / 9; if (supply_gap < 5) { supply_gap = 5; } if(p_race == "Terr") { supplyType = c_TB_SupplyDepot_Alias; } else if(p_race == "Prot") { supplyType = c_PB_Pylon; } else if(p_race == "Zerg") { supplyType = c_ZU_Overlord_Alias; } if ( (PlayerGetPropertyInt( player, c_playerPropSuppliesUsed ) >= supply_made - supply_gap ) && (AITechCount ( player, supplyType, c_techCountIncompleteOnly ) == 0 )) { AISetStockUnitNext( player, AITechCount( player, supplyType, c_techCountCompleteOnly ) + 1, supplyType, c_stockAlways); }}void AIBalancePeons(int player){ int a = 0; int gas = PlayerGetPropertyInt(player, c_playerPropVespene); int minerals = PlayerGetPropertyInt(player, c_playerPropMinerals); int totalTowns = AIGetTotalTowns(player); int nRefinery = 0; int needPeons = 0; int gasPeons; string refine; string worker; string mbase; string p_race = PlayerRace(player); if(p_race == "Terr") { refine = "Refinery"; worker = "SCV"; mbase = c_TB_CommandCenter_Alias; } else if(p_race == "Prot") { refine = "Assimilator"; worker = "Probe"; mbase = c_PB_Nexus; } else if(p_race == "Zerg") { worker = "Drone"; refine = "Extractor"; mbase = c_ZB_Hatchery_Alias; } while(a != 8 )//Starcraft supports up to 16 players (0 to 15) { gasPeons = 0; if (AIGetTownState(player, a) == c_townStateEstablished) { nRefinery = AIGetBuildingCountInTown(player, a, refine, c_techCountCompleteOnly); if(AIGetCurPeonCount(player, a) > 12) { AISetStockEx (player, a, 2, refine, c_makeCollector, 0); if (gas > minerals + 1200) { gasPeons = 0; } else if (gas > minerals + 900) { gasPeons = 1; } else if (gas > minerals + 600) { gasPeons = 2; } else if (gas > minerals + 300) { gasPeons = 3; } else { gasPeons = 3 * nRefinery; } } else if(AIGetCurPeonCount(player, a) > 6) { AISetStockEx (player, a, 1, refine, c_makeCollector, 0); gasPeons = 3; } else { gasPeons = 0; } } AISetGasPeonCountOverride(player, a, gasPeons); a = a + 1; } //making zerg spam hatchs //AISetStockUnitNext(player, totalTowns, mbase ,c_stockIdle); // build peons if(p_race == "Zerg") { needPeons = totalTowns * 28; } else { needPeons = totalTowns * 33; } if (needPeons > 90) { needPeons = 90; } if (needPeons < totalPeons) { needPeons = AITechCount (player, worker, c_techCountCompleteOnly); //Should you just ignore AISetStockUnitNext() ? } AISetStockUnitNext(player, needPeons, worker, c_stockAlways);}
I have found the AI with 500+ gas and 100- minerals multiple times, especially during Terran opening stages... there is no way to spend these gas with such limited minerals