Author Topic: AI tweak/fix minimod v1.2  (Read 3550 times)

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
AI tweak/fix minimod v1.2
« on: 02-05-2010, 19:05:45 »
DOWNLOAD LINK

This update took rather longer to finish than the last one, mainly due to trying to track down and fix the cause of the CTDs in the Luttich and Goodwood 64 maps. However, this also means that it's basically got two updates worth of fixes and additions in it, which I was working on alongside fixing the map CTDs.

Here's a list of changes:

Quote
- Modified the AI "armour class" system. Bots can now recognise static guns, unarmoured, light, medium and heavy armoured vehicles as separate target types, allowing them to select weapon types + shells more intelligently.
- Bots can now exit from or switch vehicle crew positions (e.g.: if you exit a tank with a bot hull gunner, they'll switch to the driver's seat).
- Bots can aim and fire mortars effectively at targets within visual range.
- AI maximum range for Bofors AA gun now matches the maximum range of the shells (no attempting to fire at ground targets out of range).
- Bots are more likely to use the MG34/42 Lafette gun positions.
- Bots can now fire the Nebelwerfer.
- Bots can now aim + fire the Sherman and Cromwell hull MGs.
- Bomber aircraft will now strafe infantry rather than bombing them.
- Reduced AI range of infantry anti-tank rocket weapons.
- Revised AI "StrategicStrength" priority values for all vehicle types.
- Fixed vision port shield movement on halftracks (US and German) and Kubelwagen.
- Fixed a CTD when the Pak 40 static version was destroyed.
- Fixed CTDs associated with the US Composition B explosive charge and British PIAT anti-tank launcher.
- Bots will no longer drop explosive charges at friendly CPs (bug caused by the AI C4 usage code)
- More minor tweaks to vehicle and infantry weapon AI data.

This version includes modifications to the .ai files and a couple of Python scripts, so I'd recommend backing up your FH2 \ai and \python folders before installing.

There's not a huge number of things left to fix or add (at least not things that are easily fixable), but next I'm going to look at radio/comm rose commands, artillery, and bots using truck/APC passenger positions (since they now know how to exit vehicles)

Offline Remick04

  • Moderator
  • ***
  • Posts: 103
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #1 on: 02-05-2010, 23:05:08 »
And for those of you looking to play on new maps here ya go...

http://www.filefront.com/16345357/SP%20Mini-Mappack%201v.1.rar

if there is anything wrong with the files let me know and I fix it and reupload them, this is my first time doing anything like this so I'm not sure I have it right.

Unfortunatly I've been getting CTD with all 3 maps (even with Drawde's new AI files) but I figured I'd upload them anyways... more eyes means we can find the problems quicker. If you have any questions or suggestions let me know... If not I hope you enjoy them (while they work).

Offline CBCRonin

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #2 on: 03-05-2010, 03:05:43 »
Just played through Luttich as Allies without a crash, and the action was pretty intense..... so kudos.

Some small things I noticed:
-While free looking from an artillery piece, the gun moves slightly in the direction you look.

-German tank MGs are now extremely deadly (which was the intent).... but once locked onto you it appears they can fire through almost anything to hit you (multiple wooden walls, the metal shield guard on the 6lber, etc.) Didn't get a chance to test if they could fire through stone or a halftrack, but will test it later.

-At the end of the battle, the victory message "US" has changed to the vanilla "USMC"..... not a big deal, but as a former "Screaming Chicken" it pains me to see the leathernecks get the glory in Europe  ;) (they'll get the Pacific theatre in a few years ;D)
-----------------------------------------------
Addition:
Just played Goodwood as Axis, no crash after hours of play.

-Can confirm the continued issue with spotting that some other people had mentioned for the previous tweak. (I would have commented much earlier, but my computer fried and I had to buy a new one.)

Spotting did result in an accurate target picture in the overhead view for arty, but the azimuth positioning was off significantly.

-Axis did man the nebel, but they fired it only rarely (and only one shot).

-I know you limited AI range for anti-tank/rockets (to deal with crashes).... the Germans with panzerfaust suicide in droves though. Is it possible to lower the bot anti-tank kit selection % as an alternate solution? I have never modded BF2 so please forgive my ignorance if it isn't possible.

-I saw many engineers crouch and prepare to use explosives on enemy tanks, but that is as far as they got. They would simply crouch idly, seemingly testing/tempting the tanks "new found" MG ability  ;D.
« Last Edit: 03-05-2010, 06:05:46 by CBCRonin »

Offline Raziel

  • Jr. Member
  • **
  • Posts: 859
  • Bullet Magnet
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #3 on: 03-05-2010, 10:05:02 »
Thanks a lot Drawde...Will be able to test it on Wednesday and will get back to you with feedback!

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #4 on: 03-05-2010, 11:05:13 »
Tried the mod. Haven't gotten to downloading the maps yet... I tried to use my phone to DL since my LAN was out and I run out of credit.

The Stuka seemed to move alot more gracefully... or maybe its just me. Still wish it could use its divehorn though

The biggest noticeable improvement I saw was the mortar. Mortar in Siege of Tobruk usually doesn't play a role since they are positioned slightly below the eye level i.e in trenches. Well, now the user sees targets as far as the axis road near the PAK36 and harasses tanks at every turn. Mortar in PHL also does serious damage to infantry, but it seems mortar will only attack infantry in an infantry-only environment since they see further than they fire and will thus note vehicles out of firing range and would ignore infantry right around it... That might not be a bad thing though as its deadly accurate and FH splash damage makes it even more so. Infantry in tow of tanks will definitely have this as a real challenge :-)

I also tried Luttich with no crash and had the Germans attacking continually with infantry and armor. Never actually noted the switch-position or bail vehicle, but it was clearly at work. I even mounted a mortar somewhere in the hedgrows and had it fire at enemy targets behind the hedgerow which would otherwise have been considered non-visible. It doesn't seem to see targets behind buildings, but that might just be how it should be :-)

Still excited to get back home and check out the rest and should have DLed the maps by then and will definitely give feedback there also...

thanks alot guys.

Offline Remick04

  • Moderator
  • ***
  • Posts: 103
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #5 on: 03-05-2010, 19:05:06 »
Well I can say with a degree of certainty that the crash on totalize is caused by the willys jeep and/ or the train... because with both these vehicals removed/ replaced I don't get a CTD. Still working on finding the problems with the other 2. If I can figure them out, I'll try and post an updated Mappack. Kindda hate how my first set of maps are so unstable and buggy.

Offline CBCRonin

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #6 on: 03-05-2010, 21:05:39 »
Two crashes on El Alamein, a map that has never crashed on me before. I believe it has to do with the changes to AA, as both occurred while I was piloting a Stuka near the Axis main and within seconds of seeing exploding flak near me.

The fire emanated from the south cap base. 

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #7 on: 04-05-2010, 10:05:17 »
Thanks for the feedback + bug reports!

Jeep CTD - I've now fixed this, it was caused by a couple of errors in the vehicle's objects.ai file (which caused a CTD when a bot attempted to switch position, or was displaced by a human player) After fixing it, I haven't had a CTD on Cobra so far. I'm wondering if this could be the other cause of the Luttich CTD, since this map also has a Jeep or two; I suspect it may also be the cause of the occasional CTDs on North Africa maps which have the non-SAS British jeep (which shares the same AI file as the one on the Normandy maps)
I'll put the fixed Jeep file up for download soon - as most of the Normandy maps have this vehicle in, it's a fairly critical fix!

I haven't looked at the train yet, but I assume it's just due to this vehicle not having an AI file assigned to it. Though I once got a CTD on Totalise when attempting to use the train myself, no bots were nearby. It definitely works OK in multiplayer.

"USMC" message - This is weird, no idea what could be causing this. I don't think I've changed any files relating to in-game messages or text.

Tank MGs firing through things - Even weirder, this shouldn't be happening (and I don't think I've ever seen this myself). AT gun shields don't usually provide 100% protection from small arms/MG fire, due to their shape and the open vision ports - but MG fire certainly shouldn't go straight through them, or through scenery.

Bots using AT charges - They're definitely able to use these correctly (some of the time, at least), I've seen many kill messages for these weapons (not all teamkills!) and have been killed by Geballte Ladungs a couple of times myself.

Limiting bot AT kits - Unfortunately I don't think there's any way this can be modded - bot kit selection seems to be hard-coded. It's particularly annoying on the North Africa/Greece maps, as bots are unable to use AT rifles effectively.
BTW, the limited range isn't to prevent crashes (the PIAT CTD isn't related to the weapon's range), I just set the range to (approximately) the historic effective range of these weapons. In the default FH2.25 files, AT weapons have very long ranges - on some maps, like Luttich, they can fire at you from beyond visual range - but, as the minimum ranges are so high, bots rarely get a chance to fire them, so the issue is less noticeable. With earlier versions of my AI minimod, I fixed the minimum range without reducing the maximum range enough, so you had bots firing bazookas/schrecks at you from miles away.

Crash on El Alamein - Never got a CTD on this map myself, this was one of the maps I tested shortly before releasing the new version. However, I'll try it again.

Mortars not firing at infantry - Still not sure why this is, infantry are their main target priority in the AI file, followed by guns and unarmoured vehicles, light armour, and tanks.


And for those of you looking to play on new maps here ya go...

Excellent work! :) It might be worth posting this in a new thread so more people will notice it, also feedback + bug reports can be posted in a specific thread this way.

After fixing the Jeep bug, I played a complete game (as the Allies) on Operation Cobra with no CTD. The AI on this map appears to work very well - although I can't comment on the pathfinding around Hebecrevon village as the fighting never got this far... this map is definitely very challenging for the Allies with loads of emplaced AT and Flak guns, which the bots use all too well (the 88 between the German main base and the farmhouse got me at least 3 times when driving a tank, and then shot me down twice when I tried to use P-51s to take it out  >:( ).

I did encounter the double-cap problem on the farmhouse CP, though. Also saw both friendly + enemy bots and tanks hanging around friendly CPs when they ought to be attacking, I'm going to try adding a strategies.ai file to this map to see if this will make the AI more aggressive. The Allies should be constantly on the offensive on this map, whilst the Germans should probably be on the defensive at first and switch over to a counterattack when they lose a few CPs (but should still give defensive gun positions a high priority)

I haven't tried the other two maps yet (will try Totalize next to see if the Jeep fix has removed the CTD) but noticed a problem with the folder arrangement for the Mount Olympus files - the "32" and "64" folders are all in the SP1 folder, 32 should be in SP2 and 64 in SP3. This is presumably why the 32 and 64 player versions of this map can't be started from the main menu.

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #8 on: 04-05-2010, 14:05:52 »
Yay! New minimod and maps...nice one, guys.

Been busy, so I haven't really tried it yet, but the weekend isn't far off... ;)

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #9 on: 04-05-2010, 17:05:28 »
The one issue I have noted is this:
Tanks still stop and fire and ever so often, remain stationary until the driver is displaced... Now however, rather than die, they bail. The litmus test, as always is Mersa Matru, where tanks can see the Allied movement from as far as the hill overlooking the station. Cool thing is, mortar from near the mosque can fire almost as far as that courtesy of raised POV, but then the problem cannot be concealed.

This is however also noted in Siege of Tobruk where armies of tanks can collect in no-man's land infront of the frontline defenses... and in Gazala, although i haven't tried it since the patch... And i think, in Operation Cobra also - I recall seeing a Panther stationary over the buff in some open area just standing there, smirking at some past victory of his

I played all three new maps, but I would create a new thread with link to the download to start that discussion going.


Offline Remick04

  • Moderator
  • ***
  • Posts: 103
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #10 on: 04-05-2010, 21:05:04 »
Awesome, thanks for all the feedback so far! And I’m glad to hear you've fixed the jeep issue, I was going to post a version of Totalize without the jeep and the train, but if you have a fix I'll leave them in. I know the game crashes when I try to use the train... the bots generally seem to ignore it, but there is always a possibility of them using it. The other issue is tanks will get stuck behind the train from time to time. But I'll leave it in because it's one of those fun vehicles that makes Forgotten Hope what it is.

I'll definitely fix the Mount Olympus folder issue. Funny thing is I had the 32 player in sp2 and 64 player in sp3, but I changed it just before posting it. I tested it from the Co-op menu (local sever) and they loaded fine, (CTD ingame, but loaded fine)... goes to show I need to test more from the singelplayer menu. I also forgot to set up an Ai strategy for the 16 player version, so bots end up standing around with nothing to attack. So I'll have these things fixed along with some other fixes to the navmeshes in an updated mappack this weekend or early next week.

Feel free to adjust the strategies.ai files on Operation Cobra, I did some strategy work but very minimal. And currently I'm preoccupied with Operation Totalize and Mount Olympus, as well as getting more maps navmeshed.

I'll address the rest of the feedback in their respective threads, so kindly set up for me by Djinn and Cannonfodder :) Thank you all!
« Last Edit: 04-05-2010, 21:05:24 by Remick04 »

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #11 on: 05-05-2010, 11:05:43 »
@Drawde..
Remote chance of making howitzers fire like mortar i.e. elevated LOS. I noted that though manned, they aren't particularly liked whereas mortars are and their current LOS is still the same, except for the 25pdr which has a wierd new LOS. If it doesn't require too much work that is...

And maybe, planes firing rockets too - Once those are done, everything else would be minor tweaks. The rockets may have the solution in BF2vanilla's aircraft ai. just difference in targets i.e. ground targets versus BF2's air targets

Really, really impressed with mortar though... it clearly fires quite far now and beyond the direct elevational perspective of bots. Mersa Matru is the best example of this... And I wouldn't worry about their targeting. They fire too fast and too accurately to be safe to use against bots as first targets... they do however fire at infantry if no other vehicle exists... this is clearly seen in PHL, where the grenatewerfer causes serious havok to the allied adavance until taken out.. Weapon of choice, mount an Allied mortar tube >:-)

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #12 on: 05-05-2010, 19:05:48 »
All of the howitzers (and the Nebelwerfer) should have elevated LOS in this version. If not, I don't know what I did wrong! But I still haven't managed to get them to fire indirectly. This is something I'm going to try and work on for the next upate.

I'll also definitely look at the plane rockets, IIRC the AI data for these is almost identical to the vBF2 ones, so there must be another issue preventing bots from using them. Not one as serious as the reversed bomb models, as planes with rockets can still fly normally.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #13 on: 06-05-2010, 15:05:19 »
So some alerts

First off, I'm not sure howitzers DO use the same logic as mortar. The proof is when you man them. You don't get the raised perspective. I can imagine they do fire, but as of 1.1, never at infantry and only AP at armor.

Also, a startling and disturbing observation, the bofers can't aim straight anymore. They only aim straight up being able to hit planes for the split second it is above them, otherwise they blast away, having seen the plane, but facing directly above them, especially when the plane passes them by.

A single PAK40 in Totalize, at the nebelwerfer base, also has an issue of not swiveling when manned with the gunner oblivious to enemy attacks from the rear.

And is there any reason why planes now fire HE at medium and heavy tanks? Oh, and Lo-ove tanks puffing smoke now.. under what conditions is this done?

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix minimod v1.2
« Reply #14 on: 06-05-2010, 20:05:06 »
Turns out you were right about the howitzers! The 25pdr in North Africa maps has a weird bug with the viewpoint (this is caused by a "rem" comment on the same line as some data), and the US 105mm doesn't have the raised viewpoint. (The Normandy 25pdr, Nebelwerfer, and all versions of the German LeFH18 should be OK, though)

The raised perspective is created by modifying the gun's camera location, and isn't directly related to the AI logic.

Not sure what's causing the Bofors issue, I don't think I've modified anything for this recently. I'll probably just revert the .tweak and objects.ai files to the original 2.25 data, in case any errors have crept in. Since (unlike the AT guns) the Bofors works fine in unmodified 2.25, all that needs to be modded is the weapon range/priority data and the object armour class.

With the new armour system, planes will strafe light and medium tanks (though they give a higher priority to static guns and unarmoured vehicles) but not heavy tanks.