Jump to content

Pathfinding bug theory (with screenshots)


Recommended Posts

I am playing a scenario in WEGO mode (v1.03) at the moment and have just received a pair of tanks lined up on a road. I ordered the tanks to move down the road. The lead tank moved down the road without any problems at all. However, the following tank made a mad detour.

I think I now understand what is causing this mad behaviour. The AI mustn't be anticipating where a vehicle will be in the future for a sufficiently short time-frame. If a pair of vehicles is ordered to move, the AI plots the movements for following vehicles as if the lead one was static. This is quite apparent from my screenshots below.

N.B. - Notice that I ordered a humvee to back off the road to allow the lead tank room to pass. The lead tank successfully stayed on the road so the game must anticipate future vehicle positions to some degree - just not quickly enough for close together vehicles.

Tank1.jpg

Tank2.jpg

Tank3.jpg

Link to comment
Share on other sites

Nice job of showing up a problem clearly.

They more or less have to do that though - base your route finding on the current map. An AI that attempts to plan its route based on what routes will be available at the time it is driving down them would be an nightmare.

One simple fix that might improve things would be to distinguish between permanent and temporary blocks (temporary being a vehicle that is still able to move). When faced with a temporary block, allow say 10 or 20 seconds for it to move, and if it hasn't go around. But actually that wouldn't work that well either - it seems to me that the only reasonable approach would be to drive to where the temporary blockage is and wait there (or not, if it has already moved), but I'm pretty sure that could generate some pathalogical behaviours too (of the 'failing to anticipate the obvious' variety).

No idea how well that would work in practice. It ought to work well in this particular case, but you never know what unanticipated side-effects will crop up.

Was the following tank given a pause command? And would that make any difference? If the path is calculated on the fly as the vehicle starts to move, the a long enough pause to allow the front vehicle to reach open space (wide enough for the following tank to get around) ought to produce 'expected' behaviour (wouldn't help with trying to get a convoy of vehicles down a narrow road though - they'd be all over the shop). If the path is calculated in advance (and only altered due to changing situations blocking the pre-chosen path) then the pause might not help at all.

Link to comment
Share on other sites

Originally posted by TheVulture:

They more or less have to do that though - base your route finding on the current map. An AI that attempts to plan its route based on what routes will be available at the time it is driving down them would be an nightmare.

Except the lead tank manages to recognize that the Humvee further up the road is reversing off it and therefore does not make a detour. Clearly the AI can re-plot waypoints mid-turn to some degree already.

Was the following tank given a pause command? And would that make any difference? If the path is calculated on the fly as the vehicle starts to move, the a long enough pause to allow the front vehicle to reach open space (wide enough for the following tank to get around) ought to produce 'expected' behaviour
I didn't give the following tank a pause command. In CMx1 this was necessary only if the following vehicle had a higher command delay than the one in front. In CMx2, I've never seen any command delay in operation, even in WEGO mode (which in itself seems a step backwards).

I would tend to agree with Martin Krejcirik, i.e. the AI should ignore friendly units when plotting moves and just rely on collision detection (which is itself not well executed in CMx2 compared to CMx1) to stop a following vehicle long enough for a vehicle in front to move out of the way.

Link to comment
Share on other sites

Originally posted by Cpl Steiner:

Except the lead tank manages to recognize that the Humvee further up the road is reversing off it and therefore does not make a detour. Clearly the AI can re-plot waypoints mid-turn to some degree already.

There are two differences there. A) It looks like there is enough room to get around the humvee on the road, and B) whatever detour it plans to get around the humvee, it can follow the road for some time, whereas the following tank starts off pretry much at the point where it has to take its detour. When the takns get to their respective 'detour' points, one has a clear road and the other a blocked one. So it's not necessarily anything to do with anticipation.

I didn't give the following tank a pause command. In CMx1 this was necessary only if the following vehicle had a higher command delay than the one in front. In CMx2, I've never seen any command delay in operation, even in WEGO mode (which in itself seems a step backwards).

I would tend to agree with Martin Krejcirik, i.e. the AI should ignore friendly units when plotting moves and just rely on collision detection (which is itself not well executed in CMx2 compared to CMx1) to stop a following vehicle long enough for a vehicle in front to move out of the way.

Yeah - when it comes to AI progamming issues I tend to look for the problems with an idea straight away, which leads me to see problems that might not be there. The CMx1 system worked pretty well: ignore friendly vehicles as blockages until you run into them. Well, pretty well aside from it's ability to simulate traffic jams when trying to move a column...

So maybe try 'ignore friendly vehicles until you hit them (more or less), then wait time T (say 10 secs) to give them a chance to move before planning another route'. It will probably cause some odd behaviour, but will be more directly under the player's control, whilst being slightly more tolerant than CMx1. (Odd behaviour, like Cmx1 traffic jams, are much less of a problem if the behaviour is reliably predictable, because at least the player can know what effects his commands will have and use them accordingly). Might have some issues with losing vehicles to enemy action starting the 'death clock' ticking, while the following vehicle sits there (in the firing line) waiting to see if the dead vehicle is going to move. But hopefully the threat avoidance AI ought to kick in at that point and override the commands anyway.

Link to comment
Share on other sites

Why do you have a Humvee so far South when the tanks came online? All my guys were halfway to Gun when the heavy armor showed up. smile.gif

This scenario is great but killed my old rig.

Seriously, I had the same issues at the beginning of this scenario trying to get all the vehicles positioned safely because I did not know what was downrange.

Pathing needs tweaking and I am sure it will be taken care of in the near future.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...