Jump to content

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


Recommended Posts

  • Replies 300
  • Created
  • Last Reply

Top Posters In This Topic

If people will indulge me, a possible idea for a UI.

Certain speeds have minimum turn radii associated with them. Would it be possible to use that information to create a graphical representation of this, using the lines plotted between waypoints?

I've been on a CAD training course all last week and now I have fillet radii on the brain so this seems like a possible application.

The graphical representation would indicate the likelihood of it all going a bit wrong, based on the speeds and angles displayed. The further the curve from the waypoint, the bigger the problems.

Link to comment
Share on other sites

I'm a little confused here...if someone is dumb enough to request a vehicle to turn 90 degrees at 50 mph there are two reasonable solutions.

1. Have the vehicle slow down to a crawl before it tries to make the turn no matter what speed the orders specify. (just like you would do if you were driving. OR

2. Have the vehicle flip on to it's side and wreck or spin/slide (depending on the terrain and height of the center of gravity.)

Personally, I think number one is the reasonable answer since you aren't really driving and no one will purposefully get into a wreck.

Link to comment
Share on other sites

Which other game(s) require the player to order vehicles to slow down to make a turn at a road junction or corner?

I cannot recall ever having to drop a waypoint preceding a turn to "properly" slow the vehicle in anticipation of making a turn in X yards/meters.

In a tank sim, OK , that I can understand if I am driving the vehicle I need to drive it. Since CMSF is not a tank sim though you cannot possibly be arguing that to order vehicles to turn a corners, and behave normally like staying on the road, you need to micormanage the waypoints like that?

Link to comment
Share on other sites

Originally posted by Dirtweasle:

Which other game(s) require the player to order vehicles to slow down to make a turn at a road junction or corner?

I cannot recall ever having to drop a waypoint preceding a turn to "properly" slow the vehicle in anticipation of making a turn in X yards/meters.

In a tank sim, OK , that I can understand if I am driving the vehicle I need to drive it. Since CMSF is not a tank sim though you cannot possibly be arguing that to order vehicles to turn a corners, and behave normally like staying on the road, you need to micormanage the waypoints like that?

No, I'm not saying you should have to slow the vehicle down yourself (micromanage.) I'm saying the computer will do it for you in anticipation of making the turn. You would just need to realize that it will take a little longer to get where your going if there are a lot of sharp turns in your desired path.
Link to comment
Share on other sites

Redwolf,

So we are back at ignoring that the problem appears the same way when not using "fast", are we?
No, we're back to you ignoring the fact that the problem is inherently with you, not the game engine. I use FAST all the time and I NEVER see the problems you see. This is something you've dodged every time I've brought it up. Why? Because if you did acknowledge this point you'd have to admit that you're ultimately responsible for the units doing the wrong thing, but yet you are unwilling to do anything about it.

I VERY rarely tell someone a problem is "user error". This is one of those times. What I have said is that we probably can, and probably should, increase the feedback so players who aren't as capable of figuring out what to do on their own can have better feedback so that they can avoid mistakes.

Does this forum have kind of a "loop" feature, aka "goto 10 pages back".
I wish it did. I'd use it pretty much every time you get bee in your bonnet because you usually stop listening to anything anybody else says after page one. Out of all the posters that have ever been here, you are definitely the most stubborn to climb down off a high horse no matter how the discussion goes after you've mounted it. I take no offense to it because, as someone just reminded me, you do this when discussing other games as well :D

Having said that, I'll throw something back at you... what do you think the game should when a player has given a vehicle an absolutely impossible path to follow? You seem to be big on complaining, but not on engaging any of the rest of the discussion about the practical issues. In other words, all I've seen from you is "the game doesn't do what I want it to do, therefore it's broken". Hence why I agree with you a feature to go back to page one would be great since you don't appear to be at all interested in having a discussion.

Fortunately, others are :D

Flamingknives,

Certain speeds have minimum turn radii associated with them. Would it be possible to use that information to create a graphical representation of this, using the lines plotted between waypoints?
The short answer is "no, not in a practical way". It works fine when you're talking about plotting waypoints fairly close together in fairly straight forward terrain (open or roads, for example). It really doesn't work when players can put one waypoint 1000m away. There are probably dozens of turns that the vehicle will need to make unless the map has an obvious and straight forward path.

Think of a dense city street and putting down a waypoint 4 blocks over. There probably are several turns needed for that, and the speed will be variable depending on how long each of the straight bits are. So the minimum turning radius, which is speed dependent, really can't be shown to the user in a meaningful way.

Stellar Rat,

I'm a little confused here...if someone is dumb enough to request a vehicle to turn 90 degrees at 50 mph there are two reasonable solutions.

1. Have the vehicle slow down to a crawl before it tries to make the turn no matter what speed the orders specify. (just like you would do if you were driving. OR

2. Have the vehicle flip on to it's side and wreck or spin/slide (depending on the terrain and height of the center of gravity.)

Personally, I think number one is the reasonable answer since you aren't really driving and no one will purposefully get into a wreck.

Yes, and I've acknowledged this many times over already. The problem is that the game isn't currently coded to have this sort of super-smart driving AI because it is extremely difficult to code. When Charles, the guy who has programmed two game engines that nobody can hold a candle to in terms of complexity, says that something is difficult to program... well, that should mean something :D

Dirtweasle,

Which other game(s) require the player to order vehicles to slow down to make a turn at a road junction or corner?
CM does indeed slow down to take a turn at a road junction. But it's ability to perceive how much it needs to slow down, proactively, based on all the circumstantial situations is limited. That's where the nasty coding problems come in.

I cannot recall ever having to drop a waypoint preceding a turn to "properly" slow the vehicle in anticipation of making a turn in X yards/meters.
That's because they are like CMx1... extremely unrealistic. Games can do all sorts of things quite easily when they aren't bound to physics. Going too fast to go around that corner? No problem, make a minimum visual slowdown so it doesn't look super stupid, then let the vehicle go around the corner 5 times faster than it could in real life. Very easy to code that :D

In a tank sim, OK , that I can understand if I am driving the vehicle I need to drive it. Since CMSF is not a tank sim though you cannot possibly be arguing that to order vehicles to turn a corners, and behave normally like staying on the road, you need to micormanage the waypoints like that?
You don't need to micromanage. All you need to do is use the correct speed for the circumstances. Using FAST to move around from street to street in a tight urban area is a no-no. Don't do it. Use Move or perhaps Quick. And when you do use something that intuitively is too fast for the circumstances, try to make sure you're doing so in a logical way. For example, use FAST down a straight bit of road and do NOT plot any other waypoints. Let the vehicle go to the end of its movement and stop. If you don't want to do that, then use Move or Quick OR drop a Move waypoint ahead of your final destination and use Move from then on.

It really is that easy to do. Whether you avoid using FAST in tight terrain or CM treats it as MOVE, the effect is going to be the same. The difference is how many other game features we don't program so people can use something that should be obvious not to use. Because that's what we're talking about here.

Every day Charles spends on a super-duper driving AI is a day that isn't spent on something like improving Quick Battles. Since it is within every player's ability (if they aren't stubborn, that is) to get sensible driving behavior out of their vehicles, but it isn't within their ability to alter the way something like QB works, I would suggest Charles time is better spent on other things. I think the bulk of people here would agree.

Life's all about choices.

Steve

[ December 17, 2007, 10:49 AM: Message edited by: Battlefront.com ]

Link to comment
Share on other sites

Steve, I wasn't thinking anything like that complicated, although your answer shows the way of thinking that is behind how i works.

I was simply thinking something along the lines of:

cornering at fast, turn radius 50m.

when a way point is plotted, it will create two straight lines with an angle between them. The radius will fillet those lines with the associated radius to show just how far the turning limits will let you go. It doesn't involve altering the move, or accounting for terrain, it would be a fairly subtle, moderately transparent, representation of how tight you can turn at a particular speed.

Link to comment
Share on other sites

Flamingknives,

I was simply thinking something along the lines of:

cornering at fast, turn radius 50m.

when a way point is plotted, it will create two straight lines with an angle between them. The radius will fillet those lines with the associated radius to show just how far the turning limits will let you go. It doesn't involve altering the move, or accounting for terrain, it would be a fairly subtle, moderately transparent, representation of how tight you can turn at a particular speed.

Perhaps. It doesn't mean much if you're plotting widely spaced waypoints in complex terrain, but it does if you're trying to plot a more literal path. For those people who have problems with putting down paths, I think this would be helpful. It's kinda in the same vein as what I said earlier about it being possible to give better UI feedback. I've made a note to my note from your note :D

Dirtweasle,

OK, I got it, the player has to help manage the vehicle turning sharp corners because it uses real world physics. A sacrifice in the age old playability v. realism conflict.
Inherently, this is what it boils down to. If you look back a page or so you will see Redwolf basically implying that we should make CMx2 work like CMx1 in terms of driving physics. I quickly pointed out that if we did that it would screw up all sorts of other things in the sim that require the vehicles to behave realistically. The most important of which is targeting. So dumbing down the vehicle behavior to CMx1 standards, simply because some people find it easier, isn't the right way to go.

As I've also said, the "right" way to go is for Charles to write a highly complex driving AI that would be the envy of most driving sims. In order to make people like Redwolf happy, that's what we would have to do. But this comes at great cost to us from a development standpoint. Just like a Humvee can't take a 90 degree turn at 50mph, Charles can't put a month into coding driving AI and also get something like WeGo TCP/IP into the game. There are only so many hours in a day, and we have enough user requests to last us several years. Choices have to be made and I say that focusing on a superior driving AI is a very bad choice to make. It wouldn't impact my gameplay at all since I don't make the sorts of mistakes Redwolf does, so for me I'd rather have any number of other features instead. I'm sure the majority have the same opinion (even though game development ain't a democracy smile.gif )

What we're left with is user feedback improvements in order to help people smooth out the rough edges of their paths. I've said many times now that we'll try to do something here. It's both desirable and practical, which means it is at least up for consideration.

Steve

Link to comment
Share on other sites

Steve: I understand your reasoning on the "cornering" problem, however, it seems to me that since you bothered to simulate acceleration and decceleration with CM2 the cornering issue should be worked on at some point. To me, this is much more "gamey" then accelaration and decceleration not being simulated (a point you made earlier) specially since there are lots of sharp corners in cities. I can see the complexies of the coding since somehow the computer would need to scan the desired path and determine if a sharp turn existed in it then determine the proper speed to enter the turn at. My suggestion is to look at the path during order calculation then automatically insert a waypoint before and after the turn that reduces the speed to whatever is required then increases it back to ordered.

Link to comment
Share on other sites

Dirtweasle,

No problem.

StellarRat,

Steve: I understand your reasoning on the "cornering" problem, however, it seems to me that since you bothered to simulate acceleration and decceleration with CM2 the cornering issue should be worked on at some point.
Everything is one big compromise when it comes to developing a game of this complexity. I can think of plenty of things in CMx1 where we said "it's better to have it imperfect than to not have it at all". For the same basic reason (time, CPU limitations, etc.) there are some things in CMx2 that will probably never be done as well as people would like. I'm sure we can improve the feedback, but honestly... I don't know when, if ever, we'd get around to programming a near-perfect driving AI. Perhaps there is room for tweaking, though, so I'm definitely not saying it will forever remain as it is. I'm just saying I can rattle of dozens of far more important things that need to be done before we devote significant time to this one issue.

To me, this is much more "gamey" then accelaration and decceleration not being simulated (a point you made earlier) specially since there are lots of sharp corners in cities.
Egads :D So you think that if another player sees one of your RPG coming at him that he can stop the vehicle in 1 nanosecond and watch the RPG fly harmlessly by? Me thinks that is super-duper gamey! There is nothing "gamey" in the way it works now at all. Bad results from bad choices, sure, but that's not the same thing.

I can see the complexies of the coding since somehow the computer would need to scan the desired path and determine if a sharp turn existed in it then determine the proper speed to enter the turn at.
That and a lot more, but this is probably the biggest problem to overcome.

My suggestion is to look at the path during order calculation then automatically insert a way before and after the turn that reduces the speed to whatever is required.
This amounts to the same thing as you just outlined. In order for CM to do that it has to know a turn exists and then determine if the vehicle would be going fast enough, by the time it got there, to not negotiate the turn. It's just not possible to shortcut the AI here. Either it knows exactly how the vehicle will behave along the path before or it doesn't. Currently it doesn't for the reasons I've already explained.

The best example I can give of why this is so complex is this. Go to any dense city environment and plot one FAST waypoint on the other side of the map. See how things go from there, then try to imagine how it is the AI would show you, in any meaningful way in a meaningful point in time, why FAST might not be such a good choice. The only way is for the AI to figure out the path, to the nth detail, immediately and then determine how to modify it so a sensible path is taken. That's the coding nightmare Charles doesn't want to touch with a 10' pole due to the time it would take to code it.

Steve

Link to comment
Share on other sites

Okay, time to poor fuel on the fire. ;)

I actually like that the game doesn't auto-slow down vehicles for turns. My playing style rather relies on insane high speed dashes. I'd rather risk the corner at high speed and perhaps messing up then crawling along an unfriendly intersection. If I wanted to crawl along it at a safe speed I can do so. So hands off my choice in the matter!

Oh, and may I add that for me it is a mere risk of a corner being taken badly. You'd think, reading this thread, that no corner can be taken at speed without the vehicle doing a 360.

But yeah, some feedback from CMSF on the issue wouldn't go amiss.

Link to comment
Share on other sites

StellarRat: As I understand it, the problem _is_ where to insert those new way points!

I must admit that to me this doesn't feel like too hard of a problem if one is allowed to make bad decisions once in a while. By bad decision I mean slowing down when it isn't necessary. On the other hand computing is full of problems that do not feel too hard but when you begin to solve them, you see that they are impossible or really hard to solve.

So, when Charles says this is a tremendously hard problem, there is no reason to doubt it.

Link to comment
Share on other sites

Yes, I'm a programmer by trade...I didn't say it would be easy, but I think in the long run it might be worth the trouble. I'm going to think about this problem and see if there is a way to short cut it. Sometimes there are mathematical or logic tricks that can be applied to make a complex problem much easier or less cpu intensive. For now I'll just plot slow down points. smile.gif

Link to comment
Share on other sites

To be fair, I must agree with steve and others here. I don't really have problems with vehicle movement. There is an occasional flaw, but don't real drivers make them too?

Maybe in big RT tcp/ip battles it is true that micro managing vehicle paths can be a bitch simply because there isn't time to give any order exept for 'move there as fast as possible'. However in SP or PBEM there is always time to plot a nice little course for our vehicles :D

If you dont have that time, you'd better lay down that sim / warplaying habit of yours. (as I should lay down mine ;) )

Originally posted by SlowMotion:

One thing that would help players make paths where turns are easier is adjustable waypoints. It would be very useful in many other areas as well.

Now that is something really valuable... To change that given waypoint or delete that mistakenly clicked waypoint. Furthermore, it can't be to hard to code, at least for deleting waypoints smile.gif (deep and agonizing shame will hit me if it turns out to be already possible to delete any last waypoint :rolleyes: )

Hope to see it in 1.07 (assuming 1.06 will be the quickie fix)

Link to comment
Share on other sites

I found pathing a huge improvement over earlier versions when vehicles would take the scenic instead of the direct route. If you test it hard enough you will find issues, that's the nature of AI, but on everyday use I'd expect it to be pretty solid from what I've seen so far.

Link to comment
Share on other sites

Originally posted by Battlefront.com:

Redwolf,

</font><blockquote>quote:</font><hr /> So we are back at ignoring that the problem appears the same way when not using "fast", are we?

No, we're back to you ignoring the fact that the problem is inherently with you, not the game engine. I use FAST all the time and I NEVER see the problems you see. This is something you've dodged every time I've brought it up. Why? Because if you did acknowledge this point you'd have to admit that you're ultimately responsible for the units doing the wrong thing, but yet you are unwilling to do anything about it.

I VERY rarely tell someone a problem is "user error". This is one of those times. What I have said is that we probably can, and probably should, increase the feedback so players who aren't as capable of figuring out what to do on their own can have better feedback so that they can avoid mistakes.

</font>

Link to comment
Share on other sites

I agree that you can always find pathing issues no matter what. But, the scenario I sent Steve has some issues from pathing with a tank heading out being given a waypoint 300m away and then driving maybe 45 deg off the waypoint, getting 40m at least and then turning its flank to its direction to correct and then coming at the waypoint 10-20 deg off the original angle. This is in completely open and flat desert.

Even 100m from the waypoints I plot, the tank starts to do a jig back and forth like its seeking the endpoint. I may be doing something wrong but I have used this same scenario over 50 times and it does the same thing, some better, some worse.

Its not like I am contriving some completely unusual or physically unrealistic situation.; I have a tank, I plot a waypoint 400m somewhere in the 30 deg front arc and tell it to move on flat barren land.

I'll let Steve tell me what I am doing wrong, if anything.

Link to comment
Share on other sites

Thanks guys. Apparently everybody but Redwolf is playing the game wrong because none of you are complaining enough :D

Redwolf,

Please open the savegame I provided and point out the waypoints that I shouldn't have plotted.
Please repost the link. I want to make sure I look at the right file.

You can't serious think that people who want to go regular speed along a road plot 20 or more waypoints for each corner to smoothen them out, do you?
No, that would be stupid if you had to do that. But I don't, and I'm playing the same game that you are. I play in RT and therefore don't have time to do more than 2-4 waypoints for any particular vehicle. Usually I plot 1-2. My vehicles go where I want them to and they don't wind up ass backwards to the enemy.

Thewood,

Yup, saw your post in the other thread and I do have your files. Your most recent description is something very different than what Redwolf is experiencing. I think I know exactly what's happening with your move and it isn't speed related. I'll post some sort of conclusion after I have a chance to look at the files. Might not be until tomorrow late. Got a kinda messed up day tomorrow.

Steve

Link to comment
Share on other sites

I finally have had a little time to play 1.05 and have come two conclusions.

1) Their are a lot of American Infantry that go to bed every night thanking God that I am not their company commander , and they are therefore alive to pray for the privilege of staying that way. I suck, no but I suck, no but really! smile.gif

2)The game may not be perfect but it is much, much better. This is where we should have been on release and I am having fun playing, lots of it.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...