I can see your cloaked units!

https://github.com/bwapi/bwapi
Kae
Posts: 35
Joined: Tue Jun 28, 2011 1:26 pm

I can see your cloaked units!

Postby Kae » Fri May 18, 2012 3:21 am

Hi all,

I discovered this week something I am not confortable with. Using BWSAL UnitGroup's commands, it is possible to collect a lot of information on enemy cloaked units even if you don't have any detectors.

You can find attached a screenshot where my dragoons are targetting a DT (red lines) even if I have no photon cannons / observers. In this very specific situation, I used the intruction SelectAllEnemy()( canAttack )( isCompleted ).inRadius(...) to grab enemy units around my dragoons, and I can have the position of cloaked units. Thus, to attack them, a mere attack( cloaked_unit->getPosition() ) is possible, and I guess can be very efficient with explosive attacks (Reaver, for instance).

I think it should be fixed, because it becomes to easy then for an AI to handle enemy cloaked units without detectors. One can argue a human being can spot as well cloaked units thanks to the blur effect. That's right, but it remains more complicated and not so automatic than a simple SelectAllEnemy() instruction.

So, what do you think guys? Should BWAPI take this fact into consideration?
krasi0
Posts: 254
Joined: Thu Dec 18, 2008 12:42 pm

Postby krasi0 » Fri May 18, 2012 9:03 am

[quote name='krasi0' date='18 May 2012 - 11:00 AM' timestamp='1337331607' post='10910']
There has been a long discussion about this long time ago. The cloaked / burrowed unit becomes only visible once it starts moving or attacks. So if while scouting the map, your dragoon unit passes some distance away from an enemy dt which is in hold position and doesn't attack, your bot shouldn't know of that DT. Also even if your bot is aware of a moving cloaked unit nearby, it doesn't know its type, or HP, etc. I am not 100% about the type thing though.
Anyway if we remove this feature, it'll be trivial to destroy any bot with a dt or lurker(wraith, etc) rush.
Also you know very well that writing a bot for BW is not easy at all :D


[quote name='Kae' date='18 May 2012 - 05:21 AM' timestamp='1337311287' post='10909']
Hi all,

I discovered this week something I am not confortable with. Using BWSAL UnitGroup's commands, it is possible to collect a lot of information on enemy cloaked units even if you don't have any detectors.

You can find attached a screenshot where my dragoons are targetting a DT (red lines) even if I have no photon cannons / observers. In this very specific situation, I used the intruction SelectAllEnemy()( canAttack )( isCompleted ).inRadius(...) to grab enemy units around my dragoons, and I can have the position of cloaked units. Thus, to attack them, a mere attack( cloaked_unit->getPosition() ) is possible, and I guess can be very efficient with explosive attacks (Reaver, for instance).

I think it should be fixed, because it becomes to easy then for an AI to handle enemy cloaked units without detectors. One can argue a human being can spot as well cloaked units thanks to the blur effect. That's right, but it remains more complicated and not so automatic than a simple SelectAllEnemy() instruction.

So, what do you think guys? Should BWAPI take this fact into consideration?
[/quote]
[/quote]
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Fri May 18, 2012 4:37 pm

I think the argument now is something along the lines of "How lenient/strict should BWAPI be about cloaked units?".
I don't even remember which info is available or not about cloaked units, and I think even burrowed units' locations are known even if they don't attack (Zerglings and Spider Mines for example).

The problem being presented is that any kind of tactical play involving any burrowable/cloakable units can easily be countered with minimal effort.

Someone needs to carry out some kind of study about gamers noticing cloaked/burrowed units. If I patch replay_tool to not fail on the replay that krasi0 sent me (it might be that reptool is bugged or the replay is bugged) then I can modify it to look for all replays that use the cloak ability, Dark Templars, Observers, or the Burrow ability.

We never actually created rules or some kind of threshold for which to reveal undetectable units. We could also try distorting the position a little bit, something like position +- rand()%32.

An old topic on these forums here: index.php?showtopic=649
Huge debate in an issue here: http://code.google.com/p/bwapi/issues/detail?id=113

I believe there was a lengthly discussion on IRC as well but I don't have the logs.
abcdefg
Posts: 45
Joined: Sat Aug 20, 2011 2:37 am

Postby abcdefg » Fri May 18, 2012 10:04 pm

[quote name='Heinermann' date='18 May 2012 - 08:37 AM' timestamp='1337359033' post='10912']
I think the argument now is something along the lines of "How lenient/strict should BWAPI be about cloaked units?".
I don't even remember which info is available or not about cloaked units, and I think even burrowed units' locations are known even if they don't attack (Zerglings and Spider Mines for example).

The problem being presented is that any kind of tactical play involving any burrowable/cloakable units can easily be countered with minimal effort.

Someone needs to carry out some kind of study about gamers noticing cloaked/burrowed units. If I patch replay_tool to not fail on the replay that krasi0 sent me (it might be that reptool is bugged or the replay is bugged) then I can modify it to look for all replays that use the cloak ability, Dark Templars, Observers, or the Burrow ability.

We never actually created rules or some kind of threshold for which to reveal undetectable units. We could also try distorting the position a little bit, something like position +- rand()%32.

An old topic on these forums here: index.php?showtopic=649
Huge debate in an issue here: http://code.google.com/p/bwapi/issues/detail?id=113

I believe there was a lengthly discussion on IRC as well but I don't have the logs.
[/quote]

My opinion is that cloaked units should only revealed by detectors or if they attack something like a DT otherwise they should stay invisible even though its possible (very hard) for a player to spot one.
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Sun May 20, 2012 12:30 am

So do we want to see something like this?

https://docs.google.com/spreadsheet/ccc ... UJZd1VIRWc
In the chart:
+ Attacking = undetected unit attacks
+ Cloaking/Created = just pressed the cloak button, or a dark templar/observer was just created (from their building), with scanner sweep it is as long as the scan animation is playing, with traps it is as they are closing up
+ Decloaking = unit is not actually detected, but gradually becoming visible as it is being decloaked, or trap becoming visible
+ Using Ability = Lockdown, ensnare, etc.

My thoughts:
+ It can be argued that Ghosts and Infested Kerrigan have an idle animation which can cause them to be revealed to human eyes. I'm not sure what to do about it.
+ Scanner sweep should not be detectable if the scan animation was never seen.
+ If a unit type was revealed, should their type still be revealed until they move back into the fog of war?
+ Traps can actually be obviously visible when not perfectly paired with the Installation tileset.
krasi0
Posts: 254
Joined: Thu Dec 18, 2008 12:42 pm

Postby krasi0 » Mon May 21, 2012 1:18 pm

I think that most cloaked units are quite distinguishable when moving by a human by the size and shape of the blurred spot.
Some of the idle units can be distinguished, too. I remember having this same discussion (also lowerlogic was involved back then) and concluded that the current behavior is most tolerant to bots without giving them any disadvantage. Heinermann, you might want to check the code on how it's implemented ATM for reference.

P.S. when bots reach any competitive level against humans, we might get back to this discussion but crippling even more a "blind" bot may be too much IMHO.

[quote name='Heinermann' date='20 May 2012 - 03:30 AM' timestamp='1337473834' post='10914']
So do we want to see something like this?

https://docs.google.com/spreadsheet/ccc ... UJZd1VIRWc
In the chart:
+ Attacking = undetected unit attacks
+ Cloaking/Created = just pressed the cloak button, or a dark templar/observer was just created (from their building), with scanner sweep it is as long as the scan animation is playing, with traps it is as they are closing up
+ Decloaking = unit is not actually detected, but gradually becoming visible as it is being decloaked, or trap becoming visible
+ Using Ability = Lockdown, ensnare, etc.

My thoughts:
+ It can be argued that Ghosts and Infested Kerrigan have an idle animation which can cause them to be revealed to human eyes. I'm not sure what to do about it.
+ Scanner sweep should not be detectable if the scan animation was never seen.
+ If a unit type was revealed, should their type still be revealed until they move back into the fog of war?
+ Traps can actually be obviously visible when not perfectly paired with the Installation tileset.
[/quote]
User avatar
breakk
Posts: 5
Joined: Thu Jan 19, 2012 8:32 pm
Contact:

Postby breakk » Thu May 24, 2012 9:54 am

Hi.
I asked some people on TL forum about this and there was one interesting idea. This guy suggested to have some % chance to spot invisible units.

Even though I don't have any problem with bots seeing invisible units (just like I don't have any problem with their APM over 9000), I must say that it's an interesting solution.
Kae
Posts: 35
Joined: Tue Jun 28, 2011 1:26 pm

Postby Kae » Wed May 30, 2012 2:03 am

[quote name='Michal Certicky' date='24 May 2012 - 06:54 PM' timestamp='1337853262' post='10920']
Hi.
I asked some people on TL forum about this and there was one interesting idea. This guy suggested to have some % chance to spot invisible units.
[/quote]

Hi,

Won't work: The instruction for searching units around you is usually executed each frame by AIs, so whatever the probability you fixed, you would spot the cloaked unit at most in a couple of seconds.


[quote name='Michal Certicky' date='24 May 2012 - 06:54 PM' timestamp='1337853262' post='10920']
Even though I don't have any problem with bots seeing invisible units (just like I don't have any problem with their APM over 9000), I must say that it's an interesting solution.
[/quote]

Indeed, it seems I am one of the rare guys seeing a problem with spotting cloaked units without any detectors and efforts. But I strongly disagree with people seeing a problem with APM, which is completely a different thing. It is a naive mistake to compare AIs APM with human APM. I think the best way to realize this is to code an AI for Broodwar. :-)
Heinermann
Posts: 362
Joined: Thu Apr 26, 2007 12:42 am

Postby Heinermann » Sat Jun 02, 2012 2:47 am

Take into account that over 90% of an AI's APM is just non-grouped actions, duplicate actions from latency settings, interrupted actions from latency settings, and other spammy actions.

Also for the reveal percentage, it wouldn't be a percentage to appear or not appear every frame, but a percentage of appearing when entering the player's field of vision or executing an order. Once the unit is made "visible", it will remain visible for as long as it's within the player's sight.
Quatari
Posts: 1
Joined: Wed Aug 15, 2012 3:55 pm

Postby Quatari » Tue Aug 28, 2012 7:10 pm

I tested this for myself. In BWAPI v3.7.4, canIssueCommand() and issueCommand() both return true for my dragoon to Attack_Unit where the target unit is an enemy DT on a visible tile that I haven't detected. The dragoon saw the DT move near to it then hold position, so a human would have noticed the ripple effect. In BW, I can see the Dragoon start moving towards the DT but it doesn't attack it (i.e. no bullet).

Because there was a ripple effect, I think it is fine that my bot knows of the existence of the DT and knows its position.

What I think is a problem though is that the DT is targetable by my dragoon (i.e. shouldn't be able to Attack_Unit because Attack_Unit requires a particular unit to be specified). I think when targeting a unit (as opposed to targeting a position), I think in addition to checking exists(), BWAPI should also check Unit::isDetected() (unless complete map info is enabled). For people that might want canIssueCommand() to return true for convenience (i.e. as an alias for Attack_Position), I would argue that it's misleading to return true, because a bot might think it is an attackable unit (which it is not) - instead, you can query the position of the DT (you know it exists and its position because of the ripple effect) then use Attack_Position (not Attack_Unit).

I've taken screenshot & saved a replay. I will probably raise it as a BWAPI issue along with some other potential issues I've found with canIssueCommand()/issueCommand().

Do all cloaked units continuously display a ripple animation (even while stationary and idle)?

I think the existence & exact position of a cloaked unit should be determinable if and only if a ripple animation has started to be played for it since the cloaked unit appeared on its current tile, since the hero player last gained visibility of that tile. Maybe that's actually how BWAPI works currently?

The splash attack tactic mentioned by the OP is what good human players do, i.e. this tactic is not limited to computer players. In fact, SC2 even has a challenge/achievement scenario where you must do this to beat the challenge. And of course, to do this tactic you would need to have built splash-dealing units and have them nearby to be able to use that tactic, and you would still be dealing damage to your own units that you could be dealing to other detected enemy units, so I wouldn't call this tactic "too easy for an AI". Anyway, based on the test I did, I would expect the reavers to move towards the DT but not attack it - in order to kill the DT with splash damage, the reavers would need to target friendly or neutral units that are nearby the DT.

I definitely wouldn't incorporate any randomness, unless BW actually has some kind of randomness in its animations.

Return to “BWAPI (wrappers in other languages / questions and announcements related to BWAPI itself)”

Who is online

Users browsing this forum: No registered users and 1 guest