Goal: Implement a behavior mode in which a bot in an attack swarm will attack and move towards the center of the swarm AND IF BLOCKED will always choose to move around that center in a clockwise (arbitrary choice) fashion along with all other swarm members.
Description:
I was thinking of easy ways to improve how bots work as a group. This would be implemented by having an attacking swarm member bot do the following:
Sense if there are valid enemy targets in sight. If not, just move towards the objective.
Having sighted an enemy, attack it or move closer if out of range
Having attacked an enemy, calculate the weighted average position of all visible allies as the 'swarm center'
could get fancy with swarms and have them track ids of other swarm members, but that's probably over-thinking it
Move towards the swarm center. If blocked, move to next closest space that moves clockwise around all contiguous obstacles (bots, walls, etc.)
Here are some concerns/bad default behaviors this would address:
Bot tries to get too far from its group, and ends up outgunned when it meets an enemy swarm
Bot stands in the way of its allies, preventing them from reaching enemy targets with their attacks (caused either by bunching of front line or by channeling through a tunnel)
Bot that is more damaged stays at the head of the group while blocking allies from advancing. If the damaged bot instead moves towards the center or around the center clockwise, eventually they will end up in back with fresh bots up front. If in a 'maze' setting, it will move up to make room for an ally to take its previous spot.
Downsides of this method:
Costs some bytecode
Maybe we sometimes want swarms to ignore enemies and rush to an objective (could set toggle flag for this)
Might cause weird edge case behavior near walls or other obstacles
It might be better to rush the swarm towards an enemy if that enemy is near a cloud (because if we keep it at barely in attack range, it won't be visible once it enters the cloud)
Goal: Implement a behavior mode in which a bot in an attack swarm will attack and move towards the center of the swarm AND IF BLOCKED will always choose to move around that center in a clockwise (arbitrary choice) fashion along with all other swarm members.
Description: I was thinking of easy ways to improve how bots work as a group. This would be implemented by having an attacking swarm member bot do the following:
Move towards the swarm center. If blocked, move to next closest space that moves clockwise around all contiguous obstacles (bots, walls, etc.)
Here are some concerns/bad default behaviors this would address:
Downsides of this method: