I always thought it was strange that you can have a thousand bots on the exact same spot. This, in essence, makes them so good.
My idea is twofold:
- 1. Give bots (only logistics bots) a small hitbox specific for airborne things (they cannot collide with things on the ground, only with eachother).
This creates throughput problems when using lots and lots of bots on a narrow lane through the air.
2. Give the player tools to manage flightpaths to cope with the bot throughput problems.
One possibility is that the player can decide that when a bot should bring items from chest A to chest B it should ALWAYS follow a player-specified path consisting of a series of checkpoints which might be either roboports or separate buildings that solely act as checkpoints (which may be much smaller; maybe 1x1 tiles?). The path from chest B to chest A might even be different.
This divides up the airspace above a factory into lanes to avoid too much clogging.
Now, this idea is also not without its issues and open questions. Here are some off the top of my head:
- - What to do with the flight path from the bot's starting roboport to the pick-up chest? Should it use the choosen sensible default when no path is specified (reuse of existing paths, go in a straight line or the bot should find a path by itself)? Will this interfere with existing flight paths if that is a problem at all?
- What to do with flight paths from a chest to the player (= a moving chest so need to dynamically change choosen flight path) and back? Same considerations as above.
- How to deal with flight paths that must necessarily cross? The player is essentially trying to solve the https://en.wikipedia.org/wiki/Three_utilities_problem problem. Do we allow for multiple layers of airspace so that paths can cross without problems? This also reduces the number of collision checks needed.
- What to do when a bot is out of power in between 2 checkpoints? Just continue very slowly and recharge at the next roboport? Go to the closed roboport in its path? Should it consider ports just outside its path (this is a bad idea I believe as it interferes with those other paths)? What if its path doesn't contain roboports and only contains these smaller custom checkpoint buildings?
- This adds major complexity and processing time to the bot's behaviour (it's number of decisions increases with path length). This can become problematic with many, many bots. What you might do is increase the carying capacity of bots so that fewer are needed and maybe make the collision box even a bit bigger so that the throughput problems and the accompanying challenges remain. You could also process the bot's decisions batch-wise. If many bots are following the same path and are on the same checkpoint then they are all making the same decision. No need to do this multiple times.
- The actual collision check is also a performance hit. Besides reducing the number of bots you can also use a quad tree to counteract this.
- - A player might define multiple paths to allow for more capacity. When multiple paths are specified the bots can choose. You can simply implement it so that bots choose a path randomly and all possible paths have an equal (or even biased?) chance of being choosen.
- You might allow the player to build up paths hierarchically. For example, a player might want to specify a sort of 'high-way' that connects two regions of a base that will handle much traffic (it will have a lot of recharging capability) and then specify within a specific flightpath from chest A to B to use this predefined high-way.