Battle Swarm: An Evolutionary Approach to Complex Swarm Intelligence Russel Ahmed Apu Marina Gavrilova Brief Outline • • • • • Battle Swarms Tactics and battle efficiency Swarm Intelligence: Missile Genotype Encoding Evolutionary strategies for battle swarms Experimental results and analysis Objective: To utilize swarm based tactics & evolutionary swarm strategies to increase tactical efficiency for offensive and defensive agents Battle Swarms Agents • MISSILES • DEFENSE TURRETS • Autonomous • Limited sensory capabilities • Limited intelligence • Single objective: Hit ship • Complex dynamic system • Behavior of one missile effect other missiles in the swarm • Point Defense system • Only Visual/radar capabilities • Limited coverage • Single Objective: Destroy missiles • Simple rule, complex outcome: Select and fire • Behavior and efficiency cruicial to survival • Fixed Strategy • Evolutionary Strategy Missile Reaction Reaction Radius Missile Missile Point Defense Defense Mechanism Actions of a Missile Action Encoding Set: {LRUDNMFAXYZ}* X=Rand L= Roll Left F=Follow* Z=Diverge* R=Roll Right U=Pitch Up N=NOP D=Pitch Down Y=Converge* M=Memory A=Avoid* PITCH UP Up ROLL RIGHT Constant Thrust Heading Right * Discussed in the next few slides ROLL LEFT PITCH DOWN Basic Sensory Encoding and Actions Follow Target COG Proj(u) (2) Proj(v) Pitch up (1) Projection Plane Roll to match proj(v)=proj(u) Basic Sensory Encoding and Actions (2) Avoid Target Pitch up COG Proj(u) Proj(v) (1) Projection Plane Roll to match proj(v).proj(u)=0 Target Relative Coordinate (Range, Heading, Bearing) Range, R = M p - T r Fm = fx , fy , fz = Forward Vector of missile m r um = Up vector of missile m é1- ( fx )2 -fx fy -fx fz ù pm = Location of the missile m ê ú ê ú T = Location of the Target 2 1- ( fx ) -fy fz ú M= ê -fx fy ê ú 2ú ê -f f ( ) f -f f 1x y z êë x z ú û r Heading, h = Fm · ( Mpm ) r r Bearing, b = um · (MT - pm ) ×((um ´ (MT - pm )) · Fm ) Target relative: Heading Target Relative: Bearing COG u Rproj b F Projection Plane PRproj Swarm Relative Encoding • Regulates the probability of Flocking Tendency • ‘Y’ Flock and increase tendency (probability of Boids flocking) • ‘Z’ Diverge from flock and decrease tendency • If an agents decides to flock (prob= ), the direction is determined using modified BOIDS Boids flocking: From left to right rules of cohesion, separation and alignment [2]. Decision Making • Event related decision are made by the swarm implicitly • Avoiding Incoming fire: Ionization trail gives negative pheromone to allow flocking out of a region • Finding Weakness in Defense: Combined usage of flocking tendency, gas and ionization pheromone trail Basic Encoding of Missile genotype • • • • • • String of Possible Action (I.e [LYUXLY]) Action string is circular (iterative) Missile DNA=Gene_String[] Continuous execution of the string Each action executed for an infinite time Regulates Swarm Behavior/Tendency Encoding Basic Maneuvers • • • • • • • • Maintain Current Heading = [N] Homing the Target = [F] Ring Motion = [U] Cork Screw = [LU], [LUMMM] Evasive Approach = [XF], [XMMMF] Basic Evasive Action = [A], [AMMMX] Fall Back = [XU], [XMMMU], [AU] Scramble = [X] Basic Maneuvers [F] [XF] [U] [N] [LU] [A] Different Complex Maneuvering Tactics • Retaliation – frontal attack • Evasive – avoid fire at all costs • Convergent approach – approach target from a particular direction • Divergent approach – surround and approach from different directions • Trail wind flocking –one missile leads others • Distract and draw fire Different Complex Maneuvering Tactical strategies (a) Diversion (b) Trail Wind Flocking (c) Retaliation (d) Divergence Mutating and Evolving the Missile Genotype • Fitness: Define a fitness function for the desired action • Crossover: Augment/concatenate Genes {[LUMU] [AMD]} {[LUAMDMU] [LUMD] [AMDUMU] [LMDMU]…} • Randomization: Replace arbitrary symbols with “X”… run the simulation and convert meta genes to real genes [FFLLU] [FXLXU] {[FULLU], [FFLFU], [FNLNU], [FMLNU]} Best{[FULLU], [FNLNU]} Induced Evolution • We can introduce certain desired behavior in addition to natural evolution • Step 1: Train Missiles separately to obtain certain desired behavior without any other consideration. Obtain Viral strain W=[…] • Step 2: Infect All current Genotype with viral Strain W (crossover) The Game: Co-evolution 1. Implement basic missile [F] and basic Turret {Select X, Fire@trajectory} 2. Adjust physical property to match – Fitness=50% (50% missiles hit the target) 3. Evolve Missiles and turrets against previous strain 4. Repeat step 3 for several Games cycles 5. If fitness falls or rises dramatically increase physical strength of opposing swarm (Missile: Acceleration, velocity, turning. Turrets: Speed of fire, number of turrets, firing frequency) Wi = The Fitness Function: Hetero-Sexual Mating • • • •, J W i i Use a two dimensional Fitness Function Every missile has a masculine and a feminine fitness Masculine: Ability to Attack Feminine: Ability to Survive W i = Wi , J i # of missile hit t ing t he t arget Wi = # of missiles launched J i # of gunshot s successfully evaded = # of missiles dest royed+ 1 Results - Strategies evolved, Runtime and other aspects Fitness Function 50 45 Feminine 40 35 Evasive 30 Dispersion 25 20 Distraction 15 Swarm: Trail Wind 10 Assult 5 0 0 20 Masculine 40 60 Randomized 80 100 No Randomization Complex Tactics: Convergent Approach • High Efficiency • Low evasion • Highly Masculine • Strength in numbers • Less exposure to incoming fire • Increase of spatial threat • Decrease of temporal threat Complex Tactics: Divergent Approach • Cause more distraction and confuse the defense system • Less likelihood for a missile to draw fire • Decrease of spatial threat • Increase of temporal threat • Lower Efficiency • Highly Evasive • Highly Feminine Convergent VS Divergent Approach • • • • CONVERGENT Less defense turrets Draw less fire Easy to shoot down • • • • DIVERGENT More defense turrets Draw more fire Distracting and hard to shoot down Complex Tactics: Trail Wind Flocking • • • • • Better than “Convergent Approach” Least exposure to incoming fire Lot of opportunity for diversion/distraction Decrease of spatial threat Decrease of average temporal threat More Results (a) Funnel Shaped Assault (b) Parachute Phase 1: Forming a moth ball (c) Parachute Phase 2: Dispersing (d) Parachute Phase3: Forming a Head (e) Parachute Phase 4: Trail Wind Attack (f) Divergent Attack More Results Figure 11: Formation of Distraction, Organic and Deception pattern (g) Distraction 1: Early missiles draw fire (h) Distraction 2: Assault in progress (i) Organic motion pattern (j) Deception 1: Lead Assault (k) Deception 2: Overshooting the target (l) Deception 3: Come about and attack More Results See Animation Demos Rendering and Physical Engine • Regular physics engine will not suffice – Approximation aggravates trajectory computation • Construct everything from scratch – Advanced look-ahead estimation based physics engine – Robust Rendering engine: • • • • • Anisotropic Texture filtering Multiple LOD based geometry rendering Particle engine Highly optimized exclusive API for performance Flexibility The Simulation Engine • Robust design: Separation of Rendering modules from the simulation • Implements Command Console • Runtime performance is highly efficient • For 50 missiles: – Full quality rendering@ 50FPS !!! – Simulation runs upto 50 times faster (FPS=2200+) is rendering is turned off (for evolutionary algorithm) – Excellent Rendering quality (anisotropic texture mapping, particle engine) Mode (F u cr ee lls n) n) n) cr ee lls ) ow ) lls cr ee (F u (F u in d do w ) 98.72 y cle O nl Pa rti rti cle (W (W in do w 38.16 St at us o Pa y cle O nl Pa rti (W in 400 N o le rti c 100 St at us N Pa Frame/Second Runtime Performance Performance of Different Runtime Modes 800 715.73 700 600 500 391.74 300 200 110.33 48.77 0 Summary • Using Swarm Intelligence to evolve battle tactics for – Missiles – Point Defense Turrets • Evolutionary strategies: – Gene_String[] evolution – The novel “Induced Evolution” strategy – Co-evolutionary strategy • Implementation: – – – – – Rendering and physical Engine Genotype encoding Basic maneuvers Complex maneuvers Integration Thank you