I've noticed in developing my AI I seem to be getting spurious events. In my test I have two coms. If I walk one into los of the other com, an enter los event is triggered, just as one would expect. What isn't expected is an entered radar event is also created. Likewise, when I retreat the unit and los is lost, both the leave los and leave radar events are triggered.
According to the unitdef, the unit has (getRadarRadius) zero for radar radius. As such, I'm confused. I expected the enter/leave los to be triggered but can not account for the radar related events.
Is this a bug or desired behavior? And if its desired, why?
enemy left radar event without radar?
Moderator: Moderators
Re: enemy left radar event without radar?
Units that are in LOS are also automatically in radar, so this is expected behavior. As for the 'why', it's because the engine sensor system was not designed to make the distinction between LOS-only and LOS+radar.
Re: enemy left radar event without radar?
Is this considered correct or is it just the way things are?Kloot wrote:Units that are in LOS are also automatically in radar, so this is expected behavior. As for the 'why', it's because the engine sensor system was not designed to make the distinction between LOS-only and LOS+radar.
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: enemy left radar event without radar?
It might help to think in more technical terms rather than using the terms LoS or radar for coverage.
Radar = Area where there's knowledge of enemy unit positions.
LoS = Radar + knowledge of unit types.
LeftRadar makes more sense under those definitions.
Radar = Area where there's knowledge of enemy unit positions.
LoS = Radar + knowledge of unit types.
LeftRadar makes more sense under those definitions.
Re: enemy left radar event without radar?
Wow. That's odd. Thanks for the clarification. I had no idea it worked like that. I assumed it used real world definitions. I'll need to think about this for a minute or two to determine if it has any implications for my AI effort. Again, thanks for the clarification.Radar = Area where there's knowledge of enemy unit positions.
LoS = Radar + knowledge of unit types.
So anything which is in LOS has a unitdef available. Anything which has not been in LOS but is on radar does not have a unitdef available. Correct?
Re: enemy left radar event without radar?
But how about cloaked units, they can be within LOS range and not be seen, but only if there's a radar will leave a blip there?CarRepairer wrote:Radar = Area where there's knowledge of enemy unit positions.
LoS = Radar + knowledge of unit types.
Re: enemy left radar event without radar?
yesechoone wrote: So anything which is in LOS has a unitdef available. Anything which has not been in LOS but is on radar does not have a unitdef available. Correct?
Yes, because "within LOS range" does not automatically mean a unit can be seen by eye (only when it is not cloaked), just like "within radar range" does not automatically mean a unit can be seen by enemy radar (only when it is not jammed and not underwater, recall that radar ignores whether objects are cloaked).JohannesH wrote:But how about cloaked units, they can be within LOS range and not be seen, but only if there's a radar will leave a blip there?
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: enemy left radar event without radar?
Sorry, my definition is badly worded then. I shouldn't have said "area" but rather "set of units" as their proximity to your radars and other units are not the only factor in whether you have info on them.
Units in radar range but also jammed are not in the set.
Units outside radar range may still be in the set if lua functions alter their los-state to your team so you can still see them. The simplest example is SetUnitAlwaysVisible which makes the unit visible to everyone at all times no matter where it is.
Oh, and I didn't include prevlos but you seem to be aware of it.
Units in radar range but also jammed are not in the set.
Units outside radar range may still be in the set if lua functions alter their los-state to your team so you can still see them. The simplest example is SetUnitAlwaysVisible which makes the unit visible to everyone at all times no matter where it is.
Oh, and I didn't include prevlos but you seem to be aware of it.
Re: enemy left radar event without radar?
Interesting.
Then doesn't that imply the "getRadarRadius" function should return "max( getLos(), unitOrModRadarRadius)"? As it seems LOS implicitly infers radar coverage. Therefore, the minimum radar radius is alway the unit's LOS.
Shouldn't the API layer provide the actual value rather than ALL AIs having to take this into account. Is it known if any AIs would be broken by making this "improvement"? Or does getRadarRadius() have some unexpected implementation details and/or side effect?
Also, how does one determine if they are ONLY seeing a radar blip which is potentially blurred (position error) versus a physical LOS which is not blurred? I assume that means the distance is <= unit LOS?
Perhaps this should be moved to the AI forum?
Then doesn't that imply the "getRadarRadius" function should return "max( getLos(), unitOrModRadarRadius)"? As it seems LOS implicitly infers radar coverage. Therefore, the minimum radar radius is alway the unit's LOS.
Shouldn't the API layer provide the actual value rather than ALL AIs having to take this into account. Is it known if any AIs would be broken by making this "improvement"? Or does getRadarRadius() have some unexpected implementation details and/or side effect?
Also, how does one determine if they are ONLY seeing a radar blip which is potentially blurred (position error) versus a physical LOS which is not blurred? I assume that means the distance is <= unit LOS?
Perhaps this should be moved to the AI forum?
Re: enemy left radar event without radar?
That would be true if the engine did not know the concept of a cloaked unit. Again, LOS only implicitly implies radar coverage for non-cloaked enemies.Then doesn't that imply the "getRadarRadius" function should return "max( getLos(), unitOrModRadarRadius)"? As it seems LOS implicitly infers radar coverage. Therefore, the minimum radar radius is alway the unit's LOS.
Well, that's where the EnemyEntered* events come in (*Radar ==> inaccurate position, *LOS ==> accurate position).Also, how does one determine if they are ONLY seeing a radar blip which is potentially blurred (position error) versus a physical LOS which is not blurred?