Jump to content

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


Recommended Posts

I think you'll find that the pathfinding usually does the right thing. But here's a suggestion.

The trouble with exact path following is that it only works properly at slower speeds. You can't have a Stryker rolling across the desert at 40 MPH and then at every (even slight-turn) waypoint pretty much stop cold, rotate in place, then continue. That would be frustrating and unrealistic.

But here's an idea... what if we programmed vehicles to use "exact" path following (assuming there is no blocking terrain) if you're using one of the slower speeds, like Slow or Hunt? Would that be acceptable?

Link to comment
Share on other sites

  • Replies 300
  • Created
  • Last Reply

Top Posters In This Topic

Hey Charles, don't see you often on this board, so while I've got you --

This is an awesome game system shaping up, and represents a fantastic, groundbreaking effort by a small gaming shop.

You guys are WAY out in front of the industry (and probably the defense community as well) on CMx2 in the most important areas, and DON'T let the critics (many of whom will agree with my general sentiments, however) make you feel differently!

Happy holidays!

Link to comment
Share on other sites

That would be acceptable to me - just played a small battle from CMMODs just to try out v1.05. I must say I like what I see so far.

I haven't got deep into it yet but it is looking good.

The pathfinding issue is what I saw that may still need tweaking. I had a Bradley that was stopped so I decided to reverse, face a different direction - then move forward. Instead it went forward and around a building then stopped - facing in the opposite direction of what I wanted. Thankfully no enemy in sight to blast away at it!

Why that happened I do not know.

Being able to program the idea below I think is a great idea for slower movement.

Originally posted by Battlefront:

I think you'll find that the pathfinding usually does the right thing. But here's a suggestion.

The trouble with exact path following is that it only works properly at slower speeds. You can't have a Stryker rolling across the desert at 40 MPH and then at every (even slight-turn) waypoint pretty much stop cold, rotate in place, then continue. That would be frustrating and unrealistic.

But here's an idea... what if we programmed vehicles to use "exact" path following (assuming there is no blocking terrain) if you're using one of the slower speeds, like Slow or Hunt? Would that be acceptable?

Link to comment
Share on other sites

Originally posted by Battlefront:

I think you'll find that the pathfinding usually does the right thing. But here's a suggestion.

The trouble with exact path following is that it only works properly at slower speeds. You can't have a Stryker rolling across the desert at 40 MPH and then at every (even slight-turn) waypoint pretty much stop cold, rotate in place, then continue. That would be frustrating and unrealistic.

But here's an idea... what if we programmed vehicles to use "exact" path following (assuming there is no blocking terrain) if you're using one of the slower speeds, like Slow or Hunt? Would that be acceptable?

That would be a big improvement.

What I think is a solution along these lines is to follow the user-plotted path and automatically slow down before turns so that the turn is taken at slow or hunt speeds. It would look a little funky because of the sharp corners resulting (a little CMx1-ish pivot from jeeps style) but right now it's even more funky looking.

That way you don't get any of that wrong-facing, you don't wander off into the veggies when the user plotted a path on a road and you don't expose yourself to enemy fire from a point on the map that the user never said to go to. And even though you have an automatic slowdown you don't get an overall slowdown compared to the current solution, because right now things pretty much grind to a halt repeatedly.

The alternative, to expect the user to plot sequences of slow points around the corners, is too micromanagish and doesn't mix at all with real time.

Link to comment
Share on other sites

That would be great. Maybe also if there is only a _single_ waypoint it could be made to try to follow the path exactly?

That way it would be possible to micromanage the unit through those small passages almost blocked, using a slow movement commands (seems to be a problem at the present) and on the other hand moving through terrain with no obstacles could be done with just using a single waypoint.

How hard would it be to first check if the given route is possible, assuming full stops, and then just fit the cornering to the route?

Say, we have in dense terrain a 100m straight line movement, then another 100m in a direction 90 degrees to the left from the first one. Now, the path finder first checks if the individual 100m movements are legal. If so, then try to fit a movement order something like this to the command: follow 90m of the first movement command exactly. Decide a cornering strategy so that we end up on the second line at the 10m point facing in the correct direction (*). Then just follow to the end of the command. This way there is only the 10m + 10m part that the path finder needs to deal with, the rest goes along the path the player gave.

* We know there is a solution, just try to find a better one than full stop and turn in place. If there is enough space, the cornering should be trivial to do. If there isn't enough space then this could be hard to check, don't know...

Link to comment
Share on other sites

I know this is heresy in this forum, but what was wrong with how CM1 did it? It generally followed my path unless a real unpassable obstacle got in the way. I never saw spinning or wandering off a path for no apprarent reason. It did have collision and traffic jam issues.

Link to comment
Share on other sites

"Cornering" - meaning when to break off from the "exact" path near a waypoint in order to avoid breaking the laws of physics while retaining (as much as possible) the following of the ordered waypoints, but also not grinding the vehicle to a near halt - at higher speeds is actually a tremendously difficult AI problem, especially when there is blocking terrain nearby.

However it's easier at low speeds, and (nearly) following an "exact" path is not so hard when moving slowly, and move-stop-pivot-move (if that is needed) is also less jarring and unrealistic if the idea was to move slowly in the first place anyway.

So I will explore this idea more, as well as more "exact" movement if there is only one waypoint. I think we can get something into v1.06.

Link to comment
Share on other sites

Thewood,

I know this is heresy in this forum, but what was wrong with how CM1 did it? It generally followed my path unless a real unpassable obstacle got in the way. I never saw spinning or wandering off a path for no apprarent reason. It did have collision and traffic jam issues.
That's because CMx1 didn't have deceleration modeled, nor was the system all that strict with physics of speed/distance to alter course. So what you see in CMx2 is the direct result of simulating real life vehicle physics instead of having a rather major abstracted model as we had in CMx1. It's amazing how good pathfinding can be if it only pays attention to player's input and terrain without regard to the laws of circumstantial physics :D

Steve

Link to comment
Share on other sites

Originally posted by Battlefront.com:

Thewood,

</font><blockquote>quote:</font><hr />I know this is heresy in this forum, but what was wrong with how CM1 did it? It generally followed my path unless a real unpassable obstacle got in the way. I never saw spinning or wandering off a path for no apprarent reason. It did have collision and traffic jam issues.

That's because CMx1 didn't have deceleration modeled, nor was the system all that strict with physics of speed/distance to alter course. So what you see in CMx2 is the direct result of simulating real life vehicle physics instead of having a rather major abstracted model as we had in CMx1. It's amazing how good pathfinding can be if it only pays attention to player's input and terrain without regard to the laws of circumstantial physics :D

Steve </font>

Link to comment
Share on other sites

If the path to be taken due to the waypoints was shown, and if any were invalid the line indicated where, the user would do the best themselves. Sort of like the targeting line except once past the obstacle it would indicate an achievable path again.

That way you'd either put in multiple waypoints to get the correct path, slow down or whatever.

IMHO it's the ability to plan that's needed, rather than AI to handle it for the player.

Link to comment
Share on other sites

Originally posted by Battlefront.com:

Thewood,

</font><blockquote>quote:</font><hr />I know this is heresy in this forum, but what was wrong with how CM1 did it? It generally followed my path unless a real unpassable obstacle got in the way. I never saw spinning or wandering off a path for no apprarent reason. It did have collision and traffic jam issues.

That's because CMx1 didn't have deceleration modeled, nor was the system all that strict with physics of speed/distance to alter course. So what you see in CMx2 is the direct result of simulating real life vehicle physics instead of having a rather major abstracted model as we had in CMx1. It's amazing how good pathfinding can be if it only pays attention to player's input and terrain without regard to the laws of circumstantial physics :D

Steve </font>

Link to comment
Share on other sites

IMHO it's the ability to plan that's needed, rather than AI to handle it for the player.
I agree with this completely, another way of putting it is that the issue is a result of an unrealistically high expectation that the game will know what you are thinking as it tries its best to observe the rules of physics and interpret your orders while "thinking" about TAC AI issues like self preservation in the face of an opposing threat. Hey folks there is A LOT going on here and to be fair pathing works pretty darn well now!

OM is right on here:

" it's the ability to plan that's needed, rather than AI to handle it for the player. "

Step up to the plate and plan your way points along the path in anticipation that the game will NOT put your AFV in the exact square meter or along the EXACT path that you have chosen. I think the Eagles said it best in their last tour (I know it was over a decade ago) "Get over it!" smile.gif

Improvise, adapt and overcome, the TAC AI and pathing are pretty darn good as it stands right now.

Sorry to sound so "harsh" about that, but there is only so much the game can do for you, and its just about at max efficiency now IMHO smile.gif

FWIW.

Link to comment
Share on other sites

Thewood,

So what is the point of having all those fancy word type things if it makes it just as unrealistic or maybe even less so.
There would be no point if your comments were accurate. They are not. I don't experience the sorts of problems you do, and yet we're playing the same game. So obviously the game is capable of doing the right thing if you learn how to use it correctly. Just because your thumb is black and blue doesn't mean the hammer is defective :D

Obviously some people, you and Redwolf in particular, are having some problems putting yourself in the shoes of the drivers of these vehicles and plotting accordingly. So I don't disagree that it would be good if we could figure out some sort of UI improvement that would at least alert you to the mistakes (and they are mistakes) you are making before they bite you in the bum. This is a much better thing for us to spend time on than neutering a system that functions correctly.

Is this a simulation or a wargame. I still can't figure it out. To me a simulation is a game where its more important how you get there. A wargame, while somewhat concerned with the journey, places more emphasis on what the end result is. I see CMSF taking CM more towards the simulation. A simulation is where little details like suspension moving or dynamic lighting seem to take priority over what impact they have on the outcome.
CM has always been a simulation, never a wargame, according to your definition. You can check back at posts from a decade ago and you'll see me saying exactly that. Otherwise we would have been happy with an overly simplistic core like Steel Panthers or Panzer General. And I'm not being snide here... CM was ALWAYS designed to be realistic, not gamey. Compromises in realism were made only when we had to.

If the CPU cycles had been available for us back in 1997 the vehicles in CMx1 would behave more like they do now than they actually did. That's because vehicle physics was probably the most unrealistic part of CMx1 and we were never happy about that. A vehicle that ways a couple dozen tons can't go from 35mph to 0mph in one nano-second, but they sure could in CMx1.

Steve

Link to comment
Share on other sites

Thewood,

Just saw your edit:

I want to add that the T72 was point straight at the Styrkers in completely open and flat terrain: no trees, buildings, gullies, etc. It went so far to the left on overcorrecting that it ended up coming at target over 20 degrees off its original tack. It showed its almost full broadside twice.
For all I know you found some sort of bug, but it's impossible for me to say because without seeing an actual save of this happening... I really don't know what to make of your description. Very often descriptions like this inadvertently leave out some sort of critical detail that explains what happened. Perhaps that isn't true in this case, but without seeing something I can't do anything.

Steve

Link to comment
Share on other sites

Originally posted by Battlefront.com:

This is the sort of thing that Charles says is quite difficult to do. For this to work, or at least to work well enough to matter, the system would have to precalculate the whole path in exact detail. I'm not sure if that is practical, but maybe it is. I get paid to answer questions, not solve them :D

Steve

Ha.

I reckon this is one of those complex compound issues, where having a single answer is very difficult;

What happens at speed, when the angle is too tight to achieve, when there's obstacles in the preferred path, when the user wants a specific armour facing, when they don't care how they achieve the objective, when any deviation from what's expected will result in serious consequences...many interrelated and contradictory factors.

Charles' idea of low speed having different behaviour is a good one (natch :D ) - the main issue I can see is if someone has a Stryker at top speed, then 2m of "hunt" and a sharp turn, they're going to get pathing errors as now. Still maybe user error like that can't be helped, and at least they will learn a lesson.

But really - and I know I bang on about this so please forgive me - it's the mis-match in expectation to "reality*". The approaches of changing the "reality" to conform to what the user wants exposes the solution to all the factors I've listed above, whereas if we front load the expectation by showing the path to be taken we get around them because the user will get the behaviour they expect and can change their orders to match what they want.

...but then, Charles is smarter than me, so lets leave it to him eh? :D

* in game reality.

Link to comment
Share on other sites

I don't mind if the vehicle doesn't follow the exact path. That isn't the problem. The problem is that sometimes the path finding algorithm screws up a simple (straight line, no obstacles) movement command. There are plenty of examples above. It doesn't happen often, but it happens (in v1.04 at least).

Now, to fix _this_ problem, the proposal is to follow the exact player given path if it is possible to do so.

The other problem is that sometimes the game doesn't see a path when the player can see there is a path. Now, there are people who think it might be good that the player could micromanage the unit through this path. Again I don't care if the unit moves exactly to the movement commands given. But again the proposed fix is to move exactly along the player given path.

Link to comment
Share on other sites

Again I don't care if the unit moves exactly to the movement commands given. But again the proposed fix is to move exactly along the player given path.
once again, I would like to suggest if this issue was as easy or simple to resolve as that:

" the proposed fix is to move exactly along the player given path" it would indeed already work that way in the game. (really)

So it doesn't, and there is probably a pretty good reason, the first one that comes to mind is simple kinetic motion physics. IMO FWIW

Link to comment
Share on other sites

Thewood,

Here's another thing to think about. Let's say we removed vehicle driving physics from CMx2. What would happen in WeGo if you saw an RPG coming at your vehicle when you start up your turn? Or a cannon shot? Why, you could halt the vehicle and the shots, which were aimed at where your vehicle would be if it kept moving (i.e. "leading the target) would zip on past harmlessly. I'm sure the AI wouldn't care, but another Human player is bound to kick up a fuss about such a think happening :D

What I'm saying here is that we didn't stick in vehicle physics because we thought it was cool... we put it in because it was a requirement to get an overall realistic result out of the system as a whole. Plus, we hated the gameyness of the "stop on demand" aspect of CMx1 since it could be taken advantage of and was.

Steve

Link to comment
Share on other sites

It's the outcome that counts.

I think we are all aware that all this is an attempt to model physics better.

But the results as shown in my screenshots are not an improvement realism-wise. The moves executed under the re-written path certainly are more realistic in the physics department. But while they might not break some G-force or friction limit, they are very problematic realism-wise when it comes to people's behavior. The paths chosen in my screenshots, in particular the facing their back to the enemy, driving right off the road and driving out of cover, are just not what is happening on a real military site.

A Jeep in CMx1 pivoting looks ugly and repulsive to knowledgeable people - but less so than the CMx2 dance of death.

In the end, this game is about tactics. The CMx1 unrealism of abstracting movement to follow edgy waypoints is really just a replacement for using bezier curves instead of straight lines between waypoints. It works pretty well and doesn't mess with tactics, an appropriate abstraction for a game. The CMx2 unrealism affects tactics, deeply.

I am a little confused that CMx1 didn't have deceleration modeled, Steve. Clearly sharp paths at high speed in CM had the vehicle slow down. CMx1 even had some "overshoot a waypoint" mechanism that went on people's nerves, but it rarely showed and you really had to race the vehicle hard.

Link to comment
Share on other sites

Hmmm,

Whatever happened to showing the AI waypoints AFTER the player waypoints are selected? So, I plot my FAST move Stryker to go 100m, then take a 90 degree left for another 100m. That's two waypoints. As soon as I deselect the Stryker, the AI waypoints appear: all 245 of them that plot the various turns, backups, move-ups, pivots, etc. Is that any sort of possibility? Or is the AI totally suspended in RT? In WEGO it should be possible to see the AI plotted paths BEFORE you click "go".

Regards,

Ken

Link to comment
Share on other sites

Originally posted by c3k:

Hmmm,

Whatever happened to showing the AI waypoints AFTER the player waypoints are selected? So, I plot my FAST move Stryker to go 100m, then take a 90 degree left for another 100m. That's two waypoints. As soon as I deselect the Stryker, the AI waypoints appear: all 245 of them that plot the various turns, backups, move-ups, pivots, etc. Is that any sort of possibility? Or is the AI totally suspended in RT? In WEGO it should be possible to see the AI plotted paths BEFORE you click "go".

Regards,

Ken

Right, that's another problem right now. The connection between plotting, path displayed and path executed.

If the path displayed in the semitransparent lines was the one that had already been "edited for physics" you could re-plot it and slow down if it's too crazy and you see ass-to-enemy segments.

But right now the path is only rewritten and redisplayed right in front of the vehicle.

This is a big problem for tactics, and unrealistic since a real drive would be able to make a turn approximately where he wants, since he has more than just straight lines between points far apart in his arsenal.

Link to comment
Share on other sites

SlowMotion ,

If following player plotted path would be possible at slow speeds, couldn't vehicles slow down enough before turning so that all turns would work like player has planned?
That's what Charles mentioned above. It's a LOT more difficult to do than it appears. At slow speeds the pathfinding basically can ignore things like deceleration because it isn't all that relevant since pretty much all vehicles behave about the same when moving slowly. As things start speeding up different vehicles and different circumstances become critical to path determination. Entirely new, and complex, forms of AI are needed to handle it.

Think about this in the real world. When you're driving around in a parking lot, how much attention do you pay to the physics of the path you're taking? If you're driving a proper slow speed, probably none. You know that you can stop at a moment's notice and you also have plenty of time to determine when to turn and so forth. Now, think of how stressful it would be to drive through the same parking lot at 50mph. That stress you feel is the weight of all the decisions you have to make quickly and exactly, taking into consideration vehicle mass, velocity, vector, etc. It's the same with the pathfinding.

Redwolf,

It's the outcome that counts.
Right, of course. Just like everything in the sim. People complained bitterly, at times, about some of the modeling decisions we made in CMBO because they weren't used to them. So their Tigers got brewed up because they were not using them in a realistic manner. Is it the game's fault that the "outcome" was so terrible, or the poor use of the game by the player? It's no different with pathfinding. If you insist on misusing and not attempting to understand how to move vehicles around, you will get bad results.

And that's the bottomline here, Redwolf. You are correct to say that if you do certain things with vehicles that very undesirable things happen. What you apparently refuse to see is that you can avoid the undesirable behavior by using the Commands better. Most people don't have the problems you have, or have them infrequently compared to you. Personally, I haven't seen a vehicle ass-end to an enemy in months. Even then the ones I can think of were due to bugs, not due to user error. So... if you want to think the game is at fault here, you can go on and think that. However, it would be more productive to investigate what you could do differently to get a better result. You can do that any time you choose to, but you do have to choose to.

But the results as shown in my screenshots are not an improvement realism-wise.
Actually, they are a huge improvement realism-wise. You're doing unrealistic things and the game is simulating them realistically. Therefore, the problem you're experiencing isn't an indication of a step backwards in terms of realism, rather it is an indication of "user error". Granted, we could do some things to highlight your errors better so you can learn easier, but I suspect you'd see much better results if you spent more time trying to figure out what you're doing wrong than complaining about it here.

A Jeep in CMx1 pivoting looks ugly and repulsive to knowledgeable people - but less so than the CMx2 dance of death.
If you don't like the feeling of a hammer slamming into your thumb, my advice is to learn how to use the hammer. I don't ever see a "dance of death" in CMx2, because I'm not making elemental mistakes when ordering my vehicles around. You can complain until you're blue in the face because the fact is that the behavior you're seeing is self induced and therefore avoidable.

In the end, this game is about tactics. The CMx1 unrealism of abstracting movement to follow edgy waypoints is really just a replacement for using bezier curves instead of straight lines between waypoints. It works pretty well and doesn't mess with tactics, an appropriate abstraction for a game. The CMx2 unrealism affects tactics, deeply.
Right, so don't use crappy tactics :D Or are you saying that we should make Tigers stronger and Shermans weaker when WW2 comes around because people want poor choices and improper use of the game's tools to lead to success no matter what? It really is EXACTLY the same thing. You want to make bad decisions and not get punished for them. That's not a "problem" we have any interest in solving tongue.gif

I am a little confused that CMx1 didn't have deceleration modeled, Steve. Clearly sharp paths at high speed in CM had the vehicle slow down. CMx1 even had some "overshoot a waypoint" mechanism that went on people's nerves, but it rarely showed and you really had to race the vehicle hard.
CMx1 didn't have a deceleration model. There was an abstract, generic system that was completely and utterly unrealistic situation that could be overridden at any time by the DELETE key. Effectively it was smoke and mirrors that worked out OK because the terrain was so massively abstracted and there were no ballistic flightpaths calculated. Therefore the abstraction worked out OK because it was in balance with the other abstractions, which is not possible in CMx2 because the other things aren't abstracted as much (or at all).

As I said above, I think we can improve the user interface to give players trying to do bad things, as Redwolf insists on doing, more information so that they can better learn how to do things the right way. Long term we may write complex AI to handle things on its own, but that's not on our immediate agenda. People learn how to use the tools correctly don't have problems, so inherently it is already within the player's ability to get desirable results. Therefore, we will concentrate our development efforts on things that the player can not control (like issues with Quick Battles, for example).

Steve

Link to comment
Share on other sites

C3K,

Whatever happened to showing the AI waypoints AFTER the player waypoints are selected? So, I plot my FAST move Stryker to go 100m, then take a 90 degree left for another 100m. That's two waypoints. As soon as I deselect the Stryker, the AI waypoints appear: all 245 of them that plot the various turns, backups, move-ups, pivots, etc. Is that any sort of possibility? Or is the AI totally suspended in RT? In WEGO it should be possible to see the AI plotted paths BEFORE you click "go".
I mentioned this a bit somewhere above or in another thread. The thing is that the vehicles follow paths on the fly, so there is no precomputation to show you. In CMx1 you would get that augmented path after the vehicle started moving. Because pathing was so much easier in CMx1 because of the highly abstracted terrain and vehicle physics, it was fairly easy for the system to show alterations. I am not sure it is that easy to do in CMx2. Long ago I did talk with Charles about it, though, because we figured there would be people like Redwolf would insist that the game was broken :D This is the sort of direction I think we should move towards in terms of getting players better feedback about the paths they choose and the ramifications that may result from it. Dumbing down the simulating because a few people refuse to learn how to use it properly is, of course, a bad way. Personally, I think a bit more feedback would be a good thing and it is something that I hope we can introduce sooner rather than later.

Steve

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...