diff options
Diffstat (limited to 'app/systems/ai')
| -rw-r--r-- | app/systems/ai/randomize_ai.rb | 4 | ||||
| -rw-r--r-- | app/systems/ai/rejoin.rb | 1 | ||||
| -rw-r--r-- | app/systems/ai/scatter.rb | 3 | ||||
| -rw-r--r-- | app/systems/ai/target_player.rb | 5 |
4 files changed, 8 insertions, 5 deletions
diff --git a/app/systems/ai/randomize_ai.rb b/app/systems/ai/randomize_ai.rb index f272181..b3ab59b 100644 --- a/app/systems/ai/randomize_ai.rb +++ b/app/systems/ai/randomize_ai.rb @@ -9,7 +9,7 @@ FF::Scn::BoidRules.add( #puts 'remove pick' end FF::Cmp::BoidsSeparation.each do |sep| - if rand < 0.3 + if rand < 0.05 sep.entities[0].add random_ai_pick #puts 'pick' end @@ -26,7 +26,7 @@ FF::Scn::BoidRules.add( #puts 'target' end #timer.interval = (300..1200).to_a.sample - timer.interval = 60 + timer.interval = (5..20).to_a.sample #puts timer.interval timer.timer = 0 end diff --git a/app/systems/ai/rejoin.rb b/app/systems/ai/rejoin.rb index 9e06eb7..bc804de 100644 --- a/app/systems/ai/rejoin.rb +++ b/app/systems/ai/rejoin.rb @@ -2,6 +2,7 @@ FF::Sys.new("Rejoin", priority: 40) do FF::Cmp::SingletonRandomAIPick[0].entities.each do |entity| sep = entity.components[FF::Cmp::BoidsSeparation][0] sep.distance = Factory::SampleEnemy.defaults[:boids_seperation_distance] + sep.strength = Factory::SampleEnemy.defaults[:boids_seperation_strength] alignment_mgr = entity.components[FF::Cmp::BoidsAlignment] cohesion_mgr = entity.components[FF::Cmp::BoidsCohesion] if alignment_mgr.nil? || alignment_mgr.empty? diff --git a/app/systems/ai/scatter.rb b/app/systems/ai/scatter.rb index 82bcb65..034fa28 100644 --- a/app/systems/ai/scatter.rb +++ b/app/systems/ai/scatter.rb @@ -5,7 +5,8 @@ FF::Sys.new("Scatter", priority: 40) do # what it was before and that means it will force a # seperation to happen even if the default value is # changed and you forget to update this number here - sep.distance = Factory::SampleEnemy.defaults[:boids_seperation_distance] * 3 + sep.distance = Factory::SampleEnemy.defaults[:boids_seperation_distance] * 10 + sep.strength = Factory::SampleEnemy.defaults[:boids_seperation_strength] #puts 'remove align/cohesion/follow'.upcase alignment_mgr = entity.components[FF::Cmp::BoidsAlignment] cohesion_mgr = entity.components[FF::Cmp::BoidsCohesion] diff --git a/app/systems/ai/target_player.rb b/app/systems/ai/target_player.rb index 1e4a3ea..5e5ac18 100644 --- a/app/systems/ai/target_player.rb +++ b/app/systems/ai/target_player.rb @@ -1,11 +1,12 @@ FF::Sys.new("TargetPlayer", priority: 40) do FF::Cmp::SingletonRandomAIPick[0].entities.each do |entity| sep = entity.components[FF::Cmp::BoidsSeparation][0] - sep.distance = 200 + sep.distance = Factory::SampleEnemy.defaults[:boids_seperation_distance] + sep.strength = Factory::SampleEnemy.defaults[:boids_seperation_strength] follow_mgr = entity.components[FF::Cmp::Follow] player_boid = FF::Cmp::SingletonPlayer[0].entities[0].components[FF::Cmp::Boid][0] if follow_mgr.nil? || follow_mgr.empty? - entity.add FF::Cmp::Follow.new(target: player_boid, strength: 1.2) + entity.add FF::Cmp::Follow.new(target: player_boid, strength: 0.5) end end end |
