Author Topic: AI tweak/fix mini-mod v1.1  (Read 10027 times)

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
AI tweak/fix mini-mod v1.1
« on: 06-03-2010, 22:03:40 »
DOWNLOAD LINK
(updated 7/3: fixed incorrect Stuka weapon priorities)

(I thought I'd better create a new thread for this version, as the old one has got to 4 pages now)

This is more or less a "beta" version, as I haven't tested every map extensively and have encountered a few CTDs on some maps (not the usual suspects like Goodwood 64), I'll probably release another, more polished version in the near future. But there are so many fixes in this version compared to the last that I thought I ought to get it out sooner rather than later, particularly for any FH2 SP players who don't have the modding abilities to fix the AT gun + bomber bugs (the two most important changes) themselves.

Here's what's new in this version:

Quote
- Bots can now use bomber aircraft effectively (and drop bombs!).
- Fighter aircraft will (theoretically at least) fire MGs at long range and cannons at short range.
- Tanks with HE shells will not fire AP shells at infantry, and AT guns without HE shells won't fire at infantry at all.
- Further tweaks to tank shell type and co-axial MG use.
- Greatly reduced the minimum range for tank guns.
- Fixed the Chevrolet Vickers MG not firing, and corrected the min/max aiming angles for some other vehicles.
- Limited the AI fire rate for semi-automatic rifles and pistols (so they can't fire faster than a human player)
- Many more minor tweaks to vehicle and infantry weapon AI data.
- Altered the maximum audibility distance for some weapon sounds for greater consistency. Not an AI fix, but something I thought was worth fixing - with the default data, some weapons are audible from halfway across the map whilst others (of the same type)
- Fixed the sound looping bug with the 2-pounder AT gun (ditto)

I'd definitely appreciate any feedback on errors, crashes (particularly any map-related CTDs that don't occur with un-modded FH2.25) and other issues. There are some areas, like AT charges + grenades, that I'm currently working on, and may still not be working properly.
« Last Edit: 07-03-2010, 18:03:17 by Drawde »

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #1 on: 06-03-2010, 22:03:41 »
Wohoo! I was actually expecting this in 'a couple of days'! Something to freshen my FH2 experience

Don't worry Drawde, ol' chap. You gotz 'ere the finest set of BTs you can find - And you can count on us. We'll iron out them creases fur ya! *Informal salute*

Offline Stylo

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #2 on: 07-03-2010, 04:03:20 »
Downloaded it, played a round of Crete 64 and loved it. The improvement on the planes are awesome and the bots are finally, accurately dropping bombs, and it makes a massive difference to gameplay experience. The fix on the 2pnder AT is great, because it use to always get on my nerve hearing it over and over again. You've done some damn fine work overall, Drawde, so I thought I might as well register and say something ;)

Keep up the good work dude, looking forward to future releases.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #3 on: 07-03-2010, 08:03:54 »
Ok so here's what I noted:

Did you reduce the line of sight for the bofers or 88? Its weird, but in PHL, the 88 can now fire at the nebelwerfer base - which is tres cool, but in El Alamein, unless I fired at it with a rifle while within clear LOS, it didn't fire at me at all - and there was no one else there. For tanks, it fires at the same range, but for infantry, you needed to be quite close before it fired. But this is just a descrepancy cuz like I said, in PHL, it fired 'fine'!
Also it took the 88 a while before it saw a plane attacking it and by the time its ready to fire, the plane is well gone i.e LOS reduced? The bofers too - Infact, in Alam Halfa and Alamein which are supposed to be where it thorougly dusts the sky, it was completely silent, while the Stuka bombed the shit out of everything

For AA use, their original values were fine. A plane reqquired real luck or a decoy in order to destroy the AA gunner as should be the case.
Other AAs are fine though

Also, bazookamen still fire as far as they did in the first patch

I haven't yet seen mortar-users drop bombs on infantry either. I only saw it manned a couple of time by the Americans in PHL, but they never fired. In El Alamein, I haven't yet seen it manned to know what it considers as top priority

Planes defintely have reduced LOS. a plane will fly in a straight line until its almost ontop of its target before it glides to aim and fire... usually, rarely getting a hit. Did you reduce their LOS too?

The Stuka doesn't consider AT guns as bomb targets, and infact they are the only thing it uses its mgs on. Perhaps it might be better for it to use mgs on infantry in the open and bombs on concealed infantry (The same situation rifle-grenades are used), but this time, in every event they are concealed, and not just sometimes. For AT guns, however, especially the 6pdr, it really should drop bombs. A 6pdr in Alam Halfa held an entire attack force back while the Stuka tried to strafe it to no avail. It only destroyed it once it dropped a bomb on a Crusader which was right next to it.

For 2pdrs, mgs would be nice, since it doesn't conceal the user that much, same for mg positions and mortar positions.

Still never got to see the nebelwerfer manned so I cannot tell if bots CAN fire the rockets as Witerhilf said (did you include his patch to your build). Perhaps if it was given similar priority to an AT gun, it will be manned more often.

That said,
Now tanks fire HE like in 2.2, which is Sooo welcome
People man all mgs (so far I've only tested with the mg42 bi and tripod and mg15) and use them quite well
The 88 in PHL is heaven
Planes use cannons again
The Stuka doesn't fly off map after dropping 2 bombs, but becomes a real threat unless killed
No more over-repetitive 2pdr sound... couldn't tell about the hanomag mg34 though - has that also been fixed for its repeating sound?
6pdr without HE is silent in the face of infantry till the tanks show up :-)
Tanks seem to move in differently, more cautious, which is nice since they don't run into each other before firing

I saw a boys-rifle man take out a frigging PZIII!
I saw the bots use the never-ever-been used xpack in Luttich.. They do cause stupipd TKs with it by dropping it for no reason, but I'm sure its more of the situation than the tool... kinda like their use of the british charge i.e when they see something, they may forget it isn't smoke


EDIT: Yes, there definitely IS an issue with AA range. it fires at vehicles aggressively, but seldom at aircrafts and tanks with HE or mg could fire alot further. Sure their accuracy wont account for much, but they will be able to keep infantry suppressed. Say, in Seige of Tobruk, a tank should be able to fire HE from the exit way coming from the German base... or in the open area between that and the first line defenses

Also, British mgs and perhaps the American browning .30cal aren't as liked by bots as the German mgs. I deployed a British vikers and no one bothered with it



« Last Edit: 07-03-2010, 09:03:07 by djinn »

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #4 on: 07-03-2010, 11:03:00 »
So far I've only tried El Al, Goodwood-16, and Aberdeen, but no CTD's yet.

The main things I noticed were the bots are using the Geballte Ladung now. I first noticed a few kill messages on El Al, then I was taken out by one on Aberdeen while trying to cap Strongpoint A. The bots definitely need to move further away when they drop one, the bot that killed me was crouched about a tank length from me and was taken out in the blast.

Also, when I tried GW-16, there was no mass TK'ing by the Brits at the start of the round. :)

The other thing was the Chevy's. The bots love the Vickers on the back, and tear-assing around with bots on both guns blasting away is fuckin great fun... 8)

@djinn: Yeah, I thought the AA seemed a bit quiet on El Al...usually the Bofors at the flag on the Brit side of the ridge kicks ass, but I spawned there quite a few times and rarely saw it fire.


Quote
...Still never got to see the nebelwerfer manned so I cannot tell if bots CAN fire the rockets as Witerhilf said (did you include his patch to your build). Perhaps if it was given similar priority to an AT gun, it will be manned more often...
Before I installed this minimod (1.1), I turned the Nebel's basicTemp up to match the 88's and got a bot to man the one on Totalize, but he only fired one rocket (no kill) because there was never any targets close enough. Similar thing on Goodwood, I've seen it fire once and they'll man it eventually (I play SL and sit next to it to speed the process up) but it'll CTD before the Brits get within range.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #5 on: 07-03-2010, 11:03:11 »
Please, please tell me how you increase the temperature...

With what the bots do with the 88 in PHL, I can imagine a battle of artillery at pointblank range...

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #6 on: 07-03-2010, 19:03:51 »

The Stuka doesn't consider AT guns as bomb targets, and infact they are the only thing it uses its mgs on.

Thanks for spotting this bug - it turns out that the Stuka still had the original FH2.25 weapon AI priorities. I recently reverted all the aircraft files to the originals and re-did the changes I made (in an attempt to fix whatever caused the CTDs on Mersa Matruh) and forgot to update the Stuka bomb data.

I've now uploaded a new version of the mod - anyone who downloaded it before 6pm GMT on 7 March should re-download it to fix this issue.


I'm really not sure what's with the Flak 88 and Bofors; the data files for these guns are more or less the same as in the first minimod release, other than some very minor corrections to the max/min gun elevation, and the ability for the Bofors to fire at ground targets (which have a very low priority compared to planes). I haven't made any changes to the LOS of any game objects, in fact I'm not even sure how to do so, if it's possible to (I'd like to -increase- the LOS of some things, like stationary guns and MGs, if I could!) I haven't personally had any problems with AI aircraft not being effective due to LOS - bombers are lethal, capable of taking out tanks and guns with precise accuracy (if you hear the whistle, you're probably dead!) and fighters seem to be quite good at strafing infantry + light vehicles; I've been killed by them several times.

It sounds like quite a few of the issues described are just AI "randomness", bots often don't seem to do what the AI data files tell them to do, and in some games will almost ignore a particular vehicle or gun, and on the next will use it very effectively. This can be seriously frustrating (particularly from a playtesting point of view) but I'm not really sure if it can be fixed. Mortars seem to be particularly prone to this randomness. I assume it's partly because most of them are in positions that have little or no LOS to potential enemy targets. Infantry have the highest priority, followed by light armour (which includes guns)

But a a few things which I might be able to fix/improve: Aircraft preferring MGs/cannons vs. infantry and bombs vs. vehicles + guns is something I'm planning to work on soon, I deliberately didn't put this into the current version as it's something that will require a fair amount of playtesting to make sure that it works correctly.

Bazooka/panzerschreck range is another thing I haven't fixed yet (but will attempt to do soon) for the same reason. As I mentioned in the thread for the first release, I've actually reduced the ranges of these weapons from their default FH2.25 values, so no idea why they seem to be firing farther!

All tank guns (other than light automatic guns like the Pz.II, which are a bit less) have a maximum range of 500, which I think is the hardcoded maximum sight distance for the BF2 AI. Sometimes they'll fire at the limit of this range, sometimes they won't, it seems to be another case of AI "randomness".

The other thing was the Chevy's. The bots love the Vickers on the back, and tear-assing around with bots on both guns blasting away is fuckin great fun... 8)
You're definitely right about that  ;D - even an all-bot crewed Chevy can be deadly, I've even seen them shoot down planes! Bots don't seem to be quite so keen to use the MGs on the SAS Jeep, though...

About the bots killing themselves with AT charges, I temporarily disabled "setExplosionRadius" for these weapons in an attempt to get bots to use them at all - now that they do, I'll try re-enabling it and seeing if they still work. I thought part of the problem with the AI for these weapons might be that their maximum throw range is actually smaller than the explosion radius, so bots never consider it "safe" to use them.

Please, please tell me how you increase the temperature...

The basicTemp value is in the "objects.ai" file for each vehicle. Every crew position has its own temperature. Another thing that affects bot usage of PCOs is setStrategicStrength, the first line (0) is for offence, the second (1) for defence. The bots seem to use the two in combination to decide what PCOs and crew positions to use.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #7 on: 07-03-2010, 20:03:38 »
Thank you, thank you, thank you for the reply and fix....

SP is ba-ack boys!

EDIT: Played El Alamein to see why AA was so 'innactive' and I noticed that what it does is that it seems to be 'day-dreaming' such that the first pass from an enemy plane are almost unnoticed until the plane is over-head. If it wasn't destroyed or targeted, it springs to life and becomes just as active as before - Sometimes however, the difference sometimes too is what feels like a player using the AA with poor reflexes...

I do think the change you made to bofers may have had a negative effect. I still can't explain why planes seem to target ground targets alot later than they used to.... Is it possible to compare values with the stock FH2 and see if there is something different because the Stuka doesn't have this issue; it targets ground targets when using bullets at the same range it always did... Perhaps fighters are using them like they would mgs... at closer range to make sure they get a hit...

Frankly, aircrafts and AA were fine in the stock FH2 save for AA not being anti-personnel.

About the temperature, I opened the file and didn't know where to start. What value would make the nebelwerfer as occupied as say, a PAK40 or 88? If I simply used the same exact values in the PAK40s files, will that do it?

Also I increased the bail-rate from 1, as it was to 3 but I didn't see any significant change in bots NOT bailing from vehicles... What do you suggest as an apprioporate value to make the bail if, say, the vehicle is stuck or the driver is not in and they are idle?

Oh and btw, I saw the bots use boys rifles to kill a short-barreled panzer IV! - MORE THAN ONCE!!
« Last Edit: 07-03-2010, 21:03:22 by djinn »

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #8 on: 08-03-2010, 10:03:51 »
Bardia and Crete-64 are all good...but riding your bike around Crete is not a good idea, the Stuka pilots like strafing cyclists. One strafed me while I was in a Chev as well.

...About the temperature, I opened the file and didn't know where to start. What value would make the nebelwerfer as occupied as say, a PAK40 or 88? If I simply used the same exact values in the PAK40s files, will that do it?...
Maybe. I changed it from 100 to 500 (same as 88) and on Totalize they still seemed to prefer the 88...maybe they can shoot further with it? :-\


Offline Stylo

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #9 on: 08-03-2010, 10:03:19 »
For some really odd reason, 5 seconds into Goodwood 64, one of the bots dropped 2 satchels at his own feet, ran away and TK'd his entire squad. Sure it was hilarious, but I have no idea why it happened. Even still, on both sides atleast 2 squads just stand around and don't move from the get-go. I get the same in most other maps, there'll be a couple of squads who are just sitting in the middle of nowhere, not moving, even after giving them command orders.

I unfortunately never got the opportunity to download the newer beta versions from winterhilf's thread, so perhaps I'm missing out, I dunno.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #10 on: 08-03-2010, 12:03:29 »
The NEWER version is right here in this thread - It was updated. The only thing the one in Winterhilf's thread added was the usable nebelwerfer... less than a megabyte file

Yer for some reason bots use the charges like smacktards - FINALLY, the bots are as stupid as pubbies :-P
Those squads that remain do so more in NA maps because for alot of them (Supercharge, Mersa Matru, Seige, Tobruk, El Alamein), the commander AI is messed up and gives conflicting commands.

For later maps like those in Normandy, specifically, Luttich and Goodwood, I really don't know WHY they seem to camp the main bases - Perhaps the next issue we should try to solve as SP fans... Shelf the Goodwood CTD issue for a bit, or do them in tandem

Thanks cF
Will try that out - But again, and I cannot emphasize this enough, someone should REALLY consider raising the view-perspective for howitzers and mortar to something higher (about twice as high) than PDH's cliffs (Basically plane height) so that bots can targets as far as their guns can or SHOULD be able to aim to

I'm sure it would completely transform the battlefield if all you need to do is coupled with dodging enemy artillery or moving in tune with yours... Like FH1...

It may not come to many since bots seem so frustrating, but we've already surpassed FH1 bots in all aspects of intelligence - But lack or artillery fire, unfortunately shows their fallshorts all the more - Put it back in and you put them both on an equal playing field so that you see JUST how far we've gotten with AI

I really hope Legion or Winterhilf would give us feedback on this idea for artillery


Offline Eat Uranium

  • Tea Drinker
  • Global Moderator
  • *****
  • Posts: 4.569
  • Today's news will contain [REDACTED]
    • View Profile
    • FH2 Music
Re: AI tweak/fix mini-mod v1.1
« Reply #11 on: 08-03-2010, 14:03:23 »
one of the bots dropped 2 satchels at his own feet, ran away and TK'd his entire squad.

Sounds like it uses the C4 code.  The bots in vBF2 would put that on flagpoles, and detonate it when the flag went grey.  Of course, the satchel goes boom on a timer rather than a command switch.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #12 on: 08-03-2010, 15:03:33 »
Tada... You win yourself a cookie


Back to playtesting Goodwood boys

Any chance of repairing this then?

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #13 on: 08-03-2010, 19:03:52 »
The US "Composition" B charge seems to have the same problem as the satchel, bots drop it even when no enemies (let alone vehicles) are in view and end up TKing their own squad. Anyone know how the AI - or the game engine itself - determines how different weapons are used? It seems like the bots are treating Compo B and satchels like smoke grenades, when they should be using them in the same way as the Geballte Ladung and British sticky bombs.

I'll definitely try raising the artillery/mortar view point to see if this improves the AI's use of these weapons, the only problem with this is that it'll make it near-impossible for human players to use howitzers for direct fire at close range.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #14 on: 08-03-2010, 21:03:08 »
We still have top view cameras, no?

no idea of the Comp B issue - If, like Eat Uranium said, its that they use it like c4 then it means, bots feel they need to create a perimeter with it. C4 was used like booby traps by bots, which was the height of their intelligence - They dropped some around a newly capped flag and went off to fish - If you got to that flag and they were within sight, they blew it up to prevent you capping - If you survived that, then there was commander arty

Sachels.. dont... time-explode... So yer, this is an issue. Once their code can somehow be changed to that of stickybombs, especially, they should be fine cuz with stickys they try to put it ON the vehicle

It seems there ARE infact more CTDs btw. I got CTDed twice on Luttich - One for no reason, and the other might have been a vikers mg issue - Not AI, but deployment.

What I did notice though, was that once the vikers was deplyed, one bot run at it like he would use it - Not dashing, but jogging. He gets to it and tries to run past it, getting stuck behind it. Once I used it, he turned away to continue where he had previously been going - I re-deployed it and he did the trot back again

Wierd.

Finally, it sems mortar STILL see tanks as priority and NOT infantry - you sure about the priority? cuz it really seems bots clearly wont fire at infantry with it...