Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synced Lua pathing requests should not be batched and deferred. #1844

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lostsquirrel1
Copy link
Collaborator

No description provided.

@saurtron saurtron added the status: candidate PRs that should be good to go or important for next release label Dec 26, 2024
@lhog
Copy link
Collaborator

lhog commented Dec 29, 2024

Seems like it's breaking vanilla 105 compat.
Just curious if it is it only the limitation of updated QTPFS or is HAPFS affected too?

@lostsquirrel1
Copy link
Collaborator Author

Compatibility was broken by multi-threading the pathing systems years ago - the real world impact of such a compatibility break is imperceptable unless the game is using it instead of allowing units to find their own paths. HAPFS is also affected, yes. I'm not sure why a gadget needs to call pathing in the first place, it isn't good for performance.

@sprunk
Copy link
Collaborator

sprunk commented Dec 30, 2024

I'm not sure why a gadget needs to call pathing in the first place, it isn't good for performance.

There's plenty of use cases for retrieving paths in wupgets, and often it's sufficient do it once (or at least once in a while).

  1. create some sort of pathway between places which is part of the world, and not tied to any individual unit pathing. Maybe it's mechanically relevant such as you're building a railroad, or maybe it's just a neat decal like dirt roads automatically appearing between nearby buildings. In either case, it should be a valid path so it doesn't go up a cliff, through trees, or into the sea.
    image

  2. alternate pathing compared to the unit's nominal engine movetype. For example a unit can have a jump/blink ability that ignores pathing but which carries some cost to use. Then you can ask the engine for the native path to decide whether it would be crappy enough to warrant using the ability. In the example setup below, when moving to the left target, the jump path (red) is way better than the one produced by native pathing (blue), so it's a good moment to use the ability. But when moving to the right target, both paths are about the same (purple), so in that case the unit would be happy enough to walk. Or maybe an ability can actually make use of the nominal path, i.e. it's a dash instead of blink.
    image

  3. looking at a unit's pathing before one exists, for example for deciding whether and/or what unit to spawn. Think BAR Raptor defense, when a hive spawns on an inaccessible island. You can ask for a ground path (with the prospective chicken's movetype) to the defending players' base, discover that there is none, and decide to spawn flying or amphibious/all-terrain chickens instead. Ditto for any sort of trigger-based attacks in missions where the environment can get blocked off (player-placed walls, terrain manipulation such as cratering or terraform, etc). Ditto for skirmish AI looking at pathing between startpoints for deciding what factory to use if they have different pathing (e.g. bot vs veh as in BAR).

  4. just preview the path a unit is going to take, before it actually does so, for GUI feedback purposes.

  5. there's likely neat ways to use it for dynamic/random map generation to help the resulting map have desired pathability between areas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: candidate PRs that should be good to go or important for next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants