team-remember-to-hydrate / battlecode23-team-remember-to-hydrate

GNU Affero General Public License v3.0
1 stars 0 forks source link

Strategy: Attack Swarm Behavior - Cyclone Attack #17

Open mklapp2 opened 1 year ago

mklapp2 commented 1 year ago

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:

  1. Sense if there are valid enemy targets in sight. If not, just move towards the objective.
  2. Having sighted an enemy, attack it or move closer if out of range
  3. 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
  4. 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: