Be warned, this post is long and technical, but you will find a d/l link at the end of it.
I've recently revisited this project, and made some minor tweaks to the rewrite I did a few months ago. The official FH2 2.3 AIBehaviors.ai file has some strange issues. I can't definitively call them mistakes, I can only say that some things I found were highly irregular. I will qualify that statement with an example:
Tank Fire behavior entry from original:
aiSettings.setVehicleBehaviour Tank Fire BBFireInfantery BBPFireInfantery 4 UCFire TankWeights
This causes the urgency for the tank fire behavior to reach an unreasonably high value (in excess of 90 in some instances, where 5-8 is sufficient to make it the active behavior)
Tank Fire behavior from my recode:
aiSettings.setVehicleBehaviour Tank Fire BBFireInfantery BBPFireInfantery 4 UCTankFire UnitWeights
.
The main correction here is the use of
UnitWeights instead of
TankWeights. Observant readers will also notice the change of urgency curve generators (from UCFire to UCTankFire). This was not strictly necessary, but is an enhancement I coded in. It seems to help keep the tanks moving as they shoot. Seems to - I am not sure.
There are a host of other changes, but they are made in such a way that the bots should show similar behaviors to that created by the official file. You should see minor bot behavior improvements if you use this file, though the differences are subtle.
Here is a full list of the changes I made, taken from the code comments:
Forgotten Hope 2.x AIBehaviors Recode
Version 2.4 :5-10-2011
by Void
Featured Changes from 2.3 Official:
- soldier weights now unique to `Infantery`
- unit weights corrected and reinstated as behavior inhibitors
- avoid inhibitors corrected and reinstated as behavior inhibitors
- change inhibitors corrected and reinstated as behavior inhibitors
- base Idle urgency now 0.1
- custom inhibitors for `Tank` Fire && Move behaviors (also applied to `ArmedCar`)
- custom UC generator for `Tank` Fire behavior (also applied to `ArmedCar`)
- unarmed `Passenger` Fire weight now 1.0 (was much higher, but here this number is used only to calculate urgency of the Change behavior)
- `Car` vehicle type now more likely to try and run over enemies
- Added LookAtWrapper interpreter entry to ALL vehicle types. If you decide to code a vehicle of any type
to target aircraft for some reason, this should prevent CTD.
The addition of the LookAtWrapper interpreter entry to all vehicles is not strictly necessary, but since it hurts nothing I went ahead and put it in. (If you are not familiar with the LookAtWrapper bug, search for it on the BFSP forums. It is well documented)
Ok then, interested parties may
Download it here