Author Topic: AI tweak/fix mini-mod v1.0 ready for download  (Read 10271 times)

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #15 on: 09-02-2010, 13:02:19 »
The fighters in fh2 did use airbrakes until 2.2. And the beau stil droppd bonbs afta bf2 1.5, so thats not it

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #16 on: 09-02-2010, 18:02:13 »
I -think- I may have solved the problem with the Stuka's kamikaze diving, it appears to be caused by the AI input to select the rear gunner position (in objects.ai) being set to PIMenuSelect2 (which should be the key to switch between 50kg/250kg bombs), rather than PIPositionSelect2. I added the bomb select key (missing from the default files). This didn't cause any problem in default FH2.25 as there was no bomb select key in weapons.ai, but I added one (without spotting the error in objects.ai) so presumably when the bot pilot got within range of the enemy and attempted to select a bomb type, he instead started switching between the pilot and gunner seat, causing the plane to crash.

Fixing this error makes the Stuka much less prone to crash into the landscape, but it still flies very sluggishly, doesn't attack anything, and usually ends up getting killed by flying out of the playable area.  The AI control input parameters for the Stuka are also set to be much less sensitive than other aircraft (including the Ju52); I suspect this is the cause of the latter behaviour, so will change it and see what happens. Still no guarantees I'll be able to get bombs working, though...

I haven't really looked into the fire rate issue with semi-auto rifles yet, but I suspect it's because these guns don't actually have a fire rate defined in their .tweak files, they fire as fast as the player can click the mouse button. Since bots don't need to use a mouse, they can fire them a lot faster than a human player 
 ;D
I've also done some more tweaking to the tank gun + MG files, and have made a couple of changes that seem to make tank vs. infantry combat work better; firstly, I gave AP shells a strength of 0 vs. infantry for all tanks that have HE shells, secondly I gave coax MGs a much higher strength (15) and reduced their range to 150. Within this range tanks will prefer to use MGs rather than shells against infantry, beyond it they'll fire HE shells - at least in theory. I think part of the reason for the erratic behaviour of tanks was that HE shells and MGs had a similar strength vs. infantry, the bots couldn't decide which to use!
I've also reduced the minimum range of AP shells to 1 and HE shells to 5.

Offline Raziel

  • Jr. Member
  • **
  • Posts: 859
  • Bullet Magnet
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #17 on: 10-02-2010, 09:02:55 »
Woohoo! Thanks Drawde! You are making real progress!! ;D

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #18 on: 11-02-2010, 12:02:15 »
Excellent work, Dawde. By the way, great job on kit mg gunners. The really impact as they should.

Bots however only fire mortar bombs at vehicles and never infantry.

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #19 on: 11-02-2010, 16:02:00 »
Woohoo! Thanks Drawde! You are making real progress!! ;D

Unfortunately NOT much progress with plane AI  >:( although I think I've managed to get tanks working reasonably well.

Bots definitely seem to use handheld LMGs more effectively than they used to, though getting them to use deployable weapons sensibly may be beyond BF2's AI limitations.

Also, infantry weapons have the highest priority for AI mortars, with heavy armour the lowest... seems to be another example of the AI doing exactly the opposite of what the game files tell it to do.
« Last Edit: 11-02-2010, 16:02:01 by Drawde »

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #20 on: 11-02-2010, 21:02:54 »
Im surE if bots got the same priority for other mgs as they do for the mg15, they shouldn't hav an issue with deployables, granted that the deployed ones like the vikers are added to the mg list. Bots after all use deployed mortar as readily as the would stationary ones.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #21 on: 12-02-2010, 01:02:27 »
Also mortar is actually pretty darn inaccurate. This isn't top priority at all, but perhaps if bots could use mortar on moving targets with an algorithm similar to other projectiles it might be able to 'lead' targets more.

Also an increase in line of sight might make it more effective. Currently it fires within ranges of only half that of cannons

Oh and if you fix shell selection for tanks, please note, the 88 and AT guns have it too

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #22 on: 20-02-2010, 19:02:12 »
Is the fix for tanks shel selection small enough that it can be posted to be DIY?

Also, perhaps the Stuka can be made to use both mg and bombs in any attack on soft targets. When at bomb range, it will automatically stop firing as it wont be aiming at that target any longer.

Also, if mame to fly higher, it could avoid AA more and do steeper dives. After all, it does dive already.

You just miit want to adjust the height at which it drops bombs so it can recover in time.
I guess the divehorn could be like the mg and bombs i.e 'fired' once on a strafing run.

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #23 on: 20-02-2010, 20:02:59 »
Hopefully the next version of the mod should be ready within a few days. I just need to test it a bit more to check that all the aircraft are still working correctly. It also has some improvements to tank gun/MG use (doesn't fix it entirely, there still seems to be a random element involved) and entirely prevents AT guns (and tanks with HE) from firing AP shells at infantry.

I'm not sure whether it's possible to control the flying height of AI aircraft, or if this is map-specific (they definitely seem to fly higher on some maps than others)

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #24 on: 20-02-2010, 21:02:44 »
Wow! Can't wait. Btw, any chance of getting bots to be able to bail vehicles? Not static ones, but mobile ones, specifically positions that don't make bots
useful to the battle such as external positions on tanks, all gp vehicle positions and all positions within apcs save for mg position. If the driver gets to a flag surroundee by a minefield, he should be able to get out, cap the flag and get back into his vehicle afterwards.

Only tank drivers and mg positions on vehicles should be camped

Also, any luck getting bots to use mgs of all kinds using the mg15 code?

I played earlier, alamein with 64 bots in sp and 1.0 difficulty. Aircrafts, even with just mgs are able to destroy gp vihicles in one run! I was on foot and got strafed by a bf109 firing simple mgs. It killed me and blew up two trucks next to me!

88 become more accurate than tanks with their range, but AT guns get too accurate.

A single 6pdr held off the german offense from the frontline Brit base, destroying pz4s as far as Kidney ridge!

A possible counter will be to get tanks firing ap and he at same strength on the offending gun. Ap will kill it, but tanks not being as accurate as AT, can kill the gunner with HE too. Same goes for all stationary vehicle positions: HE.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #25 on: 20-02-2010, 22:02:57 »
Perhaps Plane mg accuracy can be increased so that there is no need to play the insane 1.0 to have them get it right. They can then use cannons on other target types, like concealed positions and light armor.

Also any luck getting mortar and perhaps howitzers firing at unseen far targets by elevating their perspective. Planes see targets very far off on account of their height.

Im sure arty will be able to fire at range if this were done.

Finally, you might want to know that even with the absense of vehicles bots never fire mortar at infantry with the rarest exception of phl.

Should'nt arty be 1st and foremost anti-personel before antitank?

Offline Drawde

  • Jr. Member
  • **
  • Posts: 160
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #26 on: 21-02-2010, 21:02:44 »
Wow! Can't wait. Btw, any chance of getting bots to be able to bail vehicles? Not static ones, but mobile ones, specifically positions that don't make bots
useful to the battle such as external positions on tanks, all gp vehicle positions and all positions within apcs save for mg position.
...
Also, any luck getting bots to use mgs of all kinds using the mg15 code?

Not sure about the bailing/switching position - this seems to be one of the hardest aspects of the AI to get right. I think it's mainly related to the different Temperature and StrategicStrength values of different crew positions, but it seems very hard to predict exactly what the AI will do. This area of the AI worked really well in vanilla BF2, was completely broken in default FH2.25, and slightly improved with my AI minimod (bots aren't so keen to use passenger/tank rider positions, for example) but not by much - I'd like to get things closer to how they are in vanilla BF2, but am not sure how. (Even after giving tank rider positions - useless deathtraps for bots - a temperature of 1 and StrategicStrength of 0, I still see quite a few bots using them  ??? )

I think I've partly fixed the MG use issue, I originally gave MGs a very low StrategicStrength for offense, so bots didn't waste time sitting on them when they should be attacking - but it looks like this means that they very rarely use them unless their AI commander has specifically ordered them to defend a CP. I gave them a medium offensive StrategicStrength (4-5) and have noticed a few more MG kill message for bots since doing so.

I'm not sure if it's possible to change the AI view position on artillery without also changing it for the player. But the AI seems to be capable of spotting targets quite far away = a number of times when manning a 2pdr on Siege of Tobruk I've been "sniped" by the German PaK 37mm from beyond visual range!

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #27 on: 21-02-2010, 22:02:05 »
Yer, but those are usually placed with a large field of view - Once the bots' views are obstructed, they don't fire - That's why they fire at full range in El Alamein, but only rarely in most other maps.

I don't know about perspective for bots being the same for players either. What I do know for sure is that raising their view point when on the gun from the artillery piece to some 30 or 40 feets directly above, depending on the range of each gun will likely allow them to see targets that may have otherwise been obstructed by walls, topography or such and as long as it doesn't screw up their aiming, they should be able to fire at great ranges, lobing shells over buffs and walls and completely changing the gameplay... hopefully for the better, whether or not it changes players perspective too - After all, we only use 1st person view to calibrate the gun, not to aim it

Also, any chance German bots can get similar code for their gabellte ladung as the Brits get for charges?

thanks for the feedback...

Offline anglosaxon

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #28 on: 23-02-2010, 08:02:00 »
For some reason this tweak slows my co-op games down to 9fps.  Makes em unplayabled.  :(

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: AI tweak/fix mini-mod v1.0 ready for download
« Reply #29 on: 23-02-2010, 09:02:31 »
 ???

I don't know what would cause that...did you install it properly?