Author Topic: AI tweak/fix mini-mod v1.0 ready for download  (Read 7858 times)

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
AI tweak/fix mini-mod v1.0 ready for download
« on: 05-02-2010, 17:02:28 »
DOWNLOAD LINK (v1.0)

I think I've playtested it enough now to make sure that the AI is still working correctly, so here's the first version of my SP AI tweak mini-mod for FH2 2.25.

From the readme.txt:

Quote
FIXES:
- Bots now aim and fire AT guns and mortars.
- Fixed the error with the the Sherman roof-mounted MG which caused the "Luttich" map to crash in SP mode.
- Tank HE shell min/max ranges are now consistent with those for AP shells.
- US 57mm and 76mm AT guns now have the correct AI files for mobile and static versions.
- Disabled AI use of AT mines (bots don't know how to use them correctly, so just get themselves killed charging enemy tanks)
- All open crew positions on vehicles and guns now have the "exposed soldier" setting so the AI will fire MGs and small arms at them.

CHANGES, TWEAKS + ADDITIONS:
- Completely revised the weapon AI data for all vehicle and AT gun/artillery weapons. Vehicles will (most of the time) use both MGs and shells against infantry targets and guns, and will prioritise AP, HE and special AP shells for different target types. Bots manning hull and cupola MG mounts will fire at their targets more reliably,
- Adjusted the AI data for infantry weapons. Changes to "small arms" (rifles, SMGs, MGs etc.) are minimal, but AT weapons (including grenades and explosive charges) have been tweaked significantly.
- Aircraft will strafe ground targets more, and (except for the Hurricane IID) will prioritise infantry and light vehicles. Still can't get them to drop bombs, though.
- Adjusted the "strategic strength" and "temperature" values in vehicle AI files, so bots are more likely to select vehicles and crew positions based on their effectiveness.
- Bots will avoid using (unarmed) passenger + tank rider positions on vehicles - they rarely know how to use these effectively, or when to get out, making them deathtraps.
- Bots will not attempt to move mobile AT guns (other than turning them in place) - as they don't really understand how to use mobile guns properly (treating them like extremely slow tanks).
- Bots will now fly spotter planes (they don't know how to use the artillery spotting ability, but the "radar" effect is useful for the player)
- Added unique AI files for vehicle + gun types that were either missing them completely (e.g. Cromwell, Churchill) or which used AI files from another vehicle of the same basic type but different function (e.g Opel Blitz Flak, SdKfz.251/10)
- Vehicles (and other PCOs) of the same basic type (e.g. all Sherman variants other than the Firefly and M4A1/76mm) now share object and weapon AI files. Static and mobile versions of AT guns now also share weapon AI files, though they have seperate object AI files.

KNOWN PROBLEMS (other than the usual BF2 AI issues, and pathfinding issues - such as tanks getting stuck and aircraft crashing into the ground - which are dependent on map scripting)
- Aircraft don't use bombs/rockets, despite all my attempts at getting them to do so. Maybe in the next version...
- Bots don't use static artillery (25pdr, LeFH18, US 105mm, Nebelwerfer) - although they will use emplaced mortars.
- Bots rarely seem to use static defensive MG positions.
- Bots don't fire certain vehicle gun positions (such as the Vickers .303 on the LRDG Chevy, and the rear MG34 on the SdKfz.251) although they will man them.
- The "Goodwood" map still crashes after around 15-20 minutes.

Now I've got a basic playable version out, I'll work on more AI fixes for the next version - including artillery, aircraft bombs and radio commands (no guarantees I'll be able to get any of these to work, but I can try!)

Offline Zoologic

  • Masterspammer
  • ****
  • Posts: 4.141
  • In FH Since 0.67
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #1 on: 05-02-2010, 18:02:58 »
Cool, i'm downloading and will give feedback soon.

I hope Winterhilf and Legion see this too.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #2 on: 05-02-2010, 19:02:13 »
*As Jumjum would've said in this instance*
Huzzah!

Thanks alot for this... Mortars?! Did I hear mortars?! DLing now and will give feedback...erm, I think I'm going to have to bottle the acid about this one though...

You just made my weekend, man!



Offline Zoologic

  • Masterspammer
  • ****
  • Posts: 4.141
  • In FH Since 0.67
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #3 on: 05-02-2010, 19:02:33 »
Tried a few hours.

First thing, map tested: Luettich (crashed, not AI related, perhaps map related), Aberdeen (crashed, same reason), El-Alamein (fine).

On Luettich i noticed that the tanks are very active, except a few sound effect glitches that were present since FH2.25. The infantry explores every corner of the map, including the bocage! Finally see some good fights there. Also, the American brought their tanks in from the first!

On Aberdeen, it is intense tank battle. They fire from long range, almost barely visible. But it is cool, and i like it. Getting surprised by 2 Pdr gunner. Now i see that bots don't easily jump on Chevy's bunk, Chevies are mostly manned by 2-3 men, all manning gunner or driver positions.

On El-Al... AA-guns work perfectly! I was pwned by their FlaK 88!!! The Vierlings are even deadlier. Also, i noticed that the AT guns are also very active, giving you more challenge. Also, mortars! When we raided the German positions, i was greeted with explosions which noises are previously unfamiliar... it was the mortar shell landing around us! Cool!

One thing i see to be added to your list:

-Looks like 20mm gunned vehicles don't fire their weapon (Panzer II and SdKfz.222), they just point the cannon but don't shoot at all. Saw this on Aberdeen and El Al.
-Some of the bots in El Al stuck inside several tent spawn points, a recurring problem, i saw this on Bardia, Giarabub, any map with spawn point inside a tent.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #4 on: 05-02-2010, 22:02:16 »
My conclusion: Quite interesting

The Good
1/ AT guns and tanks fire from slightly further off than in 2.25
2/ The patch is so simple to apply, it defies BF2's supposed-not-to-have-been modability
3/ Bots certainly don't just jump on AT guns, but they use them quite effectively
4/ German tanks are as deadly to allied tanks as the other way round. We, the Germans held the Brits in Goodwood at their start base once we did a counter-attack and took Cagney eyc
5/ LOVE the way the Marder I maneuvers. as it doesn't have a turret, it doesn't allow its side to face the enemy, but turns corners sharply to keep its edge
6/ Mortars! Morars! WTF, Mortars! However, they don't seem to fire at really long range or really close range, but tend to fire within some distance and then, once the enemy is closer (But still within their range), they stop. In Alamein it was cool - But for some reason, they didn't fire in Tobruk
7/ Firing at humans on vehicles
8/ Non-movable mobile AT guns.. genius!
9/ The semovent is ALIVE!
10/ Tiger seems alot more maneuverable, hardlyh showing is back to the enemy
11/ Had an mg42 bipod gunner prone and fire at range.. but I think he was attacking those close to him and simply decided to pick of others further off afterwards - Still, was great to see it for the first time
12/ Hope that tanks can fire all their salvo - HE, AP and mg
13/ PzII fires more frequently, especially from range, but like always, stops firing altogether when right next to the enemy
14/ Bot infantry are quite agressive, almost conscious of player orders like move here....

The bad
1/ Bots still stick to mobile vehicles without ever bailing - Even trucks and APCs... and so that top mg issue in Luttich with the Axis jumping into the mg position atop the Panther still occurs
2/ Bots don't seem to know what each shell type is for. Sure they fire HE, AP and mg, but they fire AP and maybe mg more at infantry - Infact, the least thing they do use is HE on infantry, even less so that in the original 2.25 ai
3/ AT guns without AP still try to fire at infantry
4/ Don't think tanks use Capped AP - We still have the Valentine and Matilda in Sidi Rezegh pushing us all the way back to the main German base without the taking a single damaging hit, which should be if they used capped AP - They only use HE accidentally when firing at other tanks
5/ Now planes use mg on ground targets, which is so innacurate and thanks to BF2's hit detection of little consequence - You might want to keep them using HE on infantry and lightly armored vehicles - mg should only be used for ranging fire at enemy planes, and the Stuka should NOT engage other planes
6/ Now the Stuka flies like a turkey again as per 2.15
7/ bots don't even use the mgs they used to such as the Vikers and Mg15
8/ Marmon Herrington doesn't attack infantry anymore

The wierd
1/ PZ11 fires at planes with its main gun
2/ Allies with semi-auto fire their guns as fast as full auto and smgs! they fire the G43, M1 and M1A1 as fast the frigging thomson?
3/ AT rocket infantry (All of them) fire from way to far - Had a zookman firing from one end of Mortain to the other... even out of view

Hopes for the next update
/Restored aircraft firing HE
/Stuka strafing, using divehorn and planes dropping bombs and rockets
/Tanks firing HE at AT infantry and lightly armored vehicles, mg at other infantry, AP at other tanks, capped AP at heavier tanks, He or mg at AT guns, not AP
/Tanks not closing all the way in
/AT guns with HE using them on infantry
/ Howitzers
/ Mobile vehicle mounters being able to switch from gun to driver(when without driver), driver to gun (when attacked), bailing once close to destination (For any other position)
/Germans using the gabelt ladung or switching their kits with the gabelt grenade



hey, thanks for the mod - It certainly adds quite a bit - Just loving Goodwood now.... :-)

« Last Edit: 05-02-2010, 22:02:39 by djinn »

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #5 on: 06-02-2010, 04:02:39 »
Awesome...

Can't try it 'til later, but I posted the link over on BFSP (hope ya don't mind) so more people will get to reap the benefits of your hard work... :)

 - http://www.battlefieldsingleplayer.com/forum/index.php?showtopic=14805

Offline Zoologic

  • Masterspammer
  • ****
  • Posts: 4.141
  • In FH Since 0.67
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #6 on: 06-02-2010, 06:02:40 »
Strange djinn, it is quite the opposite in my PC, although some issues you mentioned do occur sometimes.

The Good
1/ AT guns and tanks fire from slightly further off than in 2.25
2/ The patch is so simple to apply, it defies BF2's supposed-not-to-have-been modability
3/ Bots certainly don't just jump on AT guns, but they use them quite effectively
4/ German tanks are as deadly to allied tanks as the other way round. We, the Germans held the Brits in Goodwood at their start base once we did a counter-attack and took Cagney eyc
5/ LOVE the way the Marder I maneuvers. as it doesn't have a turret, it doesn't allow its side to face the enemy, but turns corners sharply to keep its edge

Agreed! Exactly what I observed.

Quote
6/ Mortars! Morars! WTF, Mortars! However, they don't seem to fire at really long range or really close range, but tend to fire within some distance and then, once the enemy is closer (But still within their range), they stop. In Alamein it was cool - But for some reason, they didn't fire in Tobruk

It is fine that way djinn... because the mortar lags (it projectile has to travel upward first then downwards, there is a slight lag time in that). So up close, it wasn't too effective. And also, i think the bots must see their opponents first before making a decision to fire (be it visual or on radar, sadly FH2 disables enemy viewing from radar/compass)

Quote
7/ Firing at humans on vehicles
8/ Non-movable mobile AT guns.. genius!
9/ The semovente is ALIVE!
10/ Tiger seems alot more maneuverable, hardlyh showing is back to the enemy

Same thing here.

Quote
11/ Had an mg42 bipod gunner prone and fire at range.. but I think he was attacking those close to him and simply decided to pick of others further off afterwards - Still, was great to see it for the first time

Yeah, i was pwned by one, in Luettich, one German bot slipped of my sight when he went prone and start spraying bullets to my position.

Quote
12/ Hope that tanks can fire all their salvo - HE, AP and mg

I saw them firing all, including Special AP rounds (High Velocity, Reinforced Penetrators). Because in Tobruk a Pz4D successfully scratched my Matilda! Because i know, their regular AP rounds fired from that short barrel cannons won't do it. Only HEAT rounds (their special AP) can.

Quote
13/ PzII fires more frequently, especially from range, but like always, stops firing altogether when right next to the enemy
14/ Bot infantry are quite agressive, almost conscious of player orders like move here....

Strange, PzII on me don't fire at all (hardly any kill message using PzII or SdKfz 222 noticed). They used to be quite deadly for infantries back in FH2.2 default.

And yes, bot is very aggressive, i saw no bots camping.

Quote
The bad
1/ Bots still stick to mobile vehicles without ever bailing - Even trucks and APCs... and so that top mg issue in Luttich with the Axis jumping into the mg position atop the Panther still occurs

In vehicles, it looks like they prefer the gun position more. When the driver bails, the machine gunners stayed and become sitting ducks.

Quote
2/ Bots don't seem to know what each shell type is for. Sure they fire HE, AP and mg, but they fire AP and maybe mg more at infantry - Infact, the least thing they do use is HE on infantry, even less so that in the original 2.25 ai
Quote

Haven't noticed this yet, but they do fire HE rounds at me most of the times, their MG spray is quite sporadic too.

Quote
3/ AT guns without AP still try to fire at infantry

True, especially British AT guns... but can't expect more, at least there is some boom boom boom around  ;D

Quote
4/ Don't think tanks use Capped AP - We still have the Valentine and Matilda in Sidi Rezegh pushing us all the way back to the main German base without the taking a single damaging hit, which should be if they used capped AP - They only use HE accidentally when firing at other tanks

I would blame that on Sidi's map design. It is designed in more MP in mind and less SP thought. In El Al, my Matilda can still be the queen of the battle, but when the Flak18 gunners spotted me, i too have to dodge every of those killer rounds. (and they are very freakin accurate, they even shoot down planes using that, human players have difficulties doing that).

And in Tobruk like i mentioned before, the Panzer 4 D (short barrel) scratched my Matilda (yeah, the HEAT rounds can only do that, at most 1/3 or 1/2 of the health bar), but the driver didn't do more than that before misfiring more precious rounds and getting killed by my uber-human skillz.

Quote
5/ Now planes use mg on ground targets, which is so innacurate and thanks to BF2's hit detection of little consequence - You might want to keep them using HE on infantry and lightly armored vehicles - mg should only be used for ranging fire at enemy planes, and the Stuka should NOT engage other planes
6/ Now the Stuka flies like a turkey again as per 2.15
7/ bots don't even use the mgs they used to such as the Vikers and Mg15

Same problem here. I don't know, the bots used to bomb us back in early FH2. Might be the problem with later BF2 patches breaking the AI code, not FH2 specific.

Quote
8/ Marmon Herrington doesn't attack infantry anymore

They FIRE AT PLANES!!! OMG. At least i saw that.

Quote
The wierd
1/ PZ11 fires at planes with its main gun

Not only PzII, Marmon Herrington, Sdkfz 222 too.

Quote
2/ Allies with semi-auto fire their guns as fast as full auto and smgs! they fire the G43, M1 and M1A1 as fast the frigging thomson?

Maybe sound engine error? Because sound from very far away can be heard as if it was next to you, producing interloping sounds. I faced bots in Luettich one-on-one with many different weapons and they all seemed normal to me (firing the rifles slowly, spraying MGs and SMGs, and train semi-auto weapons).

Quote
3/ AT rocket infantry (All of them) fire from way to far - Had a zookman firing from one end of Mortain to the other... even out of view

Same thing here, very frustrating.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #7 on: 06-02-2010, 09:02:27 »
Yer, I'm sure infantry are too 'comfortable' with their guns now. The M1A1 carbine fires way too fast in Luttch, not to sure about the other 2 maps they are in since my PC lags like crazy in those and both Garand and G43 also fire just as fast - No sound issue, I watched the smoke and head the pings as they landed close to me

And yes, tanks only seem to fire accidental HE at other tanks. Tried Mersa which is the bastard child for any SP-attempt i.e. if SP worked well, Mersa Matru would play alright, but every little issue would show in full colour. It did! Tanks never fired HE at infantry even when swarmed with them- Didn't even see them fire mgs.

Final issue I noted was that AT-mine bots still charge tanks with their wares and try to plant them.


* A tip for all SP-devs... official or fan. If something works right, please don't modify it further, focus on the things that DON'T work. Every iteration of SP seems to bring its own issues which arre fixed only after a couple of versions, it seems. So progress is hard to quantify
« Last Edit: 06-02-2010, 10:02:49 by djinn »

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #8 on: 06-02-2010, 13:02:19 »
I've only played one full round of El Al. so far...tried Goodwood twice and CTD twice within 5 minutes of the round starting...

Quote
Non-movable mobile AT guns...
I have to disagree on this one. They need to be able to at least rotate them, but AFAIK to do that they would have to be turned into stationary guns due to different controls.

We lost Mit. Ridge because a bot on the 6 pdr. couldn't rotate the extra 10-15 degrees needed to bring the Panzer capping the flag into his sights. ::)

The other things I noticed were the bots like the Flak38 and love the Marmon...had a bot bail out of the driver's seat of a Chevy so he could get to it... ;D


Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #9 on: 06-02-2010, 16:02:12 »
Wierd about the movable AT gun... I've seen bots do a 180degree with it in Goodwood

Yer, Goodwood CTDed for me too... about 5minutes I think... but it doesn't or does after 20 or more minutes if I play as German ... wierd

AND I'm getting that issue with Germans spawning in the top floor of the marder base which I thought was altogether removed! AND worse, no tanks for the Germans! Like I did with 2.2 once upon a time

It happened after I felt I was getting too much lag, so I reinstalled FH2. Simply put, Deleted FH2 folder after not finding an unistaller, deleted the FH2 folder from my documents' Battlefield 2 folder, reinstalled FH2.2, pathched up to 2.25, applied patch... got in, and realized the issues which weren't there before reinstalling...

And the last time it occured, it didn't quit till I reinstalled my PC :-( wHHy.. Just when Goodwood got good

@ Cannonfodder
A bot bailed? Never seen that since 2.25.. or even 2.2, come to think of it, save for stationary guns

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #10 on: 06-02-2010, 19:02:41 »
Thanks to all for the comments, criticism and suggestions. I'll hopefully be able to fix/improve some of the issues in future versions.

A few things I ought to mention first:

- The mod doesn't (currently) change any of the basic AI scripts, or the AI scripts and pathfinding for maps. It only affects the AI data for vehicles and weapons.
- There are also absolutely no changes to weapon or vehicle data (damage, fire rate, vehicle handling, etc.)
- Most of the issues mentioned are not caused by deliberate changes made in the mod. Some of them are problems found in the default FH2.25 AI which haven't been fixed, and others (such as the AI not using MGs, and the extreme range of bazooka/panzerschreck bots) seem to occur despite changing the data for the opposite effect.
Other issues - such as the behaviour of infantry bots - may be caused by changes to one area of the AI data causing subtle (unintended) changes to other aspects of the AI. The BF/BF2 AI system seems to be so complex and buggy/glitchy (presumably as DICE didn't put nearly as much effort into developing and troubleshooting it as with other aspects of the game engine) that it can be very hard to predict how the bots will behave, regardless of what the AI data files tell them to do!

I'll attempt to answer some of the individual issues here:

Bots not bailing from vehicles or changing crew positions: this issue was present in the default FH2 2.25 AI (referred to as "default values", "default FH2" etc. below), I've made a partial fix for it by giving passenger seats + tank rider positions a very low priority for the AI, so they rarely bother using them. The "vanilla" BF2 bots seem to know how to use APCs, transport helicopters, etc. properly - so hopefully this issue will be properly fixable in future, either by me or a more experienced AI modder.

Tank shell use: I've tried my best here, not sure if it's possible to improve this aspect of the AI or whether the BF2 AI just isn't capable of intelligently selecting different armament types for the same weapon (which weren't, IIRC, a feature in vanilla BF2). 
For the AI "strength" values in weapons.ai, I've set AP shells to have a high priority vs. tanks, medium priority vs. light armour (guns, trucks, APCs) and low vs. infantry. HE very high vs. infantry and light armour, very low vs. tanks, APC/APDS/HEAT very high vs. tanks, very low vs. everything else, Canister very high vs. infantry, very low vs. everything else.
However, the AI's selection of shell types seems to be very haphazard/random at best. I've sometimes been shot at with HE when on foot or manning a gun, but at least as often with AP (to be fair, the bots are pretty good at killing AT guns with only AP shells). For now I'm just happy that (unlike default FH2, most of the time) they do use multiple shell types, and will (sometimes) fire at infantry + guns with both MGs and shells at the same time!

AT guns firing AP rounds at infantry: I'll definitely fix this, setting the "strength" value for non-HE shells to 0 vs. infantry should do the trick. AT guns definitely shouldn't waste time and ammo firing at targets that they have almost no chance of hitting, especially when this might mean they don't notice more important targets!

Tanks with 20mm not firing: Never noticed this myself, I've been killed by these (and the Fiat L6/40) plenty of times, in tanks, on foot and manning AT guns. The behaviour and aggressiveness/awareness of AI tanks does seem to be very variable though, even on the same map.
Regarding the Pz.II not firing at close range, this is probably because of the minimum range value, which I set to 2 or 2.5 (less than the default FH2 which is 10), I'll try reducing it to 0.5 or even 0 for non-HE shells.

Vehicles firing at aircraft: This is intentional - light vehicles with fast-firing weapons have their "anti-aircraft" value in objects.ai set to 2, which, according to what I've read on BF2 AI coding, means that they'll take "opportunity" shots at planes that fly into their field of view, but won't actively chase after and track them (as they would if you set it to 1). I've shot down quite a few planes with PzIIs and Marmon-Herringtons myself, so it seems only fair that the AI gets a chance to do the same!
This isn't a new idea/addition of my own: a number of vehicles in default FH 2.25 have this setting (including those with heavier guns, not very practical for AA), I just made it consistent (all heavier tanks have the anti-aircraft value set to 0)

Marmon-Herrington AC not firing at infantry: I'll look into this, there definitely seem to be some AI issues with this vehicle - even in default FH2 it tended to drive around not firing at anything. I've definitely seen it fire at tanks.

Bots not using stationary MGs: This is one issue that's really annoying me and I still haven't worked out why it's happening - the AI's use of AT guns is very good, but they still don't seem to understand MGs. I've given all stationary MGs high "temperatures" (which affect how likely the bots are to use vehicles and other PCOs) as well as the highest possible defensive "strategic strength", and have also given the actual MG weapons a very high strength vs. infantry in their weapons.ai files.
I have to say that I very rarely saw bots using stationary MGs in default FH2 - but whether or not my mod has made things worse, it certainly hasn't made them better! I'd really appreciate any advice from more experienced AI modders.

Bazooka/panzerschreck ranges: I noticed this too (the fog in Luttich makes it particularly noticeable). I've set the AI maximum range for these weapons to be substantially LOWER than the default values, so I'm not sure why this happens. It may be because the default minimum ranges for these weapons were so high that bots rarely used them, making the issue less noticeable.
Lowering the maximum range even more should help. What was the real-life effective range of the bazooka, panzerschreck and PIAT considered to be?

Semi-auto rifle fire rate: Seems weird, I'll definitely look into this. I haven't intentionally changed any of the rifle values, other than a few tweaks to the min/max range. Currently I haven't changed the AI data for any small arms much - only tweaking the min/max ranges and in some cases adding an "effective range" value so that bots are more likely to close in with weapons like SMGs and pistols.

Bot use of AT mines and grenades/charges: All AT/AP mines now have AI strength for all weapons set to "0" which should prevent bots from using them, certainly I haven't seen the "engineer mine charge" since changing this. I've changed the AI data for AT charges and grenades (e.g Geballte Ladung, sticky bomb) so the bots should be able to use them (previously, the min/max ranges made it very hard for them to do so) and I've certainly seen occasional kill messages for AT grenades and satchels.
Another issue is that there are still far too many AT bots around, even on infantry-only maps! I'm not sure if bot kit selection is alterable, or if it's random/hard-coded.

Aircraft strafing: I agree that planes (other than the Hurricane IID) definitely shouldn't strafe tanks with their cannons, they can't do any damage even if they hit anything. This will be easy enough to fix by setting the AI strength of their guns to 0 vs. heavy armour. IMHO strafing of infantry and light armour/soft targets (AT guns, trucks, jeeps + APCs) should be kept in, especially with 20/30mm guns (even strafing with MGs can kill exposed gun + vehicle crew)
Unfortunatly, lightly armoured vehicles like the Vickers Mk.VI and SdKfz.222, which heavier aircraft guns might have a chance of hurting, are still classed as "heavy armour" so there's no way to allow planes to attack these without also having them strafe heavier vehicles that are immune to their fire.

Aircraft bombing, Ju87 behaviour: I haven't yet worked out how to get AI planes to drop bombs. The odd behaviour of the Stuka (crashing into scenery, kamikaze dives) appeared to be just as bad in default FH2 - again, I yet haven't looked into why this is happening. The issue of the Stuka dogfighting with enemy planes will probably be less noticeable when/if it can use its bombs (so the AI can pay more attention to ground targets). I haven't changed the performance/handling data for the Stuka or any other planes, the only changes are to the gun + bomb AI data.
Bots are lethal with aircraft bombs in vanilla BF2, so this issue should be fixable. It hasn't been broken by a BF2 patch, either - I have BF2 patched to the latest version and regularly get bombed by AI aircraft, though they don't understand the TV-guided missiles (not a problem for FH2!)

Mobile AT gun issues:
I've set them to be rotateable but immobile (in objects.ai - doesn't affect player control of the gun, only bots), so far I haven't seen any problems. Bots seem to be able to rotate them in place, the same as with static guns. But the AI's behaviour does seem to be very variable!

Radio/map commands: I haven't made any attempts at fixing this area of the AI yet, and have only just started looking into it. I'm hoping to eventually get the ability to command bots closer to how it was in vanilla BF2; I'm guessing the main cause of the problem is that when the "comm rose" was replaced, the FH2 developers didn't add the AI trigger commands into the scripts for the new radio comm interface.

Mersa Matruh, and general AI map issues: This is definitely one of the more "broken" maps AI-wise (though maybe not as bad as Supercharge where the Allied AI seems to be unable to understand how to get into the walled town that's the main German base). But my experience with Mersa Matruh (playing as the Allies) seems to be the opposite of djinn's. The German tanks all park on top of the hill overlooking the town and "snipe" anything they can see, on foot or in a vehicle, using both HE and AP! Deadly as this is, it still isn't very effective in the long run as most of the tanks don't go in to cap flags (even the railway station) and they eventually get picked off by the few Allied tanks + AT guns that manage to avoid getting sniped.

One persistent issue I've noticed in a lot of maps is the "traffic jam" where multiple stationary tanks and vehicles sit in a group, usually in between their base and an enemy's, and often in a position where they can't fire at anything. This ties up a lot of bots and vehicles that could otherwise be fighting and capturing CPs, and would make a very good target for bombers if the AI actually knew how to drop bombs! I suspect this is purely a map AI scripting/navmesh issue and changing the basic AI will have no effect.

Anyway, I hope this has answered some of your questions -even if it ended up as a (very) long post.


9/ The semovent is ALIVE!
10/ Tiger seems alot more maneuverable, hardlyh showing is back to the enemy

What maps are the Semovente and Tiger on? I assume there's a Tiger on Goodwood, but I've never played long enough (due to crashes) to see one. The only Italian vehicle I've seen is the Fiat L6/40.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #11 on: 06-02-2010, 22:02:47 »
You should go over to the battlefield Singleplayer forum and download the FH mod made for 2.15 by Redsand and WinterHilf, before he was an official developer of FH2.

It has maps not in - Still in various levels of beta, like Alam Halfa, Gazala (Where the semoventes are) and Bardia. Actually every single one of the North African maps, save for Mareth have ai if you include this mod... You might want to take out the maps from the stock minimod though and incorporate them directly as I'm not too sure it will work for 2.25... Goodwood has a Tiger I, not the Tiger II that is in Conquest, sadly, but it still pwns now.

Here's the link:
http://www.battlefieldsingleplayer.com/forum/index.php?s=0e86bbfe119e260b8255f169e4bbcff9&showtopic=13215&st=0&start=0

Thansk for the feedback... Just tried Luttich which is an excellent mod save for AT-rangers and no HE... Would really be an epic map if the AI commander for this map (Not a bot issue I imagine) will command his troops out into the field. Played it for a good 30minutes, excited about everything until the Germans got all the bases and parked like 3 or 4 tanks in the town of Mortain and the game came to an almost stand-still.

I don't know why tanks seem to prefer firing HE and AP at other tanks and rarely mg and more often AP at infantry, but it may also have to do with the buggy code of BF2... I actually saw a Stuart firing cannister at an APC... it killed the APC, but I don't think that's what it was trying to fire... 88s have the same issue as do AT guns.. they are more likely to fire HE at a tank or AT gun than at infantry.

There is something nice about the randomness of an HE shell fired at a tank, but not firing HE EVER at infantry. and especially coax-mg really makes FH2.25 a bit depressing for me

The Stuka DID kamikazi in 2.2, but this was fixed in 2.25, I believe by given the Stuka a fighter-plane ai template. It fly well, but a tad too low, making it easy prey to AA guns... but it strafed, which was kewl... Maybe a modification of that ai to make it fly alot higher and whatever miracle you figure out for the bombs would make it fly more like a real Stuka should...

This one is a big favor... Please, pleas, pretty-please try to see if you can get the Stuka using the divehorn once it sees enemy units and decides to attack.... that will be tres cool. I know planes used ot use (they may still use) airbrakes, which is the same key, so I'm hoping its doable...


Offline Zoologic

  • Masterspammer
  • ****
  • Posts: 4.141
  • In FH Since 0.67
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #12 on: 07-02-2010, 06:02:44 »
I played Fall of Tobruk yesterday, and yes, the Panzer II is active now. They fired HE shells at my hiding position.

But it looks like they won't fire into Shermans and Matildas back in El Al (it is useless anyway, since PzIIs can't scratch them).

BTW, divehorns i think should be the least priority. But it is cool to have too, by default, it uses afterburner keys (left shift). I hope you can work on this.

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #13 on: 07-02-2010, 20:02:04 »
Thanks for the link to the SP mod! I didn't realise this was available. So the maps will still work with FH2.25 if you take them out of the mod? (I'm not going to attempt running the mod itself, even if it runs with 2.25 there'll probably be compatibility issues). 

The Stuka is really odd... I haven't changed anything in the Stuka files other than the weapon data and the AI temperature/strategic strengths. And I distinctly remember seeing it do its kamikaze nosedive on Tobruk and Mersa Matruh before I made any attempt at modding FH2.

But I haven't really made any serious attempt to mod/fix the planes yet, now tanks are working reasonably well (other than the shell usage issue) I'm going to pay more attention to the planes. I'm not sure what it is in the Stuka files that trigger its diving behaviour (other planes don't do this) nor what it is that prevents AI planes from dropping bombs, when in vanilla BF2 they can do so very accurately!
What I'll do first is compare the Stuka .tweak and .ai files with those from another plane (e.g Hurricane) and see exactly what the differences are. If I can get the Stuka to fly properly, I'll then do the same thing comparing the weapon data for bombs in FH2 to that in the vanilla BF2 files. I'll also definitely see if I can get the divehorns working, though I definitely don't guarantee it!

The inconsistency with tanks using their coax MGs is also really annoying me. Sometimes they use them readily, other times they only fire shells. I wonder if AI behaviour is influenced partly by things like the map layout, pathfinding, whether the bots are attacking or defending, etc.? How BF2's bots behave seems to be often completely unrelated to what the .ai files are actually telling them to do.

BTW, I followed (in another Stuka) an AI Stuka on Mersa Matruh to see exactly what it did; it took off, climbed to a fairly high altitude, flew level until it reached the railway station CP, then nosedived straight into the enclosed compound where the Crusader + truck spawn.  On other maps (like Tobruk) the Stukas seem to die more often from flying so low that they run into hills, rather than by diving straight into the ground. (This is another thing that made me wonder how much the AI behaviour was influenced by the map)

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #14 on: 09-02-2010, 10:02:31 »
On El Alamein, I noticed the Beaufighter diving toward the ground (next to Mit. Ridge on the German side) as if he was trying to bomb someone, but he dropped no bombs. He circled around and dived at nearly the same spot again, coming so close to the ground that if there was a vehicle there, he would have slammed into it. On the fourth dive he hit the ridge.

The next round, I waited in a Spitfire and followed the Beau...he gets halfway to the Ridge, banks left and dives at the ground. When he pulled back up, he banked right 'til he'd pulled just over a 180-turn, flew straight for a bit, then banked left and dove...

I was following, watching him do this for a minute or so when it dawns on me...he's flying in a big figure 8!!! Which he did for almost five minutes before I got sick of tailing him...::)

Watching the Stuka, it looks to me like it's trying to pull out of it's dive just before it hits the deck.

As for the sirens...don't hold your breath, I don't think BF2 bot pilots use the afterburners (do they?) and I know the bots in AIX won't use the over-boost on Clive's WW2 planes (activated by the sprint key).


EDIT: After another round, the Beau was doing the same thing (the diving) but was turning left or right at random, not left-right-left-right (figure-8's)...maybe the bot in other round got stuck in a loop... :-\
« Last Edit: 09-02-2010, 12:02:53 by cannonfodder »