One of our players has created an excellent algorithm that can be assigned to any number of your bots simultaneously, and they will operate collectively without interfering with each other. Each of these bots will focus on a specific resource but will be capable of collecting it from several different locations and delivering it to one of several storages, choosing the best one for that moment.
If you have any questions, feel free to post them in the comments! We're here to help!
Author: ouch67
Has the following features:
- Easy to use, Only 3 registers need to be set in most cases.
- Unlimited Pickup Points, also finds the point with the most items to take.
- Unlimited Drop Off Points, also finds the point with the least items.
- Enemy avoidance, will also ping enemy for quick identification.
- Will collaborate with other bots running this script at each pickup or drop off point
- No other hardware needed on the unit other than the behavior controller to function.
- Will find and pickup matching items off the ground one per trip. This eventually clears the area while having a minimal impact on transport performance/efficiency.
- Will not leave when storage is empty until it's batteries and health are full.
- Active inventory monitoring allows for chaining multiple bots running this script together. (If a bot's inventory gets taken halfway on the journey back then it will turn around and go to a pick up point to get more items instead of heading back to the drop off point partially filled.)
- Will not take any items other than what you specify. This means bots running on crystal fuel won't have their fuel reserves stolen.
How to use
- P1 - Set the item you want this bot to transport.
- If setting up a single pickup point, then Set the pickup register to a unit or building and give it a desired distance (value) to sit and wait if no resources found. If you give this a value of 0 or nothing a default value of 4 will be used.
- If setting up multiple pickup points then set the pickup signal register to a ID of your choice and a value to be used as a filter. For instance picking the color Blue with a value of 5 will cause it to look for any bots/buildings with items matching the item register on the map with a signal of the color blue and the value of 5.
- Repeat the last two steps for the drop off point/s. It's important to note that if you set a signal register/s then the other corresponding register/s do not need to be set as they will be overwritten anyway. But the script will read the value set to them for the distance offset to use while waiting.
- If not transporting standard items (like say, Gas or Virus) then edit the behavior script and on the 3rd instruction you will see a box that says "Storage" click that and choose the type of storage the item you want to transport uses. (Currently there is no way to identify what storage type an item needs. So it must be done manually like this.)
Additional explanations
You have the ability to set any color in the 'Signal' field of a building or unit and specify the same color in P4 for the transport bot. This way, it will track all locations marked with this color and decide where to pick up items for delivery.
Similarly, you can set a color for storages and inform the bot about it in the P5 field.
Known issues
- It's decision making is a little on the slow side... This is kinda on purpose as performance was a concern given the complexity of the script. There are areas in the script that that are locked/unlocked to improve performance but this was mainly done on data gathering loops. And I'm happy to report I have roughly 50-60 bots running this script without issue.
- Item reservations can throw off the math in the script. This is just how the devs coded item reservations and I can't identify or fix that as it's hard coded in the game. So beware of your transports thinking there is space where there isn't...
- When determining how many items a unit has it's total number of slots is not factored in to the equation. Meaning, if you have an 8 slot storage building half filled and a 24 slot storage building half filled it will drop items off the to 8 slot storage first as there are fewer overall items in it. This will persist until the 8 slot one is filled and then the 24 slot building will be filled. It's recommended but not required to keep the same number of slots across your signal register groups for this reason. This was done for performance reasons, as the extra calculations would cause quite a bit more processor usage otherwise.
Behavior code:
***
https://store.steampowered.com/news/app/1450900/view/4014464504714840749
https://store.steampowered.com/news/app/1450900/view/3980686873604546768
https://store.steampowered.com/news/app/1450900/view/3955916441775444920
https://store.steampowered.com/news/app/1450900/view/3955916441764875207
https://store.steampowered.com/news/app/1450900/view/7217647935765867440
https://store.steampowered.com/news/app/1450900/view/3871471412481250750
https://store.steampowered.com/news/app/1450900/view/3889485345748521475
https://store.steampowered.com/news/app/1450900/view/3888358641555101802
https://store.steampowered.com/news/app/1450900/view/3888358641540447700
https://store.steampowered.com/news/app/1450900/view/3855706911137657433
https://store.steampowered.com/news/app/1450900/view/3855706911119612650
https://store.steampowered.com/news/app/1450900/view/3855706185309757803
https://store.steampowered.com/news/app/1450900/view/3855706185299872234
https://store.steampowered.com/news/app/1450900/view/3808417211633108188
https://store.steampowered.com/news/app/1450900/view/3794905774846967399
https://store.steampowered.com/app/1450900/Desynced_Autonomous_Colony_Simulator/