After a
lot of tedious checking through and comparing of the BF2 and FH2.25 aircraft + bomb files, and making various changes (none of which worked, until this one), I think I've finally solved the problem. The erratic kamikaze flight of AI bombers and their inability to drop bombs both have the same cause - and it's a really stupid bug, but one which is thankfully very easy to fix.
This is what the cause of the problem appears to be:
- FH2's bomb 3D models (the German ones, at least) are modelled back-to-front (no idea why)
- As a simple fix for this, the "dummy" bomb models (which also act as launch points for the actual dropped bomb projectiles) attached to aircraft are rotated 180 degrees.
- This doesn't affect the bomb aiming or dropping physics, but DOES affect AI bots attempting to use the bombs. It completely messes up their aiming + targeting AI, so they not only can't drop bombs, but inevitably end up crashing their plane in a futile attempt to aim the bombs at ground targets
To fix the issue, open the .tweak file for a bomber, and where you find the code which adds the "dummy" bomb models, for example:
ObjectTemplate.addTemplate sc500_dummy
ObjectTemplate.setPosition 5.18669/-0.553727/2.59724
ObjectTemplate.setRotation 180/0/0
- add "rem " to the beginning of the ObjectTemplate.setRotation line. Do this for all the dummy bombs attached to the aircraft.
The German SC50, 250 and 500 (which are also used by the British Hurricane and Beaufighter) definitely have this problem. I haven't yet tested whether the US bombs (on the P-51 and P-47) have the same issue.
The one problem with this fix is that the visible bombs on aircraft models are now back-to-front! One way to fix this could be to add invisible (and non-rotated) bomb-launching "hardpoints" at the same location as the bomb models, and keep the 180-degree rotation for the bomb models. I'll try this idea out soon.
When I made this change (not really expecting it to do anything) and started up FH2, I knew it had worked before I even saw an AI plane, as I got multiple Ju87 and Beaufighter kill messages within a minute of loading El Alamein
Working AI bombers seems to make a big difference to how SP games play out, AI ground vehicles tend to have a hard time attacking defended positions and AT guns. I suspect it'll make a particular difference on maps like Siege of Tobruk and Invasion of Crete where the Germans rely on aircraft as their "artillery" and the Allies don't have any fighters to defend with.
Some notes on the bomber AI:
- They're quite aggressive attacking with bombs and will drop them quite accurately, though possibly not as accurately as in vanilla BF2 (this may be because of the additional "deviation" inaccuracy I added to the bomb AI files)
- Bots never run out of bombs, just like in BF1. I'm guessing the AI is hard-coded to never run out of ammo for weapons.
- For the above reason, they never seem to strafe with their guns - bombs have a higher AI strength, and they never run out, so no reason to ever use guns. Not a huge problem with the Stuka, but more so for the Allied fighter-bombers which have a lot more firepower. I'm not sure if this is fixable, giving the guns a higher AI strength than bombs would probably mean they don't use bombs at all - but I'll try it out anyway.
- The Stuka doesn't dive-bomb its targets (the previous "diving" behavious was just a bug caused by the reversed bombs), and I'm not sure if it's possible to get the AI to use the dive siren, but, again, I'll try all the same.