OpenXcom Forum
Modding => Help => Topic started by: Nord on December 19, 2018, 01:24:58 pm
-
I can not understand order or better say rating of weapon for AI.
When i give to the unit buitin ranged weapon with snapshot and normal melee weapon, it use both. If builtin ranged weapon have only aimed shot, then unit dont use it, only melee.
Looks like same for normal weapons: if ranged weapon have only aimed shot, then unit will ignore it and use melee (looks strange when the unit with fireball and a knife runs through map to cut someone instead of burn them to ash).
So, there is a question: which order do AI use to choose which weapon to shoot? Maybe some key parameters? If i want to give to a the unit two weapons and want him to use both, what should i do?
Sorry for random articles spelling.
-
VERY roughly:
1. if a unit can do a psi attack, and it has a semi-decent chance to succeed... it will use psi
2. otherwise, if a unit has a blaster launcher and enough waypoints... it will use a blaster
3. otherwise, in OXCE only, if a unit is a sniper and there are some spotted xcom units, it will try sniping
4. otherwise, if a unit has a grenade, and it's worth using, it will try using it
5. otherwise if a unit has any melee or ranged weapon:
- it will calculate melee attack efficiency based on various parameters and roll dice... if rolled, it will try melee first and ranged second, otherwise it will try only ranged
- if there are two ranged weapons, it will use the one that has ammo and a snap shot mode; if both have snap shot mode it will use the quicker one (less TU to shoot)
-
Good.
And by sniping you mean aimed shot to distant target?
-
Good.
And by sniping you mean aimed shot to distant target?
Yes, a shot beyond the maximum visibility range, or through smoke, or through otherwise obstructed vision.
Not sure if aimed only, I think it can be theoretically also a snapshot or autoshot... but I would have to look at the code to find out.
-
Thanks. This list is really helpful.
-
It's not just aimed shot for sniping, the AI does a rough consideration of the number of expected hits per shot type per turn and picks which mode gets the most, with some RNG fuzziness thrown on top for flavor.