Quote from: Astazha on March 16, 2010, 09:35:12 AM
Ok, this is actually really straightforward. I thought I was going to have to jump through some hoops, but it turns out to be extremely simple.
The two functions we are interested in are:
AICounterUnit()
AICounterUnits()
...
We delete all the existing entries. Then we make an entry for each unit and building, listing it as the counter to itself with a ratio of 1.00
Then when you call
countPBGateways=AICounterUnits(player, 4, c_PB_Gateway);
it will tell you how many Gateways player 3 has. Wash Rinse Repeat for every unit in the game. Once you get a read of what race you're dealing with you no longer have to check 2/3 of the units and we can begin to make match-specific decisions about the build order and general strategy.
I'll post actual code when I have something working, but if you want to mess with it now that's how it works.
AIKnownUnitCount(player, 4, c_PB_Gateway); will return the number of units player knows that player 4 has; if you haven't enabled the cheating vision it will only return what it can/has seen.