Jump to content

Pathfinding on roads and bridges is utterly bizarre


Recommended Posts

I'm doing a scenario where there's a straight road with a bridge in the middle.

Problem: When I order a halftrack to move down the road, it will do everything it can to avoid crossing the bridge. This includes turning around, driving back, crushing through hedges and going offroad, then moving forward on the side of the road, passing the spot it's supposed to go to, then crush through other obstacles, return to the road, then turn around and drive back to the destination spot.

If I order the halftrack to move right up to the bridge and then cross it, and then continue, it sort of works. But any longer movement order, and this behaviour starts to happen.

Link to comment
Share on other sites

57 minutes ago, Bulletpoint said:

I'm doing a scenario where there's a straight road with a bridge in the middle.

Problem: When I order a halftrack to move down the road, it will do everything it can to avoid crossing the bridge. This includes turning around, driving back, crushing through hedges and going offroad, then moving forward on the side of the road, passing the spot it's supposed to go to, then crush through other obstacles, return to the road, then turn around and drive back to the destination spot.

If I order the halftrack to move right up to the bridge and then cross it, and then continue, it sort of works. But any longer movement order, and this behaviour starts to happen.

too ad ga,e still hass these problems. can you do without the bridge or change the type of the bridge?

Link to comment
Share on other sites

4 hours ago, mbarbaric said:

can you do without the bridge or change the type of the bridge?

Well the bridge is not critical, but it plays an interesting role  both for gameplay and for the beauty of the map, so I want to keep it.

I actually managed to solve the problem by blocking off all other paths that the halftrack could possibly take, so that there's only one way forward. Which is a pity because I wanted the player to have some more freedom about where to go.

Link to comment
Share on other sites

I've suddenly begun noticing some peculiar path finding problems recently as well. These are not confined to vehicles, although their tend to be more dramatic, but personnel exhibit them as well sometimes. Occasionally the problem can be explained by a too long movement segment having been plotted. This is a known problem going back at least to CMFI. The AI of the moving unit tries to find a path of least resistance between the end points of the movement leg according to its own internal logic, and this is what leads to unpredictable behavior. The way out of this is first of all to make certain that there is no impassable terrain that movement has been plotted into or over. Secondly, to give very short movement legs, especially where terrain occurs that might present a bottleneck or other inhibition to free movement. But sometimes, one just can't find a rational explanation or cure and that piece of terrain will have to be avoided entirely.

I had a recent example of the latter. I had played the scenario "Cats Chasing Dogs" and had had my ACs enter a particular patch of woods with no problem. However, on a subsequent playing of the same scenario, they absolutely refused to enter the woods, and took bizarre paths to avoid it, ending with getting shot up. Needless to say, I was considerably exercised by this turn of events, so I backtracked to very carefully check to see if any part of the woods had become impassible during some intervening patching. Nope. No obvious problem there. Finally, I had to give it up and just ascribe it to bad ju-ju. I chose to emply different tactics and the game proceeded otherwise normally.

Michael

Link to comment
Share on other sites

Try putting road tiles on a AI game under a large bridge, instead of water, and avoid overloading bridge.

Just finished a scenario where a bridge crossing by the AI is important. Problems I had was 1in 3 games ended up with bridge blocking due to vehicles or armour "humping" or freezing.  Ended up putting tiles under the bridge and spreading out the convey. If you want to take a look at it ... just posted it to proving ground. Link below. 

http://www.thefewgoodmen.com/tpg2/cm-battle-for-normandy/sl44-2-ai-invasion/

Only put these precautions in the AI game... In addition ensured the water around the bridge is at a ford level, just in case, as this will allow vehicles to bypass the bridge.

Link to comment
Share on other sites

1 hour ago, Nelson 1812 said:

Try putting road tiles on a AI game under a large bridge, instead of water,

There's actually no water under the bridge, the scenario is taking place in late summer in Normandy, and the bridge is a place where water runs off farmland during the winter. The actual terrain tile under the bridge is "dirt red".

Even if the game mistakenly thinks that it has to cross one tile of dirt, this should not mean that it decides to take a huge detour to avoid it.

Link to comment
Share on other sites

A related topic is how infantry will go out of their way to run on roads. This is a problem because there is no cover on a road. This is especially apparent when designing AI plans. It's very difficult to make the AI troops not get attracted to the road like a magnet, even from a considerable distance.

Link to comment
Share on other sites

9 minutes ago, Bulletpoint said:

There's actually no water under the bridge, the scenario is taking place in late summer in Normandy, and the bridge is a place where water runs off farmland during the winter. The actual terrain tile under the bridge is "dirt red".

Even if the game mistakenly thinks that it has to cross one tile of dirt, this should not mean that it decides to take a huge detour to avoid it.

I would still give a try... a road that is, it may give the units a directional lead.

Link to comment
Share on other sites

There has always been a problem with making waypoints too far apart.  You are just asking for trouble.  And it's clearly too complex/expensive to program movement paths any better.  It just needs to become a player's SOP to make close together waypoints when in restricted terrain.

Link to comment
Share on other sites

38 minutes ago, Wicky said:

<Snip> I've found no problems placing one in the action square on the road just before the bridge and the next one over on the other side with none between. 

This works for me also.  There were some long discussions about waypoints / pathing and bridges here on the forum.  I think most of these discussions were just after MG came out.  From those discussions the consensus was to place one waypoint just before the start of the bridge and the next waypoint just after the end of the bridge.  This works for me most of the time.  A problem may yet arise if the vehicle takes incoming fire while crossing and the AI takes over.  Then the crossing might turn into a Benny Hill show.       

Link to comment
Share on other sites

14 hours ago, Nelson 1812 said:

...spreading out the convey.

This is the cure for a lot of vehicular traffic jams. Generous spacing and the use of the Pause button are important, especially if bottlenecks like bridges or gaps in hedgerows come into the picture. These would inherently be problematical and I kind of get the feeling that BFC may have gone a little too far in depicting that fact.

The real problem for me is that as I posted, some terrain became impassable overnight and the path the vehicle had chosen instead defies all reason. Much better might have been for the vehicle to simply halt (although even this could be problematical as well; but to me appears to be the lesser of two evils).

Michael

Edited by Michael Emrys
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...