go2starr / CS-638-BWAPI

Starcraft: Broodwar AI bot
GNU Lesser General Public License v3.0
9 stars 7 forks source link

Bunker sits half empty with 6 idle marines nearby #47

Open jmloethen opened 12 years ago

jmloethen commented 12 years ago

The new "if idle marines are close enough" logic is sloppy implemented in 6ad6afd0cc8fa5762bf1e381d1e902cda39db823. I recommend returning to the use bunker squads to fill bunkers logic implemented in 9f87de1be15cde70aa666da3fe4a1325a9bd15c9.

phagen commented 12 years ago

I have tried to fix it by adding back the bunkerSquads part. Also tried to fix the 'only one bunker' issue using this code. I don't have time to test it today. Probably tomorrow. i will appreciate if when you have time, you can have a look at it and point out errors if there is any.

if ((int)bunkerAgents.size() == 0 && ut == UnitTypes::Terran_Marine && ( (int)defendSquads.size() == 0 || defendSquads.back()->getSize() < 4)) { // if there isn't a defend squad make one if ((int)defendSquads.size() == 0) { defendSquads.push_back(new Squad("defend-squad", defend)); } // set pointer squad = defendSquads.back(); }

go2starr commented 12 years ago

FYI: The above was posted by diansheng