Zero-K icon indicating copy to clipboard operation
Zero-K copied to clipboard

Figure out the engine pathing regression settings

Open GoogleFrog opened this issue 1 year ago • 1 comments

https://github.com/beyond-all-reason/spring/issues/1398

GoogleFrog avatar Jun 26 '24 07:06 GoogleFrog

Before:

  • there was a modrule that let units move downhill without a slowdown (otherwise, same slowdown as going uphill). Apparently neither pathfinder (legacy aka HAPFS, nor QTPFS) knew about this so units avoided slopes anyway https://github.com/ZeroK-RTS/Zero-K/blob/bf4bfe209724b893b3991d45f5fd285f97dccba5/gamedata/modrules.lua#L27

After

  • the modrule has been removed and, as far as I can tell, is always "true", i.e. units no longer slow down downhill. Technically this is a regression but all spring/recoil games set it to true anyway; no change for us
  • you can now specify allowDirectionalPathing per movedef. This makes the legacy pathfinder (aka HAPFS, the one we use) know about the lack of slowdown, and it won't avoid downward slopes. This defaults to false so no change for us yet, but this is the new knob to tweak
  • legacy pathfinder does NOT have the other new 'shortest path' feature mentioned below

QTPFS

  • we don't use it so not immediately relevant
  • QTPFS doesn't support directional pathfinding so will still avoid downward slopes regardless of the new movedef directional pathing setting
  • on the other hand QTPFS (but not our legacy HAPFS) has a per-movedef preferShortestPath setting that makes it ignore nonzero speed modifiers (just avoiding obstacles) when deciding where to path.

sprunk avatar Jun 26 '24 12:06 sprunk