AStar subsystem for bots (#26157)

* Adds an ASTAR pathing sub

Adds a little crab bot that Astar paths to wherever you click on the screen

Gunks up ASTAR with a bunch of debug (colouring tiles that are processed)

* Renames some variables for readability

Thanks to having renamed the variables, repairs the golden throne as the error was easier to find

* removes or locks away debug

* Astar path making sub

* Converts bots over to the new ASTAR logic, WIP as fixing race conditions

* Tear it down, and start again

* Fixes patrols and regular path making.

Cleanbots and floorbots now work.

Makes Old_target into a list of old targets, to avoid flip-flopping between two impossible tasks

* New arg for bots, step_for, int. Patrols and paths will make this many steps per call

Fixes farmbots

Fixes the cleanbots in ironchef and spessmart from doing weird stuff

* cleanbots

* Dracula bot

* ed bot, formatting

* ed bots, fixes

* medbots maybe

* mulebots part1

* trying to make it work

* mulebots part 2

* might help with a funtime

* it took me 8 hours to fix this stupid thing. also removes debug

* they're writing songs of love, but not for me :(

* less shit

* It WORKS mostly

* more details, less debugs

* AAAAH

* IT WORKS

* slowbots

* New subsystem, documentation

* Better

Co-authored-by: madmanmartian <lazyrobot@outlook.com>
This commit is contained in:
ShiftyRail
2020-04-13 03:58:37 +02:00
committed by GitHub
parent fa82f95394
commit a98d378854
26 changed files with 1822 additions and 2762 deletions

View File

@@ -23,7 +23,7 @@
if(args["loc"] == target)
return //We're already on our way there
target = args["loc"]
movement_nodes = AStar(M, target, /turf/proc/AdjacentTurfsSpace, /turf/proc/Distance, 0, 30, id=M.get_visible_id())
AStar(src, .proc/receive_path, M, target, /turf/proc/AdjacentTurfsSpace, /turf/proc/Distance, 0, 30, id=M.get_visible_id())
if("dir" in args)
movement_nodes = list()
walk(M, args["dir"], walk_delay)
@@ -36,3 +36,7 @@
step_to(src, target)
movement_nodes.Cut()
return 1
/datum/component/controller/movement/astar/proc/receive_path(var/list/L)
if(islist(L))
movement_nodes = L