Author Topic: Bot Infantry and vehicle AI in 2.25  (Read 7058 times)

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #15 on: 23-01-2010, 10:01:10 »
Just noted something in Goodwood today that is more to do with bot AI than map issue
So,
I was wondering why the uber german tanks were always crisscrossing the rail - Their pathmap in that area is perfect and I've seen the Tiger do the overpass easy once the alcove was blocked by a Brit halftruck that had probed too deep behind enemy lines and gotten killed by the axis-only out of bounds area (We need a better term for that)

So the issue is not pathmapping at all! Instead the problem is the commander AI telling his troops to defend bases once their under-attack and not changing this to an attack order once the base is lost. the bots in turn seem to see defending 'enemy bases' as lower priority than defending their own, which in turn is less than an attack order. Its been there since 2.0, I think. But it sure will make their counter-attack more aggressive if they recognised the difference between a lost base and a base that is BEING lost.

Sure, the panzers are shy now and get pwned by thew Sherman VC, but the bigger issue is why they keep turning around in circles rather than moving foward, hence revealing thier weaker rear armor.. And i think the commander issue here is one of the big reasons why

I think it applies to many other maps too

EDIT:
Holy shit! I just saw a Hurricane AT plane shot down by a PZIII! Bots, yes, bots... This plane was well off the ground diving down to take a shot at the tank... was far off, but I clearly saw it going boom and falling out of the sky. This was on Gazala and the plane was besieging tanks parked far off near the main German base. Now, I know the 88 doesn't swivel to aim so that wasn't it. The Germans didn't have a plane airborne at the time and then all I see is the plane go BOOM and the log say 'so, so and so [PZIIIsomething]so and so...

Also, the tank combat is depressing. i specifically chose Gazala to see tanks in all their forms. They DO infact stop at range, sometimes and fire on enemy tanks (This is the interesting part) and if the land is flat like in Gazala, they can fire from ranges that will be a challenge to humans (This is the cool part...Makes you wonder why arty still remains quiet since its a similar principle I imagine). Issue is, they may forget themselves and remain guarding that spot of earth almost indefinitely (Which sucks).

I'm impressed with the AI team thinking outside the box in trying to make bots do stuff BF2 may not quite have considered like stopping to fire (Ironically, since it should be harder to fire on the run). But I must conclude that as of 2.25, tank combat for bots is utterly FUBARed. I sure hope we get a patch soon, otherwise its until the next release :-\
« Last Edit: 24-01-2010, 20:01:16 by djinn »

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #16 on: 25-01-2010, 06:01:20 »
Quote
...Issue is, they may forget themselves and remain guarding that spot of earth almost indefinitely (Which sucks)...
Mersa is bad for that...the German tanks park on the ridge and take the occasional potshot at the town. The odd few that make it to town don't stand a chance as the Brits are ALL camping at the Mosque and Matruh West.

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #17 on: 25-01-2010, 10:01:13 »
One particular thing I noticed when looking through the FH2 AI files, is that many weapons have extremely high minimum range values. Most HE rounds for tanks are 250 (the maximum range of tank guns in vanilla BF2 is around 150!). This could be the reason that tanks rarely if ever fire HE at infantry.
There also appears to be a lot of inconsistency with the maximum + minimum range values for weapons, particularly tank guns, as well as with the deviation (allowed inaccuracy) values. Most tank guns, including coaxial MGs, have a maximum range value of 1000, which is far beyond visual range in the BF2 engine - I'm wondering whether it might improve the AI to reduce this to 500, and possibly also add optimalRangePercentage values to more weapons. This might reduce the problem of AI tanks sitting in place miles away from the enemy (in the last game I played on the "Supercharge" map, an AI Crusader was firing at the the German-held town with its coaxial MG from almost the other side of the map)

I haven't yet worked out why AI emplaced guns don't turn to face enemies that aren't directly in front of them. The rotation values for these weapons look OK. But quite a few emplaced weapons + AT guns also have rather high minimum range values, which doesn't help!

It seems like FH2's tank/vehicle AI is much more flawed/buggy than the infantry. The virtually infantry-only Pointe du Hoc map works great, both the Allied and Axis AI fight very effectively. Vanilla BF2 proves that bots can use tanks + vehicles reasonably effectively, so hopefully the FH2 vehicle AI can be improved with some tweaking.

Offline von.small

  • Full Member
  • ***
  • Posts: 1.455
  • Last of my kind
    • View Profile
    • WEARMEME
Re: Bot Infantry and vehicle AI in 2.25
« Reply #18 on: 25-01-2010, 14:01:23 »
Bots are alot more agressive
Bots camp the Pak35/37, 88, AAs, Mg15, and once in a while use the mg34 tripod
Bots throw smoke
Bots use charges
Bots don't over-use greande or rfile-grenades any longer
Stuka bots strafe targets
Fighter planes are a real threat now
Tanks fire at greater range
Tanks may stand and fight rather than always charging in
The PZII uses HE against infantry
AT rifle bots are less accurate
AA bots are less accurate
Bots use alot of new vehicles or old vehicles more, such as the caro Amato

Now, just back that truck up, say what!? bots do all that now? Holy smokes, last time I played SP the Mersa Matruh bots sat in Pzrs at one flag point and drove backwards and forwards banging into each other.
HadrianBT - Why the hell would "Germany" attack pigmy ppl??!!
Thorondor123 - I agree that people are not wearing enough hats

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #19 on: 26-01-2010, 09:01:25 »
...so hopefully the FH2 vehicle AI can be improved with some tweaking.
Without a doubt...

I was comparing the Weapons.ai files of the FH Stuka and Clive's AIX Stuka (specifically, the bombs) because the bots happily drop bombs with Clive's Stuka, but not with the FH Stuka.

The min/max range values are similar but the target strength values are completely different. The FH Stuka has single digit values (6.0, 8.0, etc.), while Clive's has double digit values (35, 45, etc.). The FH Stuka also has a lower deviation on the bombs...


EDIT: Jeez-uz, I see what you mean about the tanks. Did you notice how the max. range of one gun/ammo type is equal to the min. range of the one below it?...

Code: [Select]
rem *** Add gun ***
weaponTemplate.create PZIVHMainGun
weaponTemplate.indirect 0
weaponTemplate.minRange 10.0
weaponTemplate.maxRange 250.0
...

rem *** Add gun ***
weaponTemplate.create PZIVHMainGunAPCR
weaponTemplate.indirect 0
weaponTemplate.minRange 250.0
weaponTemplate.maxRange 500.0
...

rem *** Add gun ***
weaponTemplate.create PZIVHMainGunHE
weaponTemplate.indirect 0
weaponTemplate.minRange 500.0
weaponTemplate.maxRange 1000.0
...
It's like that for nearly every tank I've looked at except for:
US M4A1_eu - has a min/max range of 0/150 for all ammo types.
Cromwell - checked all 3 versions...no ai files at all. Which is a tad strange considering the bots use them... ???
« Last Edit: 26-01-2010, 11:01:00 by cannonfodder »

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #20 on: 26-01-2010, 15:01:27 »
The min/max range values are similar but the target strength values are completely different. The FH Stuka has single digit values (6.0, 8.0, etc.), while Clive's has double digit values (35, 45, etc.). The FH Stuka also has a lower deviation on the bombs...

Interesting - so does increasing the target strength values increase the chance of the AI using a particular weapon? I assumed the values were only"relative", i.e. the AI would just use the weapon that had the highest strength against its target, whether the strength was 5 or 35 doesn't matter if it's the highest strength weapon the AI has. But I'd be interested to know if this is wrong!

I've already fixed all of the tank shell range values in my "AI tweak mini-mod".
The Cromwell, BTW, uses AI values from other tank weapons (Sherman, I think), as does the Churchill and a few other vehicles. Another change I've made in my mini-mod is to give them all these vehicles their own AI files, and do the reverse (multiple vehicles referring to a single AI file) with identically-armed variants of the same vehicle, such as the Sherman.

So far I haven't had much luck getting AI tanks to use both coaxial MGs and HE shells. They seem to stick to using either one or the other, depending on which one has the highest strength value vs. Infantry. But I'll have to do some more testing to see for certain.
« Last Edit: 26-01-2010, 18:01:31 by Drawde »

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #21 on: 26-01-2010, 20:01:53 »
Halleyuja!

Please, please - what ever you do, don't just fade away like alot of fan-AI modders do... Vehicles with different AI code to recognize armor!? My most despicable wet-dream come true :-)

Please share this whith the community when you can

As I recall, bots don't seem to use both coaxial mg and HE. BF2 tanks never had the 2. So they either use one or the other, which is more than BF2 bots ever did - Or were even planned to

As long as they only use HE on infantry ever so often, and focus more on tanks, this would be fine and quite the compensation for lack of HE explosions ingame. Some tanks can still use mg to make players not get too familiar and stay on their toes when tanks are around. For instance, make some colours of the same tank use one thing, and the other, another such as the 2 variants of PZIV-H, Panther and Tiger

Also, you might want to give the greater range to the hull mg, and lower range to the turret, be it coax or HE - otherwise bot-infantry will never have a chance
« Last Edit: 26-01-2010, 20:01:53 by djinn »

Offline TheLotusEater

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #22 on: 27-01-2010, 00:01:01 »
Yes this sounds very interesting Drawde!  :D

I might just have a reason to play FH2 once more! 8)
Load the sixpounder!

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #23 on: 27-01-2010, 05:01:32 »
Interesting - so does increasing the target strength values increase the chance of the AI using a particular weapon?...
Not sure, but I'm guessing so. I'll have a dig on the BFSP forum and see what I can find out about it.


...As I recall, bots don't seem to use both coaxial mg and HE. BF2 tanks never had the 2. So they either use one or the other, which is more than BF2 bots ever did - Or were even planned to...
The tanks in AIX have both ammo-types and the bots use them both, firing one then the other in quick succession (at other vehicles). Although, IIRC they're not too keen on using the MG...

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #24 on: 27-01-2010, 11:01:17 »
Please share this with the community when you can

I'll definitely release my AI tweaks as a "mini-mod" for FH2 once I've got them a bit more polished. I've managed to get tank vs. tank and tank vs. infantry + AT gun combat working very well - almost as well as infantry vs. infantry, when the tanks don't get stuck on the scenery - but I'm still trying trying - without any success so far - to get the AI for AT guns working properly. (As other posters have mentioned, the bots seem to be unable to rotate/aim any guns other than AA). I'd also like to get AI aircraft to use their bombs, but again no luck so far.

The tanks in AIX have both ammo-types and the bots use them both, firing one then the other in quick succession (at other vehicles). Although, IIRC they're not too keen on using the MG...

So is there already an AI mod for FH2? I did a quick web search for this the other day, but didn't find anything.
Currently, tanks seem to fire shells at distant infantry/gun targets then switch to MGs when closer. They don't always seem to use MGs when they should, but it's better than the default AI settings.

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #25 on: 27-01-2010, 12:01:30 »
AIX (Allied Intent Xtended) is a SP/COOP mod for BF2. I strongly recommend you DL it. It's great fun and has the best toys (carpet-bombing bots in an A-10 is endless fun  ;D).

You might want to check the BFSP forum as well. Heaps of AI/modding info there.

I had a poke around over there trying to find any threads regarding ai weapon strengths, but didn't have much luck. Most of the stuff I was looking at was to do with the deviation and range.

AIX mod: http://www.aixtended.com/

BFSP forum: http://www.battlefieldsingleplayer.com/forum/index.php?act=idx

Offline TheLotusEater

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #26 on: 27-01-2010, 18:01:37 »
you guys might also want to check out the Assault mod for BF2 http://www.moddb.com/mods/battlefield-2-assault-mod   

and BF2SP: Professional AI mod http://www.moddb.com/mods/bf2-sp-128-professional-ai

I've tried the Assault mod and it, from what I've played, had great ai in it ;)
Load the sixpounder!

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #27 on: 27-01-2010, 21:01:00 »
@ Drawde
Great going man and thanks in advance... Might also want to see what bots can/cannot do with artillery, especially howitzers, if not mortar
About the AIX tanks firing both coax mg and HE, that really opens doors. I do think tanks need to use HE alot less though and mgs more.. perhaps, HE only at infantry like AT infantry and sappers with mg on everyone else... which brings me to my next point

I noted something playing a fixed Luttich. I replaced the M4A1 with the British variant.. ironic, since that was the one CTDing goodwood earlier and a funny thing happened

A Panther kept firing AP shells at me once when I was an infantry man. I was not sure it was me or my tanks far off until it hit the Wolverine and so I shrugged it off as ta tank-tank combat... But it bothered me how low it aimed sometimes i.e as though trying to hit the closer target, me.. some of its shots hit the ground right infront of me, while my tanks were well out of sight in the rear...

Later in that game, I tried to use a zook on the Panther, and it fired an AP point-blank into me and killed me. No friendly tank was anywhere nearby

Also, I once tried to use a panzershrek on an M4A1 and got hit by HE on three consecutive lives before i finally got it. As though it changed to HE specifically because I had the shrek and not because I was infantry. I'm not sure if anyone has looked at the code closely enough since 2.25 and netiher WinterHilf, nor LegionX are commenting, but it does seem like it was purposefully done

Although, with infantry using charges against tanks with the sapper kit, the devs might want to have these included in their HE target list. Again, if its possible, maybe coax mg should be for non-AT or xpack-armed infantry.

Also noted a terrible flaw in the camping Vehicle bots of 2.25. And I now see what CannonFodder meant

Sure, let bots camp AT guns and other stationary weapons, but they camp vehicles, neither changing position or bailing for anything. Tanks will park outside flag zones that are out of their range and sit there waiting for infantry to come. maybe, there should be a change that they bail after a while with nothing to do. But for GP vehicles and armored transports, this is a must. Once they get to their destination or close enough (When the driver is moving else where), they should bail and go on foot. Only the defensive gunner should be allowed to stay on the gun - And even he should switch to driver seat if no one else gets in there for a while - And be able to switch back if he sees infantry in his way

Drivers also don't seem to care to point the vehicle in the right direction for gunners. This is another thing that could be looked at.

Oh, and I think the useless german tank issue seems to be far from fact in Luttich - German tanks, including the Puma own the battlefield in that map

Offline im_a_lazy_sod

  • Jr. Member
  • **
  • Posts: 189
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #28 on: 28-01-2010, 04:01:40 »
I've found one of the most epic aspects of the bots now is their ability to fly planes so well

Running around in co-op in alemain and having to take cover when you hear a plane fly over is epic - even more so when they strafe out the gunners in the half-tracks/tank commanders

one of the best things was being taken out by a 109 in alamein while on the 88 taking out the yerman tanks approaching from the south...

the ai is awesome - can't wait for the next patch and more sp/co-op maps =)

keep it up

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: Bot Infantry and vehicle AI in 2.25
« Reply #29 on: 28-01-2010, 10:01:32 »
...About the AIX tanks firing both coax mg and HE, that really opens doors...
Sorry man, what I meant was they fire both AP and HE rounds in quick succession...they'll fire one, then switch and fire again before the first round hits. Has a one-two punch effect...BOOM-BOOM  ;)

I'm not sure how often the AIX-bot tankers use their MG because they usually have a mate in the gunner's seat firing his MG...and I'm usually too busy trying not to die to notice... :)