Closed GoogleCodeExporter closed 9 years ago
Watching the hitpoints is the most logical way to define if one of your units
got
attacked. We could make an onUnitDamaged callback, it would trace hitpoints
internally, same diff.
The AttackType is the new bullet detection feature we're working on (issue 93),
which will sove the problem of who shot whom, but for now tracing hitpoint is
only
reliable way.
Original comment by goo...@teabix.com
on 14 Jan 2010 at 1:30
It's something I can do on my side, doesn't have to be done internally but
could be
useful for newcomers.
Original comment by patrick....@gmail.com
on 14 Jan 2010 at 4:09
This would be incredibly helpful. Pretty much every AI will needs to know if a
unit
is attacked, so at least knowing if a unit becomes damaged would be helpful.
Original comment by darkp...@gmail.com
on 14 Jan 2010 at 7:52
My problem was also that if I detect being attack by hitpoints. I can't know
what is
attack me. If a lurker for example attack me. I would retreat. I can detect
there is no
unit nearby. But if it's a mine, I still can't see it because it won't be there
anymore
but I might decide to sacrifice one unit as a deminer and still attack but if I
can't
make the call without more informations.
Original comment by patrick....@gmail.com
on 14 Jan 2010 at 9:27
I had the same problems, then stumbled into the bullet array in broodwar memory
when
trying to find a way to detect psionic storms. Bullet support will be THE means
to
detect who has been attacking your units. It's even more, just like a human
player
can predict when the antiair missile of his goliath will hit the target he
designated, that will be possible with AIs too.
It won't be helpful with mines, since those are units, not bullets. And like
with
anything belonging to the enemy, you do not get to see it's orders or targets.
You
have to deduce enemies intentions from his actions.
I will have the bullet support (or a stripped version at least) in the BWAPI1
interface ready for the BWAPIv3.0 release. Can't promise anything for BWAPI2
tho.
Original comment by goo...@teabix.com
on 14 Jan 2010 at 10:15
i wonder why the bullet record don't have information about it's source and
target unit?
Original comment by neoedmund
on 15 Jan 2010 at 6:35
it has (who said it hasn't?).
Original comment by goo...@teabix.com
on 15 Jan 2010 at 12:58
you mean some unknown field in struct AttackType?
Original comment by neoedmund
on 15 Jan 2010 at 1:39
AttackType is work in progress. Broodwar memory does hold all necessary data,
at
least I found out all I needed to know.
But don;t expect too much info, you probably won;t be allowed to query the
target of
enemy bullets for the same reasons you are not allowed to query the target of
an
enemy unit.
Original comment by goo...@teabix.com
on 15 Jan 2010 at 2:26
Thanks tons for BWAPI and looking forward to using this issue functionality in
future
releases - being able to tell which of my units are actively firing or being
fired upon
and perhaps the direction or location of the attack would help loads with
organized
firing or avoiding fire.
Original comment by jeremy.c...@gmail.com
on 26 Jan 2010 at 4:23
Try enemyUnit.isAttacking, then get the enemy's target. Revision 2126
Original comment by AHeinerm
on 7 Mar 2010 at 11:42
Original issue reported on code.google.com by
patrick....@gmail.com
on 14 Jan 2010 at 5:54