Jump to content

Better Path Finding


Recommended Posts

The soldier path finding in the game right now really annoys me. This is because it ignores the game's own movement mechanics regarding the TU cost of turning. This means that the paths it calculates for any reasonably long move will waste some TUs.

Since using TUs efficiently is critical in the tactical game, this is a big issue. Any player trying to play the best they can will be forced to manually path the units around the map, using short straight segments, rather than letting the game handle the details for them. I'd much rather focus on tactical concerns rather than needing to fight against the game over efficient TU usage.

To give an example, here's a plotted move costing 35 TUs:

EBD1DB0A0BB032800186BBA8800ECDD4AE3B42D2

The unit turns five times, rather than running three squares forward (to be just behind the guy with the shotgun) and then turning just once before going the rest of the way diagonally. Four of the TUs are wasted on unnecessary turning, more than 10%!

Here's what the path should have been:

attachment.php?attachmentid=2932&d=1389657896

I'm not the first person to notice this, and it's been reported in some older threads like this one, but its not on the FAQ page and fixing it doesn't seem to be planned. I suspect most players who try to play optimally will have also noticed this issue (perhaps subconsciously), and have incorporated various workarounds for the issue into their gameplay (e.g. by moving soldiers only in short straight lines, rather than with long moves under the pathfinder's control).

I have even more doubts about the path finding when I start looking at very long moves (longer than would actually be practical in a game turn). I'm not sure what's going on with this one, for instance (it seems to turn back and forth almost at random, wasting 6 TUs out of 77):

6048E200592CC140989596AF61C87F8A14CD1277

Now, I know that path finding code in games can be quite complicated, but I don't think a fix for this would be too much work. After all, the game is already calculating and displaying the cost of the inefficient moves correctly, it just needs to use that same cost calculation to pick a more optimal route. If the pathfinder is using A* or something similar, you might be able to do this by including the unit's facing in the state information you generate for each potential move, and using that facing information to compute the TU costs.

Anyway, I hope this issue can receive some attention.

Link to comment
Share on other sites

I always thought it tried to draw as straight a line as possible, hence all the unneeded turns but your bottom pic seems to refute that. And yes I manually path my soldiers with as few turns as possible, nothing worse than making it to cover and being 1 or 2 TUs short of kneeling/firing cause you let the default pathing decide where to run. Another thing it often does is attack the last square on the route on an angle when more often than not you want your men facing along the squares not facing diagonally across them.

Edited by Dead Dread
Link to comment
Share on other sites

Why try to handle this by accepting the problem and piling a silly workaround on top of it, instead of simply fixing it? Who wants the soldiers to walk like Robocop? A much better fix for this would be to not have any TU cost for turning while walking this way - the soldiers conceptually _do_ walk in a straight line after all, it's just because of the usage of tiles that it technically requires turning.

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
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...