Page 1 of 1
AI interface extension
Posted: 21 Jul 2006, 18:35
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]
Posted: 21 Jul 2006, 20:32
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.
Posted: 21 Jul 2006, 20:40
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'
Posted: 21 Jul 2006, 20:45
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.
Posted: 21 Jul 2006, 21:00
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?
Posted: 21 Jul 2006, 21:03
by AF
That's an AI problem.
Posted: 21 Jul 2006, 21:48
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...
Posted: 21 Jul 2006, 21:51
by unpossible
doesn't sound like a cheat to me...
Posted: 27 Jul 2006, 12:03
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

Posted: 28 Jul 2006, 04:59
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.
Posted: 28 Jul 2006, 16:04
by Lindir The Green
I say the AI should know which weapon fired, because it is exactly what a human would know.
Posted: 28 Jul 2006, 16:37
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...