Commit Graph

24 Commits

Author SHA1 Message Date
SkyratBot
0ffc7bae8d [MIRROR] Fix modsuit pathfinder module / JPS changes (#26901)
* 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>
2024-03-15 21:59:17 -04:00
SkyratBot
56f02d7e30 [MIRROR] Cardboard cutouts are now tactical. (#26545)
* 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
![](https://media1.tenor.com/m/X1GimXmuByYAAAAd/tom-cruise-doorbell.gif)

## 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>
2024-02-17 13:25:03 -05:00
SkyratBot
1dd5011776 [MIRROR] Adds pathmaps, refactors pathfinding a bit [MDB IGNORE] (#24414)
* 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>
2023-10-18 03:31:21 -04:00
SkyratBot
6aa21d0527 [MIRROR] Refactors vendor tipping and adds 2 new malf modules: Remote vendor tipping, and the ability to roll around and crush anything in your path. [MDB IGNORE] (#22727)
* Refactors vendor tipping and adds 2 new malf modules: Remote vendor tipping, and the ability to roll around and crush anything in your path.

* Update _vending.dm

---------

Co-authored-by: nikothedude <59709059+nikothedude@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-07-27 17:29:54 -04:00
SkyratBot
e6f66d3a4a [MIRROR] Experiment with replacing weakrefs in AI blackboard with deleting signals, ideally making it easier to work with and harder to cause hard deletes [MDB IGNORE] (#20719)
* 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>
2023-04-26 21:17:15 +01:00
SkyratBot
9a594755f3 [MIRROR] Renames delta time to be a more obvious name [MDB IGNORE] (#20507)
* Renames delta time to be a more obvious name

* updates to our code

---------

Co-authored-by: oranges <email@oranges.net.nz>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2023-04-12 20:45:43 +01:00
SkyratBot
30530f2c96 [MIRROR] AI actions won't unassign each other's movement targets & Mice stop being scared of people if fed cheese [MDB IGNORE] (#18268)
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>
2023-01-07 23:30:49 -08:00
SkyratBot
23f97dbfca [MIRROR] Allows datum AI to switch to different movement datums [MDB IGNORE] (#17833)
* 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>
2022-12-01 16:47:15 -05:00
Zonespace
f7c26bbf25 515 Compat (#17465)
* ONLY SKYRAT CHANGES

* ACTUALLY SKYRAT CHANGES

* yolo, revert later

* Update alternate_byond_versions.txt

Co-authored-by: AnturK <AnturK@users.noreply.github.com>
2022-11-15 06:59:06 +00:00
SkyratBot
cd3767e043 [MIRROR] Alphabetized, fixed spelling error, clarifying event descriptions. Polish [MDB IGNORE] (#16168)
* Alphabetized, fixed spelling error, clarifying event descriptions. Polish

* l

Co-authored-by: Marina <50789504+KirbyDaMaster@users.noreply.github.com>
Co-authored-by: John Doe <gamingskeleton3@gmail.com>
2022-09-11 22:20:45 -07:00
SkyratBot
2bb2d2a7ca All code files must now be included in the .dme, removes some old duplicate files that never were (#14485)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-06-25 01:24:23 +01:00
SkyratBot
65b8082678 [MIRROR] Harddel Fix Pack #42 + Better Live Reftracking Support [MDB IGNORE] (#10639)
* Harddel Fix Pack #42 + Better Live Reftracking Support

* awooga

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-01-12 21:57:49 +00:00
SkyratBot
58f82b5161 [MIRROR] [Ready] MODsuits [MDB IGNORE] (#10244)
* [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>
2021-12-25 13:32:49 +00:00
SkyratBot
87f9a90cea [MIRROR] Monkey subtree breakup refactor! [MDB IGNORE] (#8748)
* 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>
2021-10-11 16:16:48 +01:00
SkyratBot
0cb5fc83b0 [MIRROR] fixes bad arguments to /datum/footstep/Attach() (vary to sound_vary) (#7986)
* 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>
2021-09-05 17:22:54 +01:00
SkyratBot
7c20242e85 [MIRROR] fixes misspellings of "aggressive" in a few areas. (#7869)
* fixes misspellings of "aggressive" in a few areas.

* aa

Co-authored-by: aaaa1023 <74441292+aaaa1023@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-09-01 16:54:51 +01:00
SkyratBot
851a58ef7b All AI datum behaviors are now added using a wrapper (#60667) (#7679)
Co-authored-by: AMonkeyThatCodes <20987591+AMonkeyThatCodes@users.noreply.github.com>
2021-08-21 22:14:52 +01:00
SkyratBot
54f003621b [MIRROR] Converts the footstep component into an element. (#7229)
* Converts the footstep component into an element.

* Update human.dm

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-08-03 20:16:35 +01:00
SkyratBot
bdc2b2d3c9 [MIRROR] Revives PR #58579; Sligh refactor to AI datums that allows for basic support of subtrees (#7214)
* Revives PR #58579; Sligh refactor to AI datums that allows for basic support of subtrees (#60249)

Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
Co-authored-by: coiax <yellowbounder@ gmail.com>
Co-authored-by: Watermelon914 <37270891+Watermelon914@ users.noreply.github.com>
Co-authored-by: Rohesie <rohesie@ gmail.com>
Co-authored-by: Matthew J. <12817816+ZephyrTFA@ users.noreply.github.com>
Co-authored-by: AnturK <AnturK@ users.noreply.github.com>
Co-authored-by: Jonathan Rubenstein <jrubcop@ gmail.com>
Co-authored-by: Kylerace <kylerlumpkin1@ gmail.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
Co-authored-by: tralezab <40974010+tralezab@ users.noreply.github.com>
Co-authored-by: Jordan Brown <Cyberboss@ users.noreply.github.com>
Co-authored-by: Fikou <piotrbryla@ onet.pl>
Co-authored-by: Emmanuel S. <emmanuelssr@ gmail.com>

* Revives PR #58579; Sligh refactor to AI datums that allows for basic support of subtrees

Co-authored-by: ma44 <guyonleagueoflegends@gmail.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
Co-authored-by: coiax <yellowbounder@ gmail.com>
Co-authored-by: Watermelon914 <37270891+Watermelon914@ users.noreply.github.com>
Co-authored-by: Rohesie <rohesie@ gmail.com>
Co-authored-by: Matthew J. <12817816+ZephyrTFA@ users.noreply.github.com>
Co-authored-by: AnturK <AnturK@ users.noreply.github.com>
Co-authored-by: Jonathan Rubenstein <jrubcop@ gmail.com>
Co-authored-by: Kylerace <kylerlumpkin1@ gmail.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
Co-authored-by: tralezab <40974010+tralezab@ users.noreply.github.com>
Co-authored-by: Jordan Brown <Cyberboss@ users.noreply.github.com>
Co-authored-by: Fikou <piotrbryla@ onet.pl>
Co-authored-by: Emmanuel S. <emmanuelssr@ gmail.com>
2021-07-29 11:11:03 +01:00
SkyratBot
85874cff9f [MIRROR] Fix rogue vending machines targeting incorporeal (#6644)
* Fix rogue vending machines targeting incorporeal (#59920)

* Fix rogue vending machines targeting incorporeal

Co-authored-by: Wayland-Smithy <64715958+Wayland-Smithy@users.noreply.github.com>
2021-07-02 00:41:58 +01:00
SkyratBot
7d1d0e1fad [MIRROR] Refactors most spans into span procs (#6315)
* Refactors most spans into span procs

* AA

* a

* AAAAAAAAAAAAAAAAAAAAAA

* Update species.dm

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-06-16 00:24:49 +01:00
SkyratBot
c2215e3905 [MIRROR] Adds a subsystem for ai movement (#3613)
* 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>
2021-02-23 21:46:00 +00:00
SkyratBot
f516275c48 [MIRROR] Linter, shut thee up. (#2752)
* 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>
2021-01-17 13:44:05 +01:00
SkyratBot
21907289f2 [MIRROR] Reworks the brand intelligence event with AI controller datums (#2545)
* 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>
2021-01-07 23:17:16 +01:00