Nebula icon indicating copy to clipboard operation
Nebula copied to clipboard

Adding SSpathfinding.

Open MistakeNot4892 opened this issue 1 year ago • 2 comments

Description of changes

  • Adding a subsystem to handle scheduling/tick checking of A* pathfinding.
  • Converts bots and ICs to use the subsystem.
  • Adds handling for paths to mob automove.
  • Should fix or at least limit/mitigate #4058.

TODO

  • [X] Coarse implementation.
  • [ ] Get bots to actually work again.
  • [x] Get path following, updating and invalidation working on a test mob controller type.
  • [x] Test asynchronous/tick checked AStar().

Why and what will this PR improve

  • Allows use of A* without locking up the entire game.
  • Generalizes pathfinding off the bot subtype so mob controllers in general can use it.

Authorship

Myself.

Changelog

Nothing player-facing.

MistakeNot4892 avatar Aug 07 '24 07:08 MistakeNot4892

I don't know if it's in the plans down the road, but having some way to prioritize some movers above others would be great. Since, having a lot of idle mobs running their idle or like fluff pathfinding over mobs in active combat would probably be a bit problematic.

Like say, if there's 12 cleaner and farm bots bots trying to get a path and then there's 2 medbots trying to path to heal people, and 2 hostile mobs trying to path to attack players, you probably don't care much about the cleaner and farm bots pathing really long paths over those that need to react quickly?

PsyCommando avatar Oct 12 '24 17:10 PsyCommando

I am not planning on adding pathfinding priority in this PR. I just want it subsystemised and tickchecked, if someone wants to implement scheduling down the track then they can, but I am not adding more scope to this PR, I am already struggling to get through it.

MistakeNot4892 avatar Oct 12 '24 22:10 MistakeNot4892

Splitting the bot aspect out of this for a separate PR.

MistakeNot4892 avatar Nov 02 '24 04:11 MistakeNot4892

Need to remove or integrate/test the asynchronous A* for bot code.

MistakeNot4892 avatar Nov 02 '24 04:11 MistakeNot4892

This has broken bot behavior, but I can't tell if it was my changes or if bots were already screwed. Need to test bots on clean dev I guess.

MistakeNot4892 avatar Nov 24 '24 00:11 MistakeNot4892

works perfectly with #4586 in.

noelle-lavenza avatar Nov 29 '24 19:11 noelle-lavenza

Farmbots and cleanbots are now working fine.

MistakeNot4892 avatar Dec 05 '24 04:12 MistakeNot4892

Some mob AI issues to work through with this one.

MistakeNot4892 avatar Dec 08 '24 03:12 MistakeNot4892

Fixed base automove and target validation.

MistakeNot4892 avatar Dec 08 '24 03:12 MistakeNot4892