Jump to content

Resolving next turn pathfinding calculation


Recommended Posts

We currently calculate paths immediately for only 40 units, while the remainder figure out their path in time for the next turn. What this means unfortunately is that the remaining units have to stop for a whole turn and then accelerate from 0 m/s.

 Instead, we can let units continue on their previous path so that they don't stop and have to re-accelerate. The downside here is that units will continue in the wrong direction a little if you tell them to make a 180 degree turn.

There are probably better long-term solutions, like giving large selections a really quick and dirty "guess" path before calculating the new paths.

seem like an upgrade?

  • Like 2
Link to comment
Share on other sites

  • real_tabasco_sauce changed the title to Resolving next turn pathfinding calculation
Quote

What this means unfortunately is that the remaining units have to stop for a whole turn and then accelerate from 0 m/s.

That's very frustrating :(

13 hours ago, real_tabasco_sauce said:

quick and dirty "guess" path before calculating the new paths

By simply disabling pathfinder on turn 0.

  • Best performance gain, while keeping perfect responsiveness of units
  • Intuitive behavior when spamming clicks : units head for the direction where you clicked 
  • In MP, a player spamming clicks don't slow the game for all

We could make it also even smoother maybe:

  • Turn 0 : Pathfinder disabled
  • Turn 1  Raw A* pathfinder
  • Turn > 1 : Make some pull the string passes

I was planning on making a PR for something like the above but I need to make some more research and also gather stats on real game replays to have an average of the "life time" of a walk order. If a good enough portion of the walk orders are only live for a few turns, then would maybe be worth to implement progressive path refining. I hate that currently units make this hokey cross shape paths...

Edited by Atrik
Link to comment
Share on other sites

@wraitii had some ideas on this as well. I do think just not stopping the units as in the second video is a decent short term solution. Typically, you are not often telling your whole army to do a 180° turn compared to turns of 90° or less. And even in the case of the 180 degree turn, the effect is not really worse than before.

It could go in com mod when i have time to put one together.

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.

 Share

×
×
  • Create New...