* Fix modsuit pathfinder module / JPS changes (#81983)
## About The Pull Request
The Pathfinder module sucks cock because it doesn't work. And the
reasons it doesn't work are as follows:
1. It uses the default JPS pathfinding datum, which has a hard distance
limit of 30, instead of the intended 200.
2. JPS pathfinding as a whole will fail if you encounter more than 3
doors. This is because every door wastes about 5 movement opportunities,
and the default pathfinder only has a limit of 20 before it considers
the entire pathfinding attempt moot and bails out.
Here's how I fixed it:
1. Created a new jps child that has a range of MOD_AI_RANGE
2. Instead of counting all failures during the entire pathfinding
attempt, it will only consider consecutive failures. Every successful
move will reset the pathfinding failure count. This should make JPS
pathfinding more reliable overall?
## Changelog
🆑
fix: Modsuit Pathfinder module is significantly better at finding it's
destination.
/🆑
* Fix modsuit pathfinder module / JPS changes
---------
Co-authored-by: Kapu1178 <75460809+Kapu1178@users.noreply.github.com>
* Cardboard cutouts are now tactical. (#81245)
## About The Pull Request
Basically, this means players holding cardboard cutouts will now assume
their appearance, just like for potted plants. Good for pranking.
I've had to tweak the tactical component and the waddling element a bit
to get them to work as intended while dealing with the multiple sources
of the waddling element.
## Why It's Good For The Game

## Changelog
🆑
add: Players holding cardboard cutouts will now assume their appearance,
just like for potted plants.
/🆑
* Cardboard cutouts are now tactical.
---------
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
* Adds pathmaps, refactors pathfinding a bit (#78684)
## About The Pull Request
Implements /datum/pathfind/sssp, which generates /datum/path_map
/datum/path_maps allow us to very efficently generate paths to any turf
they contain from their central point.
We're effectively running the single source shortest paths algorithm.
We expand from the center turf, adding turfs as they're found, and then
processing them in order of addition.
As we go, we remember what turf "found" us first. Reversing this chain
gives us the shortest possible path from the center turf to any turf in
its range (or the inverse).
This isn't all that useful on its own, outside of a few niche cases
(Like if we wanted to get the farthest reachable turf from the center)
but if we could reuse the map more then once, we'd be able to swarm
to/from a point very easily.
Reuse is a bit troublesome, reqiures a timeout system and a way to
compare different movables trying to get paths.
I've implemented it tho. I've refactored CanAStarPass to take a datum,
/datum/can_pass_info. This is built from a movable and a list of access,
and copies all the properties that would impact pathfinding over onto
itself.
There is one case where we don't do this, pathing over openspace
requires checking if we'd fall through the openspace, and the proc for
that takes an atom.
So instead we use the weakref to the owner that we hold onto, and hold
copies of all the values that would impact the check on the datum.
When someone requests a swarmed path their pass info is compared with
the pass info of all other path_maps centered on their target turf. If
it matches and their requested timeout isn't too short, we just reuse
the map.
Timeout is a tricky thing because the longer a map exists the more out
of date it gets.
I've added a few age defines that let you modulate your level of risk
here. We default to only allowing maps that are currently
being generated, or finished generating in our tick.
Hopefully this prevents falling into trouble, but consumers will need to
allow "failed" movements.
As a part of this datumized pass info, I've refactored pathfinding to
use access lists, rather then id cards directly. This also avoids some
dumbass harddel oppertunities, and prevents an idcard from changing mid
path.
Did a few things to the zPass procs, they took args that they did NOT
need, and I thought it'd be better to yeet em.
If you'd all like I could undo the caching/can_pass_info stuff if you'd
all like. I think it's useful generally because it avoids stuff changing
mid pathfind attempt, but if it's too clunky I could nuke it.
Oh also I added optional args to jps that constricts how it handles
diagonals. I've used this to fix bot paths.
## Why It's Good For The Game
Much of this is redundant currently. I'm adding it because it could have
saved hugglebippers, and because I get the feeling it'll be useful for
"grouping" mobs like bees and such.
We're doing more basic mob work currently and I want to provide extra
tools for that work.
https://github.com/tgstation/tgstation/assets/58055496/66aca1f9-c6e7-4173-9c38-c40516d6d853
## Changelog
🆑
add: Adds swarmed pathfinding, trading accuracy for potential
optimization of used correctly
fix: Bots will no longer take diagonal paths, preventing weirdo looking
path visuals
refactor: Refactored bits of pathfinding code, hopefully easier to add
new pathfinding strategies now
/🆑
* Adds pathmaps, refactors pathfinding a bit
---------
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
* Experiment with replacing weakrefs in AI blackboard with deleting signals, ideally making it easier to work with and harder to cause hard deletes (#74791)
## About The Pull Request
Replaces weakref usage in AI blackboards with deleting signals
All blackboard var setting must go through setters rather than directly
## Why It's Good For The Game
This both makes it a ton easier to develop AI for, and also makes it
harder for hard deletes to sneak in, as has been seen with recent 515
prs showing hard deletes in AI blackboards
(To quantify "making it easier to develop AI", I found multiple bugs in
existing AI code due to the usage of weakrefs.)
I'm looking for `@ Jacquerel` `@ tralezab` 's opinions on the matter, also
maybe `@ LemonInTheDark` if they're interested
## Changelog
🆑 Melbert
refactor: Mob ai refactored once again
/🆑
* Experiment with replacing weakrefs in AI blackboard with deleting signals, ideally making it easier to work with and harder to cause hard deletes
---------
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
AI actions won't unassign each other's movement targets & Mice stop being scared of people if fed cheese (#72130)
## About The Pull Request
Fixes#72116
I've had a persistent issue with basic mob actions reporting this error
and think I finally cracked it
When replanning with `AI_BEHAVIOR_CAN_PLAN_DURING_EXECUTION` it can run
`Setup` on one action leading to the plan changing, meaning that it runs
`finishCommand` to cancel all other existing commands
If you triggered a replan by setting up a movement action in the middle
of another movement action, cancelling the existing action would remove
the target already set by the current one.
We want actions to be able to remove _their own_ movement target but not
if it has been changed by something else in the intervening time.
I fixed this by passing a source every time you set a movement target
and adding a proc which only clears it if you are the source... but this
feels kind of ugly. I couldn't think of anything but if you have a
better idea let me know.
Also while I was doing this I turned it into a feature because I'm
crazy.
If you feed a mouse cheese by hand it will stop being scared of humans
and so will any other mice it attracts from eating more cheese. This is
mostly because I think industrial mouse farming to pass cargo bounties
is funny.
Mice controlled by a Regal Rat lose this behaviour and forget any past
loyalties they may have had.
https://user-images.githubusercontent.com/7483112/208779368-3bd1da0f-4191-4405-86e5-b55a58c2cd00.mp4
Oh also I removed a block about cancelling if you have another target
from the "hunt" behaviour, everywhere using this already achieves that
simply by ordering the actions in expected priority order and it was
messing with how I expected mice to work.
Now if they happen to stop by some cheese they will correctly stop
fleeing in order to eat it before continuing to run away.
## Why It's Good For The Game
Fixes a bug I kept running into.
Makes it possible to set up a mouse farm without them screaming
constantly.
Lets people more easily domesticate mice to support Ratatouille
gameplay.
## Changelog
🆑
add: Mice who are fed cheese by hand will accept humans as friends, at
least until reminded otherwise by their rightful lord.
fix: Fixed a runtime preventing mice from acting correctly when trying
to flee and also eat cheese at the same time.
/🆑
Co-authored-by: Jacquerel <hnevard@gmail.com>
* Allows datum AI to switch to different movement datums (#71595)
## About The Pull Request
Allows basic mobs / datum AI to switch between movement datums. Useful
if you need JPS in some moments, but simple obstacle avoidance in others
This isn't used anywhere yet, but is a building block for basic bots.
## Why It's Good For The Game
Allows us to pick the right tool for the job!
## Changelog
🆑 Capybara Holly
refactor: Datum AI can now switch to different movement datums in their
behavior.
/🆑
Co-authored-by: Capybara <Capybara@ CapybaraMailingServices.com>
* Allows datum AI to switch to different movement datums
Co-authored-by: CapybaraExtravagante <110635252+CapybaraExtravagante@users.noreply.github.com>
Co-authored-by: Capybara <Capybara@ CapybaraMailingServices.com>
* [Ready] MODsuits
* we dont need to add these people as codeowners, goodness gracious
* have to remove this because upstream
* part 1 of these fixes
* EEEE
* Update peacekeeper_clothing.dm
* E
* E
* Auto stash before merge of "upstream-merge-59109" and "origin/upstream-merge-59109"
* E
* Update expeditionary_trooper.dm
* more removal
* nice
* modsuti modstui modusuti
* fixes
* E
* ITS MODsuit not HARDSUIT
* more hardsuit references
* MODSUIT NOT HARSUITEDSA
* Maps
* More ,map
* oop
* e
* oo aa
* 0
* ting tang
* Update modsuit_tailsprites.dm
* hi fikou
* bs tech update
Co-authored-by: Fikou <23585223+Fikou@users.noreply.github.com>
Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
* Monkey subtree breakup refactor! (#61741)
Splitting up monkey ai into subtrees allows me to make a punpun ai after this pr is merged, makes stopping planning matter for the AI subtrees, and more generic subtrees that can be used by most ais
It also gets rid of bad practices like setting blackboards in the ai controller.
* Monkey subtree breakup refactor!
Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
* fixes bad arguments to /datum/footstep/Attach() (vary to sound_vary) (#61231)
#60479 changed the attach argument "vary" into "sound_vary" but didnt change the two associative arguments for vary to sound_vary. this does that. now Attach() wont runtime for the footstep element
* fixes bad arguments to /datum/footstep/Attach() (vary to sound_vary)
Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
* Adds a subsystem for ai movement (#57111)
* done
* straight walk
* movement
* yep
* removes unused macro
* done
* Update ai_movement.dm
* Adds a subsystem for ai movement
Co-authored-by: Qustinnus <Floydje123@hotmail.com>
* Linter, shut thee up. (#56193)
About The Pull Request
Renames a directory such that it does not have a .dm prefix as that is linted against and made it onto master.
Why It's Good For The Game
The linter can stop yelling at everyone over a filepath.
* Linter, shut thee up.
Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
* Reworks the brand intelligence event with AI controller datums (#55778)
These felt like another good test-case for ai controllers that someone could easily grasp, this makes it so that we can use the actual vending machine instead of a fake mimic mob. In theory you could even still use the vending machine, if you like living on the edge ofcourse.
The vendors now try to move towards you, and try to dive on top of you to squish you.
* Reworks the brand intelligence event with AI controller datums
Co-authored-by: Qustinnus <Floydje123@hotmail.com>