Jump to content

Here is how bad the movement code actually is, and it's not just "pathfinding"


Recommended Posts

We had a discussion over at armchairgeneral where people claimed the movement code isn't that bad, or that it's user error and obstacles or vehicle traffic is at fault.

I'm sorry, but it's not.

As people hopefully remember, I am not primarily bashing CM:SF for bad

pathfinding. What I mainly bash CM:SF for is that the pathfinding

is invoked in situations where it shouldn't, and wouldn't have

to. You see, in the following example I have plotted a complete path.

I don't want any pathfinding. It is absolutely unnecessary to go in

and rip control out of my hands and give it to the TacAI to draw a new

path.

As you can also see, there are no obstacles whatsoever and no other

vehicles involved. I hope this finally clears up whether that this is just

a traffic jam or congestion problem. It's not. Test in

CM:SF 1.02, veteran vehicle. Savegame available.

The first picture is the path that I plot for a Bradley. As you can

see, the path goes along a road. At no point in time does any

connection between two waypoints goes not towards the enemy. Every

subsequent waypoint is closer to the East. Also, note that all

waypoints are on the road:

path1_edit.png

And off we go. Looks good so far:

path1-1_edit.png

Oops, why is the thing going straight south now? Not too bad yet,

though:

path1-2_edit.png

And it kills one of my waypoints and draws it's own little path and

the fun begins:

path1-3_edit.png

So the re-draw of my waypoint didn't matter too much as it overshot

it's own goal anyway. Still not too bad:

path1-4_edit.png

Oops. Why the heck is this thing going straight Northeast now? Compare

to the last screenshot. Why did it overturn? Keep in mind the vehicle

is very slow now.

path1-5_edit.png

Argh! In all that derivation from my plotted path this thing now drove

into the sand and produced a dust cloud. Given that dust is not

subject to for of war in CM this is a bad thing.

path1-6_edit.png

Link to comment
Share on other sites

  • Replies 300
  • Created
  • Last Reply

Top Posters In This Topic

Redraw another waypoint just for spite, also notice overshoot:

path1-7_edit.png

All right, now I'm pissed. The thing now has it's weak back armor

turned to the enemy. Note that the vehicle is fasing Northwest.

This is, precisely, why people think the movement in CM:SF is a

joke. There was no reason whatsoever in my plotted path to ever show

the back of the vehicle to the enemy. And no, there's no obstacles and

no other vehicles anywhere close to my original plotted path

path1-8_edit.png

We could end this session right here as my point is proven, but let's

observe a little more.

Nuked another of my waypoints:

path1-9_edit.png

And another one. Compare the path it's plotted now with the one I

ordered:

path1-10_edit.png

Now why is it facing straight west given the above waypoints it

picked? I just can't figure it out:

path1-11_edit.png

Nuke another perfectly fine waypoint and at the same time face in a

direction I can't see why it would given either my or it's own

waypoints:

path1-12_edit.png

Bingo. Back to the enemy. Again.

path1-13_edit.png

The driver is drunk. Or somefink:

path1-14_edit.png

Link to comment
Share on other sites

Very drunk:

path1-15_edit.png

Fast forward. Now that thing is playing in the sand again. Why? Look

at the paths in the earlier screenshots. I can't figure it out.

path1-16_edit.png

More sandy excursions:

path1-17_edit.png

And we end with a total 180 degrees ass to enemy shot. Note that it

was actually 180 degrees, the screenshot was taken a second later. The

re-play in WEGO is useless here as the path isn't plotted in

re-play. (Why, anyway?)

path1-18_edit.png

As said, CM:SF 1.02, veteran vehicle.

So, no, I wasn't dreaming. I don't tend to imagine these things. And

no, they didn't fix it in 1.02. That would have been surprising given

nothing is mentioned in the changelog.

Link to comment
Share on other sites

Good catch, exactly details one primary reason I've shelved CMSF for now. Bad enough getting sucked into pre-orering the deluxe version for a mouse pad with key commands that don't mean diddley squat, but the path plotting of vehicles,(and the infantry dance of the idjits at each waypoint), is just too much for this old wargamer.

For now I shall simply revert to the standard grumble;

BFC FIX OR DOSOMEFINK

Link to comment
Share on other sites

Worth mentioning that I don't regret ordering the deluxe version (my wife loves the mousepad, BTW).

What I want is BFC smoothen out these things, I'd really like to enjoy the game and it's future incarnations. Even if I put down the CM:SF money just as a downpayment for the real thing, good enough for me.

It it has to be said that the above behavior needs to be modified to make the game an enjoyable experience for me and not considered a joke outside this forum.

Now, I know that this models "overshoot", a physical event that would be desirable to have in the game. But the way it's implemented now it's is both annoying and not realistic.

Link to comment
Share on other sites

Originally posted by mitchell58:

I think I read on another post something about moving vehicles, and it said something about the speed having to be one on straight lines and reduced on corners or turns,,,,????Anyone remeber???

Right. What the code should do is slow down so that the corners (and that means the corners I plotted) are reached at a speed where the abstraction for the turn (CM vehicle can only pivot) can kick in without deriving from the path or direction in significant ways.

Since CM only has straight lines between waypoints that bit of abstraction is unavoidable. Trying to re-introduce non-straight movement via the back door might sound like a good idea, but it's not working as currently implemented.

Link to comment
Share on other sites

When I saw units not following their plotted path I always thought it was responding to some threat on the map. It's now clear even with no threats, units just don't follow the paths plotted. They move to new plotted point before they complete turning to the path.

It looks like the Eric Young school of drunk tank driving smile.gif

Nice going RedWolf!

[ August 24, 2007, 10:20 AM: Message edited by: pad152 ]

Link to comment
Share on other sites

Originally posted by thewood:

The problem is that sometimes they miss the waypoint so far that they come back to it, doing a full circle in the open. Beyond my own stupidity, its the top reason for Stryker casualties in my games.

THat can be an issue for strykers (I imagine) that have a non-zero turning circle and can find themselves in the position of trying to hit a waypoint that is too close and off to the side. But according to the first post these tests were done with a Bradley. Correct me if I'm wrong but Bradleys are tracked vehicles that can pivot on the spot - so turning radius shouldn't be an issue (the extent to which they can turn while travelling at full speed might be a factor there though).
Link to comment
Share on other sites

It's more than just missing and overshooting. Note that, in Redwolf's case example, on several occasions, the AI moved or deleted a waypoint before the vehicle even got near it.

Speaking as someone who is looking forward to joining the action around v. 1.05 or so, I do hope BFC puts some serious work into this before then. Whether RT or WEGO, it's just not fun to have to babysit your units, just to get them to follow a logical path of march, such as following a road with some turns in it. Some minor deviations from plotted path is probably inevitable and within limits even realistic. But gross replotting of waypoints and turning bassackwards to the intended angle of approach is just plain frustrating.

Sounds like 1.03 is still mostly focusing on performance and compatibility issues with some hardware setups. Hopefully, 1.03 will get these issues out of the way, BFC can devote some serious time to improving pathfinding in 1.04 & 1.05.

Cheers,

YD

Link to comment
Share on other sites

Wow, are you sure there are no built-in logic that it's trying to avoid potential mine-threats? :rolleyes:

Seriously, your definitely right with the above. You should actually try that with all US vehicles just as an exercise. I would bet on one of the vehicles and see if it wins. Book the wagers!

Link to comment
Share on other sites

A quick note:

Back in the CMx1 days we plotted exact steps for a vehicle to follow. In CMx2 things seem to be different--waypoints are more about telling the unit where to go than about how to get there. You see this when you plot a straight line path for infantry, but they follow a meandering course in order to stay in cover on the way. Naturally this takes some control out of our hands.

I think we'll get used to the idea, although I'm not saying it's perfect.

Link to comment
Share on other sites

Redwolf, I think you'll find that if you watch it driving you'll see that it's trying to get to each waypoint even though it deletes the waypoint that it was heading to as it gets near. Basically the shown waypoints are visually inconsistent as a unit (veh or inf) approaches a waypoint.

From watching the AI (vehicle or infantry) move, there doesn't appear to be any interpolation from one waypoint to the next; they just go, turn, go again.

Ideally, barring an obstacle in the way, they would calculate an arc through the waypoint, slowing down only as necessary to remain on that arc.

Link to comment
Share on other sites

Originally posted by Martyr:

A quick note:

Back in the CMx1 days we plotted exact steps for a vehicle to follow. In CMx2 things seem to be different--waypoints are more about telling the unit where to go than about how to get there. You see this when you plot a straight line path for infantry, but they follow a meandering course in order to stay in cover on the way. Naturally this takes some control out of our hands.

I think we'll get used to the idea, although I'm not saying it's perfect.

Agreed, except that the problem is that we do have to tell the AI where we want it to go pretty much exactly. That's even been flat out stated by BF that if we want the AI to go a certain path, we have to plot it.

That's fine, except that then the movement between two waypoints needs to be refined so that the vehicle makes an actual curve rather than just a turn. In CMx1, if I wanted to make the vehicle retain a high rate of speed, I would plot out a nice wide arc. In CMx2, because the AI doesn't drive a straight path between two points (because it looks for cover, etc.) that will end up backfiring.

Getting a smoothly interpolated arc through a waypoint would, it seems, pretty much fix the problem with units overshooting waypoints and/or making ridiculously slow turns.

Link to comment
Share on other sites

There us a trade off between having to spend hours plotting simple movement orders (I exaggerate) to generate the exact effect you want vs having the AI interpret your orders to some extent (and inevitably getting it stupidly wrong sometimes).

COnsider the most extreme example of the first kind - you work with the 'primitive' commands. You can plot move orders, but only straight ahead. You can plot turns (with various minimum turning circles depending on vehicle and intended speed) and you have to string them all together in the order in which they occur. Now you can either have the computer check in advance that the path is feasible (doesn't clip any walls or any impassable terrain) and only allow orders that are physically possible - which may involve delete and replotting a fair sequence of moves as you try and get the position, direction and turn point right to get a stryker round a corner in a narrow street. Ot you can allow the orders to stand and the vehicle simply stops if it is unable to continue the command sequence for any reason (corner too tight, another vehicle blocks the way, for example).

This approach would probably be rather time consuming to plot all your vehicle movements (and possibly rather frustrating as you have to replot the entire movement sequence for a stryker 5 times to find a path that actually works).

At the other extreme you have something closer to (intended) CM:SF functionality, where you simply plot the end point that you want to get to, and the tacAI works out how to get there. But you have very little control over what path it choses to get there, and given the limits of pathfinding algorithms in mixtures of passable and impassable terrain, even a 'perfect' algorithm will do some things that seem crazy to a human (you really have no idea how good our brains are at this sort of stuff...). This makes for a very easy to use system (just stick in the final waypoint and off you go), but with limited control.

There are various grades in between of how much leeway the computer has to alter the path. The CMx1 system generally stuck very closely to the plotted path except where that path was impassable. And sharp turns would be converted to a series of smaller turns and smoothed out.

But in general the more 'low level' you make the commands (giving the AI less room to interpret or react) the more complex the interface has to be, and the more fiddly (and time consuming) to work with.

Maybe a compromise would be to distinguish between general "get there somehow, and don't bother me with the details" waypoints (like CM:SF currently) vs "drive along this exact line to this precise point" waypoints. Except that that would add even more options to the UI movement orders, and probably create more confusion (and annoyance when you mistakenly use the wrong kind of waypoint).

And here endeth my random uninformed thoughts on the subject. :D

Link to comment
Share on other sites

Originally posted by Martyr:

A quick note:

Back in the CMx1 days we plotted exact steps for a vehicle to follow. In CMx2 things seem to be different--waypoints are more about telling the unit where to go than about how to get there. You see this when you plot a straight line path for infantry, but they follow a meandering course in order to stay in cover on the way. Naturally this takes some control out of our hands.

I think we'll get used to the idea, although I'm not saying it's perfect.

That's great for, say, an infantry squad crossing a broken field with some intermittent cover. It makes sense that the squad wouldn't follow a completely straight line path, and I would love it if the game took care of plotting a more covered route within, say 20m or so of my plotted path, to save me the trouble of creating lots of short legs between small patches of cover.

But there also has to be a way to, for example, get a vehicle to follow a winding road without acting like an alcoholic out for a Sunday drive. Redwolf's path isn't that implausible -- it could easily be a winding road through Slum, er sumfink.

Link to comment
Share on other sites

Originally posted by vulture:

THat can be an issue for strykers (I imagine) that have a non-zero turning circle and can find themselves in the position of trying to hit a waypoint that is too close and off to the side. But according to the first post these tests were done with a Bradley. Correct me if I'm wrong but Bradleys are tracked vehicles that can pivot on the spot - so turning radius shouldn't be an issue (the extent to which they can turn while travelling at full speed might be a factor there though).

That's not relevant, IMHO. CM is a game where the movement commands can only be straight lines. So turns between these lines will always be "pivot-like", for all vehicles.

The only way to get rid of this is if BFC would instead of straight lines between the waypoint would let players plot paths using Bezier curves or something similar. That's not going to happen as it's overkill for most users.

So all vehicles in CM "pivot" between waypoints or at the beginning of a path if the facing wasn't right. This is a required abstraction and it really doesn't work too badly, IMHO. Or rather it would work pretty well if there wasn't some stupid code intervening trying to patch up this issue with something that is even more unrealistic.

Link to comment
Share on other sites

Originally posted by Martyr:

Back in the CMx1 days we plotted exact steps for a vehicle to follow. In CMx2 things seem to be different--waypoints are more about telling the unit where to go than about how to get there. You see this when you plot a straight line path for infantry, but they follow a meandering course in order to stay in cover on the way. Naturally this takes some control out of our hands.

Uh? My CMx1 didn't do this unless there was enemy fire. A bunch of waypoints was obeyed by infantry. My CMx1 infantry did not derive from it to seek cover unless cover was required by incoming fire.

Now, CMx1 vehicles showed some of the behavior that I demonstrate for CM:SF here. But much, much less. But yes I have seen CMx1 vehicle face their behind to the enemy after plotting courses straight ahead.

I think we'll get used to the idea, although I'm not saying it's perfect. [/QB]

Get used to it in the amount shown in my example screenshots above? Not going to happen, man.
Link to comment
Share on other sites

Originally posted by Cameroon:

Ideally, barring an obstacle in the way, they would calculate an arc through the waypoint, slowing down only as necessary to remain on that arc.

Even that is more complex than it sounds. DO you want the arc to go more or less through the waypoint? Or is it allowed to cut the corner>

If you allow corner cutting then you have to decide the speed of the vehicle through the corner and from that determine how tight a turn is possible, and therefore how much you cut the corner by (assuming no blockages). Which isn't too hard - until you start putting waypoints close together and the first turn isn't complete (and the vehicle therefore isn't back on the plotted path) before you are expected to leave the path again to make another turn at a different speed (as an aside it might be instructive to see how much the behaviour in the first post depends on having 2 or more waypoints close together - is it still a problem if all points are widely spaced?)

If you don't allow corner cutting and the vehicle has to follow a smooth curve that passes exactly through the waypoint then the problem is that you have to veer off the plotted path to hit the waypoint on the turn (look at the first left turn in the first post - to actually go across the waypoint on the turn, you have to start off to the right of the plotted track and swing back in - and to get to the right you have to turn off to the right at some point and then turn back left to line yourself up for the entry to the turn). And again, stick two waypoints close together and the whole thing can fall apart quite quickly as the algorithm tries to find a path that goes between the waypoints whilst tryig to follow the rules of the smooth turns it tries to make).

The only way to guarantee hitting each line and point is basically to drive in a straight line and stop and pivot on the spot at each turn (not an option for strykers either).

Link to comment
Share on other sites

Just an observation, but didn't

"BFC* fix or do somefink!"

Stem out of horrific CMX1 bugbears?

And speaking of CMX1 bugbears, try plotting right-angle corners with Stugs or something else with a fixed forward gun. ISTR that was a pretty bad problem that was never really fixed.

or with the reinterpolating waypoints, CMX1 did that too. Granted, with the slower AI it took longer than most people left the AI alone for to manifest, but it was there alright. Tanks would re-plot moves to give buildings and the like a wider berth, you could plot moves along lines that the tool indicated was alright but the tank wouldn't be able to complete.

Infantry, if given extended move orders, would re-plot moves to go through cover, often bunching and running into minefields while they did it.

*Although it was probably BTS to start with

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...