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

Offline Stylo

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #15 on: 09-03-2010, 00:03:43 »
Hmmm, strange. Played 3 rounds of Luttich 64 as the allies and managed to get in 3 full rounds without CTD. Yet, I took 3 attempts playing as Axis, first round I CTD'd within 45 seconds, second round 5 minutes and third round was back to within a minute.

But yes, came across the Composition B charge problem again, and it's definitely the vBF2 C4 code. The bot capped a flag and dropped it straight away, as bots did with C4 in vBF2, but of course the Compo B exploded in his face. Surely there's a way to change the AI recognition of the Compo B and Satchel, because as Drawde said, they should be using them as sticky bombs and such.

Still no luck on Goodwood either. I managed to play around 5 minutes, where I capped Cagny West and East, virtually unopposed, until I found half a dozen bots inside an SdKfz, stuck under the bridge to the east of Le Poirier. As soon as I approached it, I CTD'd.


Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #16 on: 09-03-2010, 11:03:08 »
...FINALLY, the bots are as stupid as pubbies :-P...
;D

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.
Bingo. That also explains them running a short distance and crouching after putting a satchel on a tank...the distance is enough to be outside the blast radius of the C4, but not any of the explosives in FH, and in vanilla they crouch when they detonate the C4.


...Anyone know how the AI - or the game engine itself - determines how different weapons are used?...
Nope, but someone over at BFSP will know: http://www.battlefieldsingleplayer.com/forum/index.php?s=1ae1a257a9be907de2eaa37987131b95&showforum=25

Quote
...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...
See above...the one thing I don't get, is why don't the Germans TK each other with the GL (by dropping them near flags)? I mean, they use it against tanks the same way they use the satchels (like C4 in vanilla), maybe it's just because they use the GL so rarely... :-\

Quote
...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.
*crosses fingers*...Don't bother me none if I can't use them, I never do.

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #17 on: 09-03-2010, 21:03:24 »
The problem with Bofors and other AA guns not firing much seems to be caused by changing aibehaviours.ai to allow bots to leave/bail from fixed objects. (This isn't a change included in my mod - yet). Even with the "change" modifier set to a low value like 0.25, bots tend to hop in and out of guns even when there are enemies near, which is particularly bad with AA guns where the target needs to be constantly tracked. Set it back to the default 0, and AA is back to its original deadliness.
I'm going to try to add a seperate "fixed gun" category to aibehaviours.ai so bots can be allowed to leave vehicle passenger positions, but prevented from leaving guns.

I've experimented with raising the artillery view height - it works, and if you raise the "dials" object by the same amount, human players as well as bots can use the guns/mortars to fire indirectly. However, this has an odd side-effect which may prevent this fix from being usable; it appears to make the game engine think that the artillery objects are much bigger than they actually are (presumably it uses their maximum dimension as their radius) so they block some of the map spawn points (they show up as red dots on the map). The guns don't -actually- block the spawn points, but the game engine appears to think that they do.

I also haven't yet confirmed whether raising the viewpoint allows bots to fire further; it seems to be infuriatingly hard to persuade bots to actually use artillery pieces. Even setting their temperature to 1000 doesn't seem to do much  >:(

Oh and btw, I saw the bots use boys rifles to kill a short-barreled panzer IV! - MORE THAN ONCE!!

It's odd that you've seen so many bot kills with AT rifles! When I play the game, I see them firing away constantly but never hitting anything (except for the occasional teamkill) even at point-blank range - I've hardly ever seen a kill message for an AT rifle.  ??? There was a period a few weeks ago when they seemed to be quite good with them - even "sniping" AT guns - but I've no idea what mod changes caused this or why it doesn't work any more... I haven't made any changes to the AT rifle files in a long while, so it must be another thing subtly affecting the bot behaviour. This is the frustrating thing about modding BF/BF2 AI, the whole system seems to be so complex and buggy that changing one thing may inadvertently affect something completely different.

I discovered that the ability for bots to fire AT rifles when standing is enabled in the Python script "aifixups.py". Disabling it, however, just means AT bots stand around doing nothing... is there any way to encourage bots to crouch or go prone? "weaponTemplate.setFiringPose" in weapons.ai doesn't appear to have much effect.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #18 on: 09-03-2010, 22:03:03 »
Well, I personally think the standing option may be the only way to go - Considering how rare mg gunners go prone, which is fine against flesh, but for AT riflemen, this will kill their game.

Currently AT riflemen are quite effective against all soft targets. I'm amazed you haven't seen an AT rifle kill. They ALWAYS take out bren carriers, sdk222s, hanomags etc... And certainly a tank that hangs around long enough gets it too - Seem quite a number of those.

AA issue is less with thier bailing it - I'm yet to see anyone bail any vehicle. Its more to do with their slow response to imbound aircrafts.




Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #19 on: 10-03-2010, 11:03:56 »
A question to anyone running the current version (1.1) of this mini-mod: have you seen bots firing mortars? if so, on which maps?
No matter what I do, I can't get them to fire - I've tried reverting the mortar data files back to the 1.0 minimod, where they definitely worked, and still nothing. Bots will use the mortars, and aim them at targets, but never fire even when they have a visual LOS to the target.

Regarding the "satchel suicide" issue, I've carefully looked through the .tweak and .ai files for the satchels + Compo B and compared them to other throwable weapons that work correctly (grenades, sticky bombs) and can't see anything that appears to identify them to the AI as a different class of weapon. I've no idea what it is that makes the AI decide to treat them like C4 or smoke grenades...

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #20 on: 10-03-2010, 11:03:01 »
Oh no. And it is true, I haven't seen them fire once. I have seen them man it a number of times

The best test would be in El Alamein where they have the god-view of the battlefield - If they don't fire there, then its broken :-(

Unless someone has a wiser word to add

I somehow feel responsible :-(

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #21 on: 10-03-2010, 12:03:19 »
Not on any of the maps I've played so far...not that I've noticed anyway.

Are the sticky bombs in the same weapon slot as the satchels?... :-\


...I somehow feel responsible :-(
Good one djinn, it's all your fault... ;)  ;D

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #22 on: 10-03-2010, 12:03:05 »
I reverted all the mortar files to the minimod 1.0 version, and the German mortar in El Alamein now fires. Still haven't seen the British one fire yet though. With the StrategicStrengths increased to 25, bots almost always man the ones on Siege of Tobruk, but don't fire despite appearing to have a fairly good view of approaching enemies - though they will rotate the mortar, apparently aiming at things.

Offline boka98

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #23 on: 10-03-2010, 13:03:29 »
Hi

Thankyou for your work on improving the singleplayer experience in FH2. You've done a great work so far.
I have a simple question: does this minimod work with coop?

Keep up the excellent work.

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #24 on: 10-03-2010, 14:03:17 »
Fixed the mortar problem: I noticed that bots would rotate the British 3in mortar but not change the elevation, so I took a close look at the .tweak file and noticed that the movement speed for the elevation component (3inchmortar_PipeDummyElevation) was reversed, compared to the German sGWR34 mortar. I changed it to match the sGWR34 data (change "ObjectTemplate.setAcceleration 0/-100/0" to 0/50/0) and bots can now aim and fire the 3in mortar.
The US 81mm mortar doesn't appear to have the same problem, though I haven't tested this.

Whether or not I'll be able to get bots to aim artillery at distant targets (via the raised aiming point) is another matter, but at least now they can fire at things they can see! I'll also try using the "setAlwaysTargetSoldier" flag to encourage mortars to only fire at infantry and vehicles/guns with exposed crew. (Though they do seem to be capable of destroying light armoured vehicles with a direct hit)

I have a simple question: does this minimod work with coop?

I think it should do, providing the server is the one running the mod - all of the modifications are server-side, there are no changes to models, sounds or other client-side data. However, I haven't tested it.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #25 on: 10-03-2010, 15:03:02 »
On El Alamein, they'd destroyed a Matilda with a direct mortar hit... I do hope getting them to fire at infantry doesn't make them too accurate

Nice to know mortars are fixed.

Glad to hear the progress on howitzers. Might also need a high miss rate cuz splash damage is quite large in FH2

Will this be part of the fixed 1.1 or for the next patch?

Btw, Luttich definitely crashes now - Don't know what it is though - I get it in every game since 1.1's release

EDIT: I also think mg34s and 42 should be have longer-range accuracy - Currently they are only accurate for the first and perhaps second bullet, then they are fired overhead. These should be used from the current long-range you set with accuracy enough to punish the allies for not taking cover





« Last Edit: 10-03-2010, 17:03:31 by djinn »

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #26 on: 12-03-2010, 22:03:15 »
The Luttich crash bug is really annoying. I've no idea what causes it - as usual - since BF2 doesn't give any sort of error message; this is one of the most infuriating aspects of BF2 modding and must have wasted many other modders countless hours tracking down bugs that would be easily fixable if you just got an error message indicating what caused the crash.

I played this map (64-player version, with 48 bots) twice today, once as Allied - crashed after about 15-20 minutes - the second as Axis, which lasted much longer, crashing at 40-45 minutes into the game. In both games, each CP changed hands at least once, so the crash isn't caused directly by an object spawning; it's probably a vehicle crew position which isn't working correctly.

Anyone else have any comments on how long they've played this map before crashing, and what events might have caused it? And has anyone experienced CTDs on Luttich 64 with unmodded FH2.25 or with earlier versions of my AI minimod?


Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #27 on: 13-03-2010, 20:03:37 »
Here's another little thing. As I did after the relase of 1.0, I will list a couple of prevailing issues in 1.1:

1/ the 88 doesn't see infantry until close up - As a dual-purpose gun, it is slow firing and vulnerable to infantry at close range, it should however be able to wreck havok further off... perhaps give it half the range it has for tanks, for infantry i.e HE targets, but definitely longer range than bot riflemen (Recommend original LOS value, 2.2)

2/ Planes DO have a reduced line of sight for ground targets with regard to their use of mgs.. they used to fire at you from range, now they dip-dive on you at really close up - Sure they are more accurate at this distance, but they also have shorter time to fire and are even more vulnerable to AA guns which they wont fire at until too close... (Recommend original LOS values, 2.25)

3/ the bofers AA gun - Also might be an issue with LOS  - (Recommend original LOS values, 2.2)

4/ For vehicle-bail values, you might want to take a look at the unpatched FH 2.2 instead of experiment to find a solution for the issue created by 2.25 - and take a look at some of those figures instead, because personally, I think the values never got better after that - Bots from to 2.0 to 2.2, if I recall correctly would bail if you did and used vehicles to get where they were going and only remained in it if it remained useful eg. tanks - If a vehicle was heavily damaged, they might bail from it.

The only real issue it did have with their preference for vehicles was the heat of each vehicle - the chevy was a real issue because bots liked it so and this was for positions not neccesarily part of the firing points, which made them camp at the gate of Supercharge's town instead of getting off and going on foot

Try using your values for each vehicle with the general bail-value from 2.2 and see how that works - Also look at vanilla values as bots really know when to bail vehicles and flee when it was terribly damaged.

Also, bots really don't like most mgs still, besides the mg15 and perhaps the vikers... mg positions should really be of more of a priority (or as much of a priority) as AT gun positions, which are usually in the same area

ps. the 88 also has multi-firing sound like the 2pdr and hanomag mg34

« Last Edit: 14-03-2010, 00:03:31 by djinn »

Offline CBCRonin

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #28 on: 14-03-2010, 03:03:51 »
Anyone else have any comments on how long they've played this map before crashing, and what events might have caused it? And has anyone experienced CTDs on Luttich 64 with unmodded FH2.25 or with earlier versions of my AI minimod?
Played it for a good twenty minutes as allies; with flags at the farm, church, and both in the town changing hands with no problems.

It didn't start crashing until I went to the church area:

-Picked up a flamethrower and exited the small side door, crash.

-Entered the churchyard after walking from the northern town flag, crash.

No combat was occurring nearby.
--------------------
I would have initially said it might have something to do with a sound file 2.25 (maybe an ambient church sound), but if that was the case the mp players would be having the same issue.

I did notice that the axis bots did not bring the panthers into the battle, but I haven't tried to enter them yet to see if the issue is there.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.1
« Reply #29 on: 14-03-2010, 08:03:07 »
Weird as Hell but true... I started up Luttich, trying to cause a CTD and see what caused it. Took the suspected walking Stuka - changed to all positions.. nada... saw bots drive it off, one in position 5, one as driver, nada... saw Panthers and PzIVs on the battlefield... Saw on the minimap, allied tanks coming in force, nada... Spawned as American, tried all their tanks and armored car... nada

Then out of frustration, and seeing  STuG at the church, I decided to kill it with comp. B and afterwards grabbedthe flaethrower, pushed fire and it CTDed!

I doubt this is related to the original issue, or its just a very weird coincidence that it occured right when the culprit caused the crash, but its certainly another thing from SP minimod 1.1