some questions about BWAPI, please help me~

63 views
Skip to first unread message

zhe wang

unread,
Jul 12, 2012, 5:38:33 AM7/12/12
to bw...@googlegroups.com
Now I'm using BWAPI_3.7, OS is win 7 professional.

1. The function onUnitComplete() works weird
I expect the function runs when a new unit is completed, but it is called when a new unit created, just like onUnitCreate(). And I can not find further instruction about it on the webpage.
Does it mean I have to write my own funcion in onFrame() to check if a unit is complete?

2.Orders in BWPAI
I can't understand some of these orders such as PlayerGuard, TurrentGuard etc. And again , I couldn't find any information to explain that..
I find that when I check the condition unit->getOrder() == Orders::PlayerGuard can reduce APM rapidly (When I using APMalert), why?

3.Sometimes I have to access Enemies units for getting information such as UnitType or State. How can I do that without being considered cheat in a competition? 
For example,  I want to use Scanner_Sweep to detect burrowed Lurker, how can I do that? I can only know my unit is under attack , but I can not get the unit who attacking mine..

4. I can not register on official forum .. where can I discuss BWAPI things with others...and get help? 

Adam Heinermann

unread,
Jul 12, 2012, 3:02:25 PM7/12/12
to bw...@googlegroups.com
1. I've read and accepted your issue. You can check Unit::isCompleted to check for completion.

2. PlayerGuard is the Idle order that is used on normal units owned by human players.
TurretGuard is used on Idle turrets (cannons, sunken, spore).

BUT, instead of checking the order, use Unit::isIdle(). It covers all of these orders for all units. It reduces APM because it will only command the unit if it's not doing anything else. After ordering it to do something then the order changes and the condition is no longer met. You can also check Game::setCommandOptimizationLevel regarding lowering APM.

3. You can go ahead and access all enemy unit information you can possibly obtain. Make sure the "CompleteMapInformation" flag is NOT enabled. This is the tournament setting. It won't be considered cheating. You can look for the Lurker Spike bullet, or check for enemy units with an "Unknown" unit type, and then proceed to scan the area.

4. You can discuss BWAPI things and get help on the IRC which is better than the forums. If you're unable to access the IRC then you can continue using this group, but may not get timely responses.
Reply all
Reply to author
Forward
0 new messages