Author Topic: 2.26 compatible (beta version) AI minimod  (Read 9431 times)

Offline Raziel

  • Jr. Member
  • **
  • Posts: 859
  • Bullet Magnet
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #45 on: 01-07-2010, 12:07:21 »
Let's leave Drawde and co. to focus on one problem at a time Djinn!

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #46 on: 01-07-2010, 13:07:48 »
Here's some replies to some of the issues/suggestions mentioned - LONG post, you have been warned:


Repeating MG34 sound - Still haven't fixed this yet... tried a while ago but the fix I used on the 88/2pdr also disabled the MG's automatic fire.

Bots not using deployed 30cal: - Never seen this, will look at it (probably a missing AITemplate). What maps does this weapon occur in?

PHL CTD - Again haven't had time to play this map so haven't noticed this CTD myself,

German bot binocs not spotting - I didn't think bots could spot with binoculars anyway? I know I tried to get them to a while ago, with no success.

Nebelwerfer firing short - Fixed, this was caused by the same indirect fire setting that stopped the howitzers firing.

Planes focusing on infantry: Fixed, more or less, planes will not strafe medium/heavy armour targets (other than the Hurricane IID)

MGs not firing standing: Fixed (including the Beretta, I think), this issue is caused by a Python script (aifixup.py) which disables the prone-only setting for some guns in SP mode.

Armoured cars + artillery focusing on infantry: This seems almost unfixable, regardless of what you set the target priorities to. I'm wondering if vehicles are hard-coded to be more "visible" to bots than infantry? Howitzers do seem to focus on static guns as targets, though.

Bots firing rifles slower: I added a "cap" to the AI firing rate for pistols and semi-auto rifles in the last, 2.25-compatible minimod version - the same fix should be in the current version.

Destroyed vehicles lasting longer: Like the radio/comm rose commands, this is something I've been planning to look at for ages, but have kept putting it off due to more serious bugs/issues needing attention. It shouldn't be too hard to do, though.

Longer respawn times for static guns are definitely something worth trying (don't think removing respawning completely is a good idea, purely IMO), it will make up for the AI's laser accuracy for these weapons which currently tends to give the defender the advantage. I noticed that the guns on Totalise seem to take a very long time to respawn compared to other maps, which gives the Allies more of a fighting chance.

Commander AI fixes: Partly fixed at least - the next version of my minimod will include updates for all SP-playable maps (necessary due to the new SP-only artillery objects) and I've included commander fixes, AI improvements, and vehicle spawn tweaks in many of them. I hope to eventually have all SP maps with fully fixed + tweaked map-specific AI files but this will take a while to do. I think I've got rid of most of the commander bugs (caused by uncappable CPs being incorrectly linked), though.

Now, for the two issues which are really getting on my nerves:

1 - Bots not firing at exposed crew positions on halftracks/tanks: This is the major issue which is bothering me at the minute (plane rockets can wait for the next version, as they've never worked - whilst this is a new issue). Basically it's caused by the new armour system, there's a separate category for unarmoured vehicles which bots will fire small arms and MGs at, halftracks are "light armour" and ignored by small arms. I've tried giving the gunner positions the "unarmoured" class but this just causes a CTD; BF2 doesn't seem to like multiple AI armour classes on one vehicle.
Making light armour a valid target for small arms would result in light tanks, armoured cars etc. getting spammed with rifle/MG fire, whilst classing halftracks as "unarmoured" would make bots less likely to use AT weapons against them.

Also, I'm fairly certain that bots, even in earlier versions, never fired at exposed crew on tanks (Panther top MG etc.) as these have the HeavyArmour class... they might have fired at the Sherman top MG as this is actually a separate object (with its own armour class) attached to the tank.

The odd thing is that FH2 bots don't seem to be able to recognise the "HasExposedSoldier=1" setting which should - in theory - let bots fire at exposed crew regardless of their vehicle's armour class. Do bots do this in vBF2? (it's a while since I've played it) - I know they did in BF1942. If we can get HasExposedSoldier to actually work, it will solve the whole problem.

2 - Bots and AT rifles: I've mentioned this one before and can't work out what the %£!$ is going on. Firstly, I've disabled non-prone firing for ATRs - same as with MGs - but this just means bots don't use them at all; unlike MGs, bots don't seem to understand that they need to go prone to fire the gun (despite the "weaponTemplate.setFiringPose Lying" setting) and since making this change, I've never once seen a bot fire an ATR.
Secondly - and this is the really weird thing - on my copy of FH2, bots have never been able to hit anything when firing ATRs standing. They fire them, but the shot doesn't appear to go anywhere - though I've noticed the occasional teamkill message. I've experimented with firing an AT rifle standing inside a small building (the aifixup.py script also allows humans to fire standing) and found that the bullet hole usually appeared somewhere -behind- where I was standing. I even managed to blow up a civilian truck by standing in front of it and firing an AT rifle...

But Djinn and other players have reported that bots can hit targets when standing without any problem. Since everyone's using the same weapon data files and AI behaviour files, I have no idea what is going on here. Could it be anything to do with difficulty settings? I usually play with the AI difficulty on maximum, which as far as I know ignores the weapon deviation (inaccuracy) settings in the AI files.

How about Clivewils baby,the AIX_P51D
That must use its rockets ?

Unfortunately, no... this one is on Op. Cobra and I've never seen it fire rockets, though it will strafe targets, dogfight with Fw190s and drop bombs OK.
The rocket bug may have something to do with the fire rate or automatic fire settings as I'm sure I heard a plane rocket firing sound on Totalize once (definitely wasn't a bazooka/faust or Nebelwerfer) - but only one.
Also, I have the minimum range for rockets set to 50, not 500 as in the default AI files. Not sure increasing velocity is a good idea as it will also affect rockets fired by human players.

Anyway, I'll have another look at the plane rockets later today or tomorrow and will also try playing with different difficulty settings to see if bot AT rifles behave any different.
« Last Edit: 01-07-2010, 13:07:08 by Drawde »

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #47 on: 01-07-2010, 14:07:43 »
...i just noticed the rockets fire rate is 1
that means 1 mouse click,3 rockets,very unusual
most use fire rate 2,try changing it to
ObjectTemplate.fire.addFireRate 1
You mean: ObjectTemplate.fire.addFireRate 2?


Quote
How about Clivewils baby,the AIX_P51D
That must use its rockets ?
Not that I've seen, and it's rockets have the same values (rpm, velocity, range, etc.) as the Typhoon's, so I'd say no.

I doubt Clivewil supplied any code with the P51 when he gave it to the devs, if he did the bots wouldn't have any problems using it... ;)

I'm gonna try using the values from the AIX version of it to see if that get them firing...



...Commander AI fixes...
DIE COMMANDER SPAM, DIE!!

Quote
...The odd thing is that FH2 bots don't seem to be able to recognise the "HasExposedSoldier=1" setting which should - in theory - let bots fire at exposed crew regardless of their vehicle's armour class. Do bots do this in vBF2?...
If the MG'er position on the turret counts, I'm almost 100% sure they do in AIX, I'll double-check it later.

Quote
...Secondly - and this is the really weird thing - on my copy of FH2, bots have never been able to hit anything when firing ATRs standing. They fire them, but the shot doesn't appear to go anywhere - though I've noticed the occasional teamkill message. I've experimented with firing an AT rifle standing inside a small building (the aifixup.py script also allows humans to fire standing) and found that the bullet hole usually appeared somewhere -behind- where I was standing. I even managed to blow up a civilian truck by standing in front of it and firing an AT rifle...
You're not the only one...I've seen them repeatedly shooting at Opels from short distances and not doing any damage. I always have my bots set to 'maximum angry', so maybe it does have something to do with the difficulty, although I can't understand why less deviation would equate to teleporting bullets... ???

Offline Devilman

  • I belong to Naughty Club
  • **
  • Posts: 274
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #48 on: 01-07-2010, 14:07:17 »
You mean: ObjectTemplate.fire.addFireRate 2?
Correct


I doubt Clive would release a vehicle which wasnt working properly (i helped him with the SU 22,and its bots problems)

You can try the FH2 planes in BF2/AIX,and Clives original files in FH2SP
There may by chance besomething in the FH2 python causing issues
by doing the above ,you should find the problem..mod or vehicle


Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #49 on: 01-07-2010, 15:07:58 »
The german binocs issue is not about bots spotting, but the fact that players using german binocs in singleplayer can fire them, but they dont leave spot areas. The brit one does and i'm sure the US one does also.

The fixed guns i.e AT, AA, howitzer, mortar, not sure about mg, do not respawn in multiplayer. They get destroyed and remain there like unusable statics until fixed. This was translated for singleplayer by bizness in 2.0 and it caused a ctd, as did bots with wrenches (later fixed). Bot guns thus simply blow up and respawn. My hope, after this patch is for us to get the multiplayer versions of these guns and see if they can be used, which would make bots have to repair damaged guns for reuse rather than simply wait for them to spawn.

Even in Totalize,
if i rocket all 88s, by the time i reload and return, they will be back.

The AT Rifles are definitely deadlier than zooks because of their range. Moreso @ 100% difficulty, where they snipe infantry with them. Just drive a pzii or hanomag in enemy area eg. Tobruk or a short barrel PzIV or crusader on sidi rezegh. It too is shot up with ease. The more the tank presence, the more the at guys. I figured prone-use would make it only as deadly as a zook, given Pz2s a chance.

Clivewills p51rocket was removed in cobra for his bomber and the p47rocket. Unearthen that p51rocket or looking @ it in aix may help.

Bots did firewat halftrucks with rifles just like they did at at guns. Not sure it was your earlier version or if it was leagions independent bot-mod for 2.2. You can check it out at the battlefield singleplayer website, forgotten hope. He gave us a download link there.

 Armored cars were infantry only once, and this changed. Maybe something can be picked from mgs especially .50cals.

The .30 cal is at the start of phl and a number can be found. Also on pdh with the shotgun.
Great job on commander AI, drawde. That will really certainly give 2.0 maps a 2nd lease on life.

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #50 on: 01-07-2010, 19:07:30 »
No luck so far with the aircraft rockets... ObjectTemplate.fire.addFireRate 2 hasn't had any effect.
If I remove the guns on the Typhoon and leave the rockets, it will make "strafing runs" on ground targets but not fire anything. The rockets fire OK when I fly the Typhoon myself.
I've tried looking at every single line in the aircraft rocket data and comparing it to other weapons (including vBF2 helicopter rockets) and have altered/disabled various settings but still can't get them to fire.  ???  I've also looked in the projectile data but there doesn't seem to be much there that would affect the AI.
The P-51 rockets look to have identical weapon data and AI to the Typhoon and P-47.

Where are the AIX files available from, if they're still around?

The german binocs issue is not about bots spotting, but the fact that players using german binocs in singleplayer can fire them, but they dont leave spot areas. The brit one does and i'm sure the US one does also.

Another weird thing... the AI minimod (any version) doesn't include any binocular-related files. I'll try them myself and see if I get the same issue. Currently there's a bug with my custom artillery objects where the "spotted target" view just shows a third-person (not overhead) view of the gun, but I should be able to fix this soon.

The fixed guns i.e AT, AA, howitzer, mortar, not sure about mg, do not respawn in multiplayer. They get destroyed and remain there like unusable statics until fixed. This was translated for singleplayer by bizness in 2.0 and it caused a ctd, as did bots with wrenches (later fixed). Bot guns thus simply blow up and respawn. My hope, after this patch is for us to get the multiplayer versions of these guns and see if they can be used, which would make bots have to repair damaged guns for reuse rather than simply wait for them to spawn.

Interesting... the code for this appears to also be in aifixups.py:
Quote
        # armor.canBeRepairedWhenWreck = 1 and armor.canBeDestroyed = 0 causes crash
        for pco in bf2.objectManager.getObjectsOfType('dice.hfe.world.ObjectTemplate.PlayerControlObject'):
            u.active(pco.templateName)
            if u.templateProperty('armor.canBeDestroyed') == '0':
                r('ObjectTemplate.armor.canBeDestroyed 1')
            if u.templateProperty('armor.canBeRepairedWhenWreck') == '1':
                r('ObjectTemplate.armor.canBeRepairedWhenWreck 0')

It might be possible to get the MP fixed gun system simply by disabling these lines. Not sure if bot engineers will realise how important it is to keep the guns repaired, though - I don't often see them repairing damaged vehicles.

(edit: last part of post was missing)
« Last Edit: 01-07-2010, 21:07:33 by Drawde »

Offline Raziel

  • Jr. Member
  • **
  • Posts: 859
  • Bullet Magnet
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #51 on: 01-07-2010, 19:07:38 »
@Drawde:
By any chance, could the rocket projectile have the same problem the bombs had back in 2.25 (rotated backwards)?
I have noticed that whereas in 2.25 the bombs fell in an arc downwards (see pic) with the arrival of 2.26, bombs tend to rotate while falling (similar to this)
http://www.youtube.com/watch?v=y3cVc42wg9Q#t=0m31s
« Last Edit: 01-07-2010, 19:07:30 by Raziel »

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #52 on: 01-07-2010, 20:07:50 »
I recall drawde saying he checked that out.
I have AIX, but i don't know where the p51 if its in my version @ all. Drawde, you may need to find the version that has it otherwise you'll have to find clivewill himself @bfsp forum.

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #53 on: 01-07-2010, 21:07:27 »
The rockets definitely don't have the same rotation problem bombs did pre-2.26; the rocket "launcher" dummy projectiles are rotated slightly to get the projectiles to converge rather than flying in parallel, but aircraft gun barrels are set up in the same way and the AI doesn't have any problem with firing them.

Also, the bomb bug messed up the plane AI so badly that bombers nosedived into the ground as soon as they saw a target - whilst rocket planes can still fly normally and make strafing attacks on targets; they do everything except actually fire the rockets  ???

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #54 on: 01-07-2010, 22:07:39 »
I noted a hanomag mg fire @ me even though i was in one myself. I got out, heared a german smg crack, jumped back in, only to have an approaching hanomag shoot me to ribbons.

Also, noted a brit put a charge on a pziv, run, kneel and remaint knelt until well after the charge exploded... The tank moved and took no damage. This isn't the first time i saw at charge infantry do that, but it wasn't the case in earlier versions. It seems, the lack of damage from a miss means the bots wait for the tank to be killed irrespective.

Also, while other fighters have really low LOS for mg and cannon, making their strafing ineffective, the fw190 doesnt have this issue. I think whatever it has can be translated to give other planes an advantage also.

Offline Devilman

  • I belong to Naughty Club
  • **
  • Posts: 274
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #55 on: 02-07-2010, 02:07:54 »
I recall drawde saying he checked that out.
I have AIX, but i don't know where the p51 if its in my version @ all. 

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

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #56 on: 02-07-2010, 20:07:34 »
Still no progress with rockets (I'll check the AIX files out later) but I've managed to increase the duration of vehicle wrecks (increased from 60 to 500 for tanks, slightly less for trucks etc.). I'll be interested to see how this affects pathfinding on maps like Goodwood and Mersa Matruh with tanks in urban areas!

I tried disabling the aifixups script to stop static gun respawning, but got a CTD immediately I entered a destroyed gun that I'd repaired (2pdr on Siege of Tobruk). So it looks like this is still no good for SP. I suspect it wouldn't really have worked properly anyway as it's impossible to make bots "understand" that repairing the guns is vital. You'd probably get the occasional bot engineer repair a gun, but not as often as needed, so it would switch the imbalance over to the attacking side (tanks respawn, guns don't, so sooner or later the defenders will run out)

I'll definitely try increasing the spawn times for static weapons, which should be a partial fix for the issue.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #57 on: 02-07-2010, 20:07:53 »
Perhaps, an alternative would be to get the repairers seeing that as top priority whenever... Bots in vanilla would chase tanks to repair them


I sent a message on BFSP to Clivewil, but as yet... just a few hours, haven't got a reply. The P51 was just be in the files though, cuz its not in his test map. An interesting thing I did note about his Stuka though, was that rather than use a divehorn you can activate, it comes on at a certain speed which is only achievable in a steep dive... even bots can do it :-)... Might be something the FH2 devs might want to add for their Stuka. Would do us good, I think

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #58 on: 02-07-2010, 20:07:24 »
Is the speed-activated divehorn in the AIX Stuka files? If so, it should definitely be possible to add it to the FH2 Stuka.
Bots don't usually seem to "dive-bomb" properly with the Stuka or any other plane, though (just shallow dives)

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: 2.26 compatible (beta version) AI minimod
« Reply #59 on: 02-07-2010, 20:07:59 »
Well, I did mention that to Clivewil since he seems to have an intricate understanding about changing so many aspects of planes... Wanted to know if he could help let Stukas fly alot higher, that way they'd make steeper dives. They'd also be less vulnerable that way

The current dive they DO do now does still give them speeds higher than cruise speed at any distance cuz they dive from far off and maintain it until they drop their bombs or are done strafing