Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

[MIRROR] [PORT] Bot Multi-Z Movement #1024

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

SinguloBot
Copy link
Contributor

Original PR: BeeStation/BeeStation-Hornet#7587

Original PR: BeeStation/NSV13/pull/1983

About The Pull Request

Ports the Bot Multi-Z Movement from NSV13

While this PR is no doubt useless for Beestation, given how they are using a single z-level station, it might be of use for downstreams who do use multi-z stations.

While this PR is capable of being used on any ship that has a bot elevator on it, if the AI is the one doing the summoning, however it can't do the Multi-Z Patrol thing just yet, as that requires all ships to have their navigation beacons reprogrammed from going in one big loop to instead going from destination to destination and then finally up a ladder, after which the next deck will also need a route that has a navigation beacon programmed to make the bot go downwards.

(This can easily be implemented by copying over the location name of a beacon downstairs, as the next_patrol destination of some navbeacon upstairs)

Ports some of the code introduced by this PR: tgstation/tgstation/pull/65906
Full credit for the code used to find the closest ladder goes to cacogen.
Although the code has been modified

  • Implements the ability for bots to go between z-levels
  • Implement the ability for bots to patrol through z-levels
  • Implement the ability to summon bots from other z-levels
  • Implement the ability for the AI to call bots to other z-levels
  • Implement this ability for Mulebots to deliver stuff between z-levels

Second of all!
Some bots, possibly all of them, are now capable of moving between Z-levels if one of the following conditions are met:

  • The AI has slammed down a waypoint on another Z-level, like on the bottom deck or the upper deck.
    • If this happens then the bot will instantly head for the nearest bot elevator it can find from its current position, upon arriving to this bot elevator it will check the original waypoint and use the bot elevator to either go up or down, afterwards it resets the bot call command before promptly running it yet again, this time with the original waypoint as the final destination.
      • This annoyingly produces a text message in the chat saying that the call command has been reset.
  • A Navigation Beacon has a destination that's located on another Z-level, currently it's restricted to only check Z-level 2 and 3 which seems to always be the Z-levels the ships various decks are located on.
    • Upon detecting the beacons location on another deck, the bot will try heading for the nearest bot elevator possible.
    • I've introduced a new structure which uses the same code as the ladders however this thing is specifically designed to be used by bots and will reject anyone else trying to use it to go up or down, this thing is called a bot elevator, the reason I introduced this thing is because...well it's easier for mappers to just replicate what they do with ladders for these things and then no longer have to worry about it.
      • Upon reaching the bot elevator it will go down, or up it, and promptly forget the original destination and start heading for the nearest beacon it can find (could possibly also be trying to reach the next beacon from the original destination one)
  • A PDA has Summoned this bot.

Third of all!
The Bot Elevators
They're currently using a temporary upside down version of the bin icon from the mining folder and act the same as ladders except for only being usable by bots, these things are created because coughMoisturizercough wanted ladders for bots only.

Anyways for any future mappers reading this, basically just do the same thing you do with ladders for these things.

Currently only the Atlas has a somewhat semi-working patrol network, although it sometimes gets stuck upstairs if the bot originally started its route on the navigation beacon outside the Head of Security's office.

And now for the horrible, horrible reveal, these bots are using KNPC Z-level travel to be capable of doing this stuff.

Why It's Good For The Game

Bot uses bot elevators. Bot is now advanced boi.

Changelog

🆑
add: Added the ability for bots to go up and down bot elevators.
add: Added the ability for bots to find a route to another Z-level if called to it.
add: Added the ability for bots to have a patrol route going downstairs or upstairs using bot elevators.
add: Added the ability for bots to be summoned using a PDA on another z-level.
add: Added the ability for mulebots to travel between Z-levels.
add: Added the ability to summon bots from other station Z-levels in the bot control computer program
/:cl:

Bobbanz1 and others added 2 commits September 4, 2022 19:27
* Ports the Multi-Z Bot Movement from NSV13

* Update bot.dm

* Fixes in response to comments

* Temporary Removal whilst I try fixing merge issue

* Try two

* Try Three

* Try four

* Ah, sweet conflict solving

* Update bot_defines.dm

* Update mulebot.dm

* Replaced reduntant checks with !=
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants