AI interface extension

AI interface extension

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
Acidd_UK
Posts: 963
Joined: 23 Apr 2006, 02:15

AI interface extension

Post by Acidd_UK »

Re: http://taspring.clan-sy.com/phpbb/viewt ... 400#103400

It would be useful if the function that is called when a unit is damaged/destroyed would allow access to the unit type id of the thing that fired it. We can all differentiate sniper / artillery / annihilator etc fire when the firer is outside of the LOS, but the AI is not currently able to. For AAI this affects the learning algorithm and I'm sure the other AIs could make use of it for intelligence purposes.

The functions that would need changing are

Code: Select all

UnitDamaged(int damaged,int attacker,float damage,float3 dir)
UnitDestroyed(int unit, int attacker)
in the IGlobalAI class. It's my understanding that the attacker id is only set/available if the attacker is within LOS. As such thre functions probably need to be changed to

Code: Select all

UnitDamaged(int damaged,int attacker,int aunittype, float damage,float3 dir)
UnitDestroyed(int unit, int attacker, int aunittype, float3 dir)
These functions could actually be rolled into a single function

Code: Select all

UnitDamaged(int damaged,int attacker,int aunittype, float damage, bool destroyed, float3 dir)
without causing AI developers too much hassle....

All comments appreciated, esp from actual AI devs![/code]
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

This is somewhat pointless as it gives information to an AI a human layer wouldnt have.

Also this information can be gained through the cheat interface using KAI maphack.

Instead a change to add a WeaponDef* def parameter showing the type of weapon that damaged or killed the unit.

Also this shouldnt be made as an ammendment to the interface but as an addition using the HandleEvent function of IGlobalAI, to encourage the use of the HandleEvent() interface so that the AI interface version doesnt need changing.
User avatar
Acidd_UK
Posts: 963
Joined: 23 Apr 2006, 02:15

Post by Acidd_UK »

Yes, a reference to the actual weapon would be better - didn't know that was even possible :-) But I disagree that a human player doesn't have the info - it is generally very easy to tell what is attacking you even if you can't see it - weapons have signature graphics, sounds etc that are easy for us to recognise I think. That's why I don't think it should be regarded as an AI 'cheat'
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

In that case the AI can identify the unit based on the weapon.

But assuming that the weapons identify the unti in the way OTA or XTA/AA can, isnt very mod independant and making lots of assumptions.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

If a BLoD impacts near your units, what fired it? You know there's a limited number of units that do that but which one is it?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

That's an AI problem.
User avatar
Acidd_UK
Posts: 963
Joined: 23 Apr 2006, 02:15

Post by Acidd_UK »

AF - agreed. At least a lot of weapons ar eunique to a unit and so eliminates that potential confusion. Also, if in AA you see a radar dot move and then fire a BLOD, you know it's a penetrator and not an anni... AIs could exploit similar heuristics...
User avatar
unpossible
Posts: 871
Joined: 10 May 2005, 19:24

Post by unpossible »

doesn't sound like a cheat to me...
User avatar
Soulless1
Posts: 444
Joined: 07 Mar 2006, 03:29

Post by Soulless1 »

KDR_11k wrote:If a BLoD impacts near your units, what fired it? You know there's a limited number of units that do that but which one is it?
well a human would know its one of a few units, all of which can be killed by the same tactic...I think an AI should be able to get the same info TBH

And if and any of the AI devs think it would count as cheating (I don't think so TBH), no-one's forcing them to use the information ;)
User avatar
mehere101
Posts: 293
Joined: 15 Mar 2006, 02:38

Post by mehere101 »

I'd say that the AI should have access to the general type of missile that destroyed a unit. IE, a small plasma, a large plasma, a large AOE missile, a regular missile, a sniper shot, etc. that's what a human has access to, and it isn't too precise for the AIs.
User avatar
Lindir The Green
Posts: 815
Joined: 04 May 2005, 15:09

Post by Lindir The Green »

I say the AI should know which weapon fired, because it is exactly what a human would know.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Soulless1 wrote:
KDR_11k wrote:If a BLoD impacts near your units, what fired it? You know there's a limited number of units that do that but which one is it?
well a human would know its one of a few units, all of which can be killed by the same tactic...I think an AI should be able to get the same info TBH

And if and any of the AI devs think it would count as cheating (I don't think so TBH), no-one's forcing them to use the information ;)
There's a cheat interface for that that already provides the information thats being asked for should the Ai dev be willing to cheat to get it. It also makes the whole interface less coherent. We're already provided with the ID of the unit, just use cheatinterface->getUnitDef() to get its type and it'll return its type without chekcing if the unit is in LOS...
Post Reply

Return to “Feature Requests”