summaryrefslogtreecommitdiffhomepage
path: root/app/systems/ai
diff options
context:
space:
mode:
Diffstat (limited to 'app/systems/ai')
-rw-r--r--app/systems/ai/randomize_ai.rb4
-rw-r--r--app/systems/ai/rejoin.rb1
-rw-r--r--app/systems/ai/scatter.rb7
-rw-r--r--app/systems/ai/target_player.rb5
4 files changed, 8 insertions, 9 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..1b51061 100644
--- a/app/systems/ai/scatter.rb
+++ b/app/systems/ai/scatter.rb
@@ -1,11 +1,8 @@
FF::Sys.new("Scatter", priority: 40) do
FF::Cmp::SingletonRandomAIPick[0].entities.each do |entity|
sep = entity.components[FF::Cmp::BoidsSeparation][0]
- # I did times 3 becase then it will always be greater then
- # 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..bf8b9e8 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.6)
end
end
end