Author Topic: Is it possible to add new AI object classes for setStrType?  (Read 732 times)

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
BF2 (and FH2) currently has 6 object classes/types used by "aiTemplatePlugIn.setStrType" in objects.ai files: Infantry, LightArmour, HeavyArmour, NavalArmour, Helicopter and Airplane. Anyone know if it's possible to add more via modding, or if the classes are hard-coded?

Adding "Unarmoured Vehicle", "Medium Armour" and "Static Gun" classes would be very handy for improving the AI's target selection and weapon use - e.g. aircraft could be set to strafe unarmoured and light vehicles but not medium/heavy armour, tanks could be set to only use special AP rounds on heavy armour, etc. Currently, having all tanks/armoured cars as "heavy armour" and all guns, APCs and softskins as "light armour" makes it difficult to get the AI to use the right weapon type; HE rounds, for example, are the best choice against AT guns, but not too effective against halftracks.

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: Is it possible to add new AI object classes for setStrType?
« Reply #1 on: 16-03-2010, 07:03:12 »

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: Is it possible to add new AI object classes for setStrType?
« Reply #2 on: 25-03-2010, 21:03:54 »
Judging from this thread on BFSP...: http://www.battlefieldsingleplayer.com/forum/index.php?showtopic=13232&hl=aiTemplatePlugIn.setStrType

...I'd say they're hard-coded.

Shame  :( Thanks for the information anyway.

I'm wondering, though, if it would be possible to use the "Helicopter" and "NavalArmour" armour classes (unused in FH2, I don't think NavalArmour was used even in vBF2) as substitutes for new armour types (unarmoured and heavy respectively). Armour types don't affect the AI's usage of vehicles (korben_dallas's post in the thread you linked to refers to changing the AI behaviour category) but would it affect weapon damage/penetration? I assume not - I think these "armour classes" are only used by the AI, actual armour data is stored elsewhere - but I'm not 100% certain.
I'll probably try this out anyway and see what happens...

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: Is it possible to add new AI object classes for setStrType?
« Reply #3 on: 26-03-2010, 10:03:02 »
...I'm wondering, though, if it would be possible to use the "Helicopter" and "NavalArmour" armour classes (unused in FH2, I don't think NavalArmour was used even in vBF2) as substitutes for new armour types (unarmoured and heavy respectively)...
I don't see why not, and it would certainly help the bots prioritize their targets better.


Quote
...I assume not - I think these "armour classes" are only used by the AI, actual armour data is stored elsewhere - but I'm not 100% certain...
Yeah, AFAIK the "armor class" is how the bots identify what a vehicle is...i.e.: A bots "target" falls into one of the 6 armor classes (in FH's case, 4 armor classes), which mainly determines whether or not a bot will attack it.