Author Topic: Bot Navigation Tweaks  (Read 12736 times)

Offline im_a_lazy_sod

  • Jr. Member
  • **
  • Posts: 189
    • View Profile
Re: Bot Navigation Tweaks
« Reply #30 on: 24-11-2010, 04:11:32 »
very nice  ;D

good work - keep it up  8)

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: Bot Navigation Tweaks
« Reply #31 on: 24-11-2010, 09:11:53 »
...The whole idleling bots on Operation Cobra is due to faulty AI for the colt1911...
It'd also explain the AT bots idling on Brest as well. Nice find boss... :)



@Void: Looks much better, although that gate isn't particularly narrow. They move more smoothly too by the look of it.

How do they handle the bridge crossing?

When the squad screen pops up near the end of the vid, most of the bots appear to be clustered at the bridge. But that could've been due to them all arriving there at the same time... :-\

And there's the real test for ya: How long does it take that traffic jam to clear?

Another good test: How do they handle the "barricade chicane" leading into Toujane?

Offline Void

  • Moderator
  • ***
  • Posts: 162
  • AI Dev
    • View Profile
    • ESAI at Moddb
Re: Bot Navigation Tweaks
« Reply #32 on: 24-11-2010, 18:11:47 »
Quote
How do they handle the bridge crossing?

The tanks are doing much better at the bridge, but so is the German Stuka that usually blows them to pieces. I'm still finding that the trucks don't like the bridges so much, though they do seem to be crossing with a little less difficulty.

The biggest problem with those narrow bridges is that tanks like to shoot at targets on the other side before crossing. This delay results in vehicle jams that the Stuka puts an end to all too swiftly.

(I think I may have made the planes more dangerous, but I'm not really sure.)

Quote
When the squad screen pops up near the end of the vid, most of the bots appear to be clustered at the bridge. But that could've been due to them all arriving there at the same time...

Yeah, that is pretty much the situation. I can get all the vehicles to the bridge much more efficiently, so it is a greater challenge for them to all navigate around each other and get across it while under fire.

Quote
Another good test: How do they handle the "barricade chicane" leading into Toujane?

They handle it poorly, but they handle it better than they used to, if that makes sense. I've had multiple test runs where a brit tank made it all the way to the Toujane flag cap radius. I've seen this with both Shermans and Crusaders.

In summary, there is still much work to do, but things are getting a bit better.

Finally, I have a silly question: How to run FH2 under the debugger? Do I need to manually move some shader files around and just launch FH2 as I would any other mod? Is there an argument I can pass to FH2.exe ? I want to measure true vehicle max speeds, among other things.

Offline Zoologic

  • Masterspammer
  • ****
  • Posts: 4.141
  • In FH Since 0.67
    • View Profile
Re: Bot Navigation Tweaks
« Reply #33 on: 25-11-2010, 04:11:20 »
The bots don't have to be human-perfect when driving vehicles. It is the map design which requires elite BF2 players do just that. FH2 is too cumbersome in some aspects, but this is realistic according to the real WW2 events, as German lines of defenses made by Rommel is really hard to penetrate IRL.

I think the bot target spotting range is a bit too far, they engaged targets with almost no priority. E.g. exposing itself, blocking narrow pathways, stopping in the middle of nowhere just because they spot a target and start exchanging fires (not to mention their somewhat poor marksmanship). They might not insta-gib players or other bots, but their gunnery skills are frustrating, and some tanks don't move at all until they destroy their target. It takes them quite a time to do just that.

Offline Void

  • Moderator
  • ***
  • Posts: 162
  • AI Dev
    • View Profile
    • ESAI at Moddb
Re: Bot Navigation Tweaks
« Reply #34 on: 25-11-2010, 04:11:21 »
Quote
I think the bot target spotting range is a bit too far, they engaged targets with almost no priority. E.g. exposing itself, blocking narrow pathways, stopping in the middle of nowhere just because they spot a target and start exchanging fires

Hey zM. Don't worry, the bots will never be human-perfect tank drivers. I'm just trying to make them better.

I quite agree about engagement range, and it is frustrating when I watch a tank go into its Fire behavior when there are really no feasible targets in sight. I've been dealing with this in two ways. First is lowering the weight for the tank Fire behavior, the second is reducing the engagement distance from a kilometer to 750 meters. (I still think that is a bit far, but I didn't want to change it too much).

I spent a full day today in FH2 AI hacking, and have results to share. It is another video clip. This time, you get to see a PZIV navigate on Goodwood. It crosses the underpass, makes its way through a narrow fence gap (twice for some reason), crosses the railroad, and then gets blown to bits by a Sherman.

Thus is my progress to date. Anybody wanna see?

http://www.youtube.com/watch?v=VT7-xKQ11QU

It is 4 star entertainment, let me tell you.

Offline Devilman

  • I belong to Naughty Club
  • **
  • Posts: 274
    • View Profile
Re: Bot Navigation Tweaks
« Reply #35 on: 25-11-2010, 07:11:28 »

I quite agree about engagement range, and it is frustrating when I watch a tank go into its Fire behavior when there are really no feasible targets in sight.

Bots will not fire at nothing
they precalculate every projectiles trajectory,and wont shoot unless they have a chance of hitting their target
Just because a human cant see any feasible targets,doesnt mean,that there arent any

by reducing their engagement distance,you can bring them more into the battle,instead of being 1km away
also with a longer engagement distance,their deviation should be reduced

A default BF2 & AIX tank,has an engagement distance of 150 meters,for their main weapon
1km is ridiculous

i just quickly looked,most FH2 tanks (that i looked at) have an engagement distance of 500
except for this one  :o

Quote
weaponTemplate.create M2A1_105mmgunHE_AI
weaponTemplate.indirect 0
weaponTemplate.minRange 25.0
weaponTemplate.maxRange 2500.0

Offline Void

  • Moderator
  • ***
  • Posts: 162
  • AI Dev
    • View Profile
    • ESAI at Moddb
Re: Bot Navigation Tweaks
« Reply #36 on: 25-11-2010, 08:11:14 »
Quote
Bots will not fire at nothing

I'm running in AI debug mode. It shows what the bot's behavior is at any given moment. Bots are switching to the Fire behavior and trying to track a target and failing. It interferes with navigation sometimes.

Bots will not fire at nothing, but they will try to fire at a target yet fail to fire a shot at all.

Offline Devilman

  • I belong to Naughty Club
  • **
  • Posts: 274
    • View Profile
Re: Bot Navigation Tweaks
« Reply #37 on: 25-11-2010, 09:11:57 »
Quote
rem *** Construct Tank weights ***
aiSettings.createBehaviourModifiers TankWeights
aiSettings.setBehaviourModifier Avoid      1.0
aiSettings.setBehaviourModifier MoveTo      1.25
aiSettings.setBehaviourModifier Idle      0.001
aiSettings.setBehaviourModifier Fire      9.0

try reducing the fire to 7.0
and increase move to 2.0

Offline cannonfodder

  • Full Member
  • ***
  • Posts: 1.228
    • View Profile
Re: Bot Navigation Tweaks
« Reply #38 on: 25-11-2010, 09:11:19 »
...It is 4 star entertainment, let me tell you.

The lead actor didn't say anything and the plot was full of holes, other than that, very entertaining.


On a slightly more serious note: Underpass and rail crossing in one go without hesitation? Impressive... :)

Usually even if they make it through in one go, they creep through.

Offline djinn

  • Masterspammer
  • ****
  • Posts: 5.723
    • View Profile
Re: Bot Navigation Tweaks
« Reply #39 on: 25-11-2010, 09:11:24 »
Nooo. Please dont reduce the firing range. Its one of the things I love in 2.3 :-(

Offline Zoologic

  • Masterspammer
  • ****
  • Posts: 4.141
  • In FH Since 0.67
    • View Profile
Re: Bot Navigation Tweaks
« Reply #40 on: 25-11-2010, 12:11:53 »

i just quickly looked,most FH2 tanks (that i looked at) have an engagement distance of 500
except for this one  :o

Quote
weaponTemplate.create M2A1_105mmgunHE_AI
weaponTemplate.indirect 0
weaponTemplate.minRange 25.0
weaponTemplate.maxRange 2500.0

That's Howitzer gun artillery. They have to ridiculously increase the value so that bots will use arty effectively. Otherwise they are just manning the guns without doing anything real, since most arties are located far-off the battlefields.

Offline Void

  • Moderator
  • ***
  • Posts: 162
  • AI Dev
    • View Profile
    • ESAI at Moddb
Re: Bot Navigation Tweaks
« Reply #41 on: 25-11-2010, 22:11:36 »
Quote
try reducing the fire to 7.0 and increase move to 2.0

Way ahead of you man, though I'm using slightly different values. I'm also using a custom urgency curve generator for the tank Fire behavior, and it seems to help reduce the time tanks spend tracking extremely distant targets.

Quote
Nooo. Please dont reduce the firing range. Its one of the things I love in 2.3 :-(

I'm not changing the tank weapon AI templates, most of which do indeed have a max range of 500 meters. I'm only changing the culldistance for all the vehicles. This value is the max range that a bot can "see" an object, though bot "visibility" can be further reduced with level specific AI settings.

There are two of these, though I am not sure which one takes priority over the other:

In init.con, we have GameLogic.MaximumLevelViewDistance X
And in \AI\ai.ai, we have aiSettings.setViewDistance X

Quote
On a slightly more serious note: Underpass and rail crossing in one go without hesitation? Impressive...

Heh. cF, that clip was for you. What about the fence gate navigation, huh? The bot was so proud of itself that it went through that gap twice.

There is still a spot on Goodwood where tanks/halftracks/anything still always get stuck if they wander into it. It is a cluster of trees past the rail crossing surrounded by a partial stone wall.

I haven't looked in the editor yet, but I suspect that the trees didn't create a big enough hole in the vehicle navmesh to get bots to go around them. In AI debug mode I can see the bot pathfinding lines, and in this particular area the bots are trying to navigate through the trees instead of going around.

« Last Edit: 25-11-2010, 22:11:30 by Void »

Offline Devilman

  • I belong to Naughty Club
  • **
  • Posts: 274
    • View Profile
Re: Bot Navigation Tweaks
« Reply #42 on: 25-11-2010, 22:11:30 »
In init.con, we have GameLogic.MaximumLevelViewDistance X

is how far objects are visible,or cull distance/draw distance
normally used in conjuction with the fog distance



in \AI\ai.ai, we have aiSettings.setViewDistance X

is how far the bots can see enemies ingame
the one you want to change,(and it makes a noticable difference)

Offline Void

  • Moderator
  • ***
  • Posts: 162
  • AI Dev
    • View Profile
    • ESAI at Moddb
Re: Bot Navigation Tweaks
« Reply #43 on: 25-11-2010, 23:11:40 »
Thanks for the info Devilman. Was never sure on those two settings.

Can you by chance tell me how to load FH2 in the debugger, as I was asking in one of my posts above? I'm using AI Debug Mode in the retail game right now, but I really want to see the true vehicle max speeds...

Offline Devilman

  • I belong to Naughty Club
  • **
  • Posts: 274
    • View Profile
Re: Bot Navigation Tweaks
« Reply #44 on: 26-11-2010, 00:11:18 »
Can you by chance tell me how to load FH2 in the debugger,

Most maps crash the debugger before it finishes loading a map unfortunately
so you cant play in debug mode