From 5f0afe5c8ddee6c230ce93d295b95b3a3fddd248 Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Tue, 3 Dec 2024 21:51:57 +0100 Subject: [PATCH 01/17] Engulf microbe even if out of ATP --- src/microbe_stage/systems/MicrobeAISystem.cs | 61 +++++++++++++++----- 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 1142039a019..284c7a27950 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -342,6 +342,13 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor if (compounds.GetCompoundAmount(Compound.ATP) < compounds.GetCapacityForCompound(Compound.ATP) * ai.ATPThreshold) { + // even if we are out of ATP and there is microbe nearby, engulf them + bool isMicrobeHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, + ref engulfer, ref cellProperties, ref control, entity, compounds, speciesFocus, speciesAggression, + speciesActivity, strain, speciesOpportunism, random, true); + if (isMicrobeHunting) + return; + bool outOfSomething = false; foreach (var compound in compounds.Compounds) { @@ -467,6 +474,35 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor } } + // check if species can hunt any prey and if so - engage in chase + bool isHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, + ref cellProperties, ref control, entity, compounds, speciesFocus, speciesAggression, + speciesActivity, strain, speciesOpportunism, random, false); + if (isHunting) + return; + + // There is no reason to be engulfing at this stage + control.SetStateColonyAware(entity, MicrobeState.Normal); + + // Otherwise just wander around and look for compounds + if (!isSessile) + { + SeekCompounds(in entity, ref ai, ref position, ref control, ref organelles, ref absorber, compounds, + speciesActivity, speciesFocus, random); + } + else + { + // This organism is sessile, and will not act until the environment changes + control.SetMoveSpeed(0.0f); + } + } + + private bool CheckForHuntingConditions(ref MicrobeAI ai, ref WorldPosition position, + ref OrganelleContainer organelles, ref SpeciesMember ourSpecies, + ref Engulfer engulfer, ref CellProperties cellProperties, ref MicrobeControl control, in Entity entity, + CompoundBag compounds, float speciesFocus, float speciesAggression, float speciesActivity, + float speciesOpportunism, float strain, Random random, bool outOfAtp) + { // If there are no chunks, look for living prey to hunt var possiblePrey = GetNearestPreyItem(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, compounds, speciesFocus, speciesAggression, speciesOpportunism, random); @@ -482,32 +518,25 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor { GD.PrintErr("Microbe AI tried to engage prey with no position: " + e); ai.FocusedPrey = default; - return; + return false; } bool engulfPrey = cellProperties.CanEngulfObject(ref ourSpecies, ref engulfer, possiblePrey) == EngulfCheckResult.Ok && position.Position.DistanceSquaredTo(prey) < 10.0f * engulfer.EngulfingSize; + // if out of ATP and the prey is out of reach to engulf, do nothing + if (!(outOfAtp && engulfPrey)) + { + return false; + } + EngagePrey(ref ai, ref control, ref organelles, ref position, compounds, entity, prey, engulfPrey, speciesAggression, speciesFocus, speciesActivity, strain, random); - return; + return true; } - // There is no reason to be engulfing at this stage - control.SetStateColonyAware(entity, MicrobeState.Normal); - - // Otherwise just wander around and look for compounds - if (!isSessile) - { - SeekCompounds(in entity, ref ai, ref position, ref control, ref organelles, ref absorber, compounds, - speciesActivity, speciesFocus, random); - } - else - { - // This organism is sessile, and will not act until the environment changes - control.SetMoveSpeed(0.0f); - } + return false; } private (Entity Entity, Vector3 Position, float EngulfSize, CompoundBag Compounds)? GetNearestChunkItem( From 7a68e2e140af80913f8be8724b032d8845c30e9b Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Tue, 3 Dec 2024 22:00:44 +0100 Subject: [PATCH 02/17] Fix --- src/microbe_stage/systems/MicrobeAISystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 284c7a27950..f9db7d92ec8 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -477,7 +477,7 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor // check if species can hunt any prey and if so - engage in chase bool isHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, ref cellProperties, ref control, entity, compounds, speciesFocus, speciesAggression, - speciesActivity, strain, speciesOpportunism, random, false); + speciesActivity, speciesOpportunism, strain, random, false); if (isHunting) return; @@ -526,7 +526,7 @@ private bool CheckForHuntingConditions(ref MicrobeAI ai, ref WorldPosition posit 10.0f * engulfer.EngulfingSize; // if out of ATP and the prey is out of reach to engulf, do nothing - if (!(outOfAtp && engulfPrey)) + if (outOfAtp && !engulfPrey) { return false; } From 4d70c95154d0ab42b9d210b930a69688a19f5e62 Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Tue, 3 Dec 2024 22:02:32 +0100 Subject: [PATCH 03/17] Fix 2 --- src/microbe_stage/systems/MicrobeAISystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index f9db7d92ec8..79ddd452985 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -345,7 +345,7 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor // even if we are out of ATP and there is microbe nearby, engulf them bool isMicrobeHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, ref cellProperties, ref control, entity, compounds, speciesFocus, speciesAggression, - speciesActivity, strain, speciesOpportunism, random, true); + speciesActivity, speciesOpportunism, strain, random, true); if (isMicrobeHunting) return; From 208ff3c93e46e2f3b3422e6e63932eeeec9d5bd6 Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Thu, 5 Dec 2024 20:51:10 +0100 Subject: [PATCH 04/17] Fix --- src/microbe_stage/systems/MicrobeAISystem.cs | 72 +++++++------------- 1 file changed, 25 insertions(+), 47 deletions(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 79ddd452985..efeeffcb801 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -280,9 +280,9 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor ref var control = ref entity.Get(); - ref var compoundStorage = ref entity.Get(); + ref var cellHealth = ref entity.Get(); - var compounds = compoundStorage.Compounds; + var compounds = entity.Get().Compounds; // Adjusted behaviour values (calculated here as these are needed by various methods) var speciesBehaviour = ourSpecies.Species.Behaviour; @@ -309,29 +309,20 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor control.Sprinting = false; // If nothing is engulfing me right now, see if there's something that might want to hunt me - (Entity Entity, Vector3 Position, float EngulfSize)? predator = - GetNearestPredatorItem(ref health, ref ourSpecies, ref engulfer, ref position, speciesFear); - if (predator.HasValue && position.Position.DistanceSquaredTo(predator.Value.Position) < + Vector3? predator = + GetNearestPredatorItem(ref health, ref ourSpecies, ref engulfer, ref position, speciesFear)?.Position; + if (predator.HasValue && position.Position.DistanceSquaredTo(predator.Value) < 1500.0 * speciesFear / Constants.MAX_SPECIES_FEAR) { - // If microbe secretes mucus and predator is still there skip taking any action - if (control.State == MicrobeState.MucocystShield) - return; - - FleeFromPredators(ref position, ref ai, ref control, ref organelles, ref compoundStorage, entity, - predator.Value.Position, predator.Value.Entity, speciesFocus, - speciesActivity, speciesAggression, speciesFear, strain, random); + FleeFromPredators(ref position, ref ai, ref control, ref organelles, compounds, entity, predator.Value, + speciesFocus, speciesActivity, speciesAggression, speciesFear, strain, random); return; } - // If there are no predators stop secreting mucus - if (control.State == MicrobeState.MucocystShield) - { - control.SetMucocystState(ref organelles, ref compoundStorage, entity, false); - } + float atpLevel = compounds.GetCompoundAmount(Compound.ATP); // If this microbe is out of ATP, pick an amount of time to rest - if (compounds.GetCompoundAmount(Compound.ATP) < 1.0f) + if (atpLevel < 1.0f) { // Keep the maximum at 95% full, as there is flickering when near full ai.ATPThreshold = 0.95f * speciesFocus / Constants.MAX_SPECIES_FOCUS; @@ -339,15 +330,19 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor if (ai.ATPThreshold > MathUtils.EPSILON) { - if (compounds.GetCompoundAmount(Compound.ATP) < - compounds.GetCapacityForCompound(Compound.ATP) * ai.ATPThreshold) + if (atpLevel < atpLevel * ai.ATPThreshold) { - // even if we are out of ATP and there is microbe nearby, engulf them - bool isMicrobeHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, - ref engulfer, ref cellProperties, ref control, entity, compounds, speciesFocus, speciesAggression, - speciesActivity, speciesOpportunism, strain, random, true); - if (isMicrobeHunting) - return; + if (cellHealth.CurrentHealth > 2 * Constants.ENGULF_NO_ATP_DAMAGE) + { + // even if we are out of ATP and there is microbe nearby, engulf them. + // make sure engulfing doesn't kill the cell + bool isMicrobeHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, + ref ourSpecies, ref engulfer, ref cellProperties, ref control, entity, compounds, + speciesFocus, speciesAggression, speciesActivity, speciesOpportunism, strain, + random, true); + if (isMicrobeHunting) + return; + } bool outOfSomething = false; foreach (var compound in compounds.Compounds) @@ -763,7 +758,7 @@ ref otherMicrobeInfo.Entity.Get(), speciesOpportunism, speciesFoc foreach (var otherMicrobeInfo in entry.Value) { - // Based on species fear, threshold to be afraid of, ranges from 0.8 to 1.8 microbe size. + // Based on species fear, threshold to be afraid ranges from 0.8 to 1.8 microbe size. if (otherMicrobeInfo.EngulfSize > engulfer.EngulfingSize * fleeThreshold) { var distance = position.Position.DistanceSquaredTo(otherMicrobeInfo.Position); @@ -815,42 +810,25 @@ private void PursueAndConsumeChunks(ref WorldPosition position, ref MicrobeAI ai } private void FleeFromPredators(ref WorldPosition position, ref MicrobeAI ai, ref MicrobeControl control, - ref OrganelleContainer organelles, ref CompoundStorage compoundStorage, in Entity entity, - Vector3 predatorLocation, Entity predatorEntity, float speciesFocus, float speciesActivity, - float speciesAggression, float speciesFear, float strain, Random random) + ref OrganelleContainer organelles, CompoundBag ourCompounds, in Entity entity, Vector3 predatorLocation, + float speciesFocus, float speciesActivity, float speciesAggression, float speciesFear, float strain, + Random random) { - var ourCompounds = compoundStorage.Compounds; control.SetStateColonyAware(entity, MicrobeState.Normal); ai.TargetPosition = (2 * (position.Position - predatorLocation)) + position.Position; control.LookAtPoint = ai.TargetPosition; - // TODO: shouldn't this distance value scale with predator's and prey's cell radius? - // When the players cell is really big this distance value might not be enough if (position.Position.DistanceSquaredTo(predatorLocation) < 100.0f) { bool shouldSprint = true; - - var predatorState = predatorEntity.Get().State; - if ((organelles.SlimeJets?.Count ?? 0) > 0 && RollCheck(speciesFear, Constants.MAX_SPECIES_FEAR, random)) { // There's a chance to jet away if we can control.SecreteSlimeForSomeTime(ref organelles, random); } - else if (ourCompounds.GetCompoundAmount(Compound.Mucilage) > Constants.MUCOCYST_MINIMUM_MUCILAGE && - organelles.MucocystCount > 0 && (strain >= Constants.MAX_STRAIN_PER_ENTITY * 0.70 || - RollCheck(speciesFear, Constants.MAX_SPECIES_FEAR, random) || - predatorState == MicrobeState.Engulf)) - { - // If the microbe is exhausted, too close to predator or the predator starts to engulf, use mucus - control.SetMucocystState(ref organelles, ref compoundStorage, entity, true); - - // Don't take any other action - return; - } else if (RollCheck(speciesAggression, Constants.MAX_SPECIES_AGGRESSION, random)) { // If the predator is right on top of us there's a chance to try and swing with a pilus From 4ba706d08bedf473611dc0f2515a57e51ce84b40 Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Sat, 7 Dec 2024 10:13:41 +0100 Subject: [PATCH 05/17] Fix --- src/microbe_stage/systems/MicrobeAISystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index efeeffcb801..4b651f1579e 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -330,7 +330,7 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor if (ai.ATPThreshold > MathUtils.EPSILON) { - if (atpLevel < atpLevel * ai.ATPThreshold) + if (atpLevel < compounds.GetCapacityForCompound(Compound.ATP) * ai.ATPThreshold) { if (cellHealth.CurrentHealth > 2 * Constants.ENGULF_NO_ATP_DAMAGE) { From 1b5d95d0d3f8d9eba4fc80abbbce7e0d016c3eec Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Tue, 3 Dec 2024 21:51:57 +0100 Subject: [PATCH 06/17] Engulf microbe even if out of ATP --- src/microbe_stage/systems/MicrobeAISystem.cs | 76 +++++++++++++------- 1 file changed, 49 insertions(+), 27 deletions(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 4b651f1579e..284c7a27950 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -280,9 +280,9 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor ref var control = ref entity.Get(); - ref var cellHealth = ref entity.Get(); + ref var compoundStorage = ref entity.Get(); - var compounds = entity.Get().Compounds; + var compounds = compoundStorage.Compounds; // Adjusted behaviour values (calculated here as these are needed by various methods) var speciesBehaviour = ourSpecies.Species.Behaviour; @@ -309,20 +309,29 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor control.Sprinting = false; // If nothing is engulfing me right now, see if there's something that might want to hunt me - Vector3? predator = - GetNearestPredatorItem(ref health, ref ourSpecies, ref engulfer, ref position, speciesFear)?.Position; - if (predator.HasValue && position.Position.DistanceSquaredTo(predator.Value) < + (Entity Entity, Vector3 Position, float EngulfSize)? predator = + GetNearestPredatorItem(ref health, ref ourSpecies, ref engulfer, ref position, speciesFear); + if (predator.HasValue && position.Position.DistanceSquaredTo(predator.Value.Position) < 1500.0 * speciesFear / Constants.MAX_SPECIES_FEAR) { - FleeFromPredators(ref position, ref ai, ref control, ref organelles, compounds, entity, predator.Value, - speciesFocus, speciesActivity, speciesAggression, speciesFear, strain, random); + // If microbe secretes mucus and predator is still there skip taking any action + if (control.State == MicrobeState.MucocystShield) + return; + + FleeFromPredators(ref position, ref ai, ref control, ref organelles, ref compoundStorage, entity, + predator.Value.Position, predator.Value.Entity, speciesFocus, + speciesActivity, speciesAggression, speciesFear, strain, random); return; } - float atpLevel = compounds.GetCompoundAmount(Compound.ATP); + // If there are no predators stop secreting mucus + if (control.State == MicrobeState.MucocystShield) + { + control.SetMucocystState(ref organelles, ref compoundStorage, entity, false); + } // If this microbe is out of ATP, pick an amount of time to rest - if (atpLevel < 1.0f) + if (compounds.GetCompoundAmount(Compound.ATP) < 1.0f) { // Keep the maximum at 95% full, as there is flickering when near full ai.ATPThreshold = 0.95f * speciesFocus / Constants.MAX_SPECIES_FOCUS; @@ -330,19 +339,15 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor if (ai.ATPThreshold > MathUtils.EPSILON) { - if (atpLevel < compounds.GetCapacityForCompound(Compound.ATP) * ai.ATPThreshold) + if (compounds.GetCompoundAmount(Compound.ATP) < + compounds.GetCapacityForCompound(Compound.ATP) * ai.ATPThreshold) { - if (cellHealth.CurrentHealth > 2 * Constants.ENGULF_NO_ATP_DAMAGE) - { - // even if we are out of ATP and there is microbe nearby, engulf them. - // make sure engulfing doesn't kill the cell - bool isMicrobeHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, - ref ourSpecies, ref engulfer, ref cellProperties, ref control, entity, compounds, - speciesFocus, speciesAggression, speciesActivity, speciesOpportunism, strain, - random, true); - if (isMicrobeHunting) - return; - } + // even if we are out of ATP and there is microbe nearby, engulf them + bool isMicrobeHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, + ref engulfer, ref cellProperties, ref control, entity, compounds, speciesFocus, speciesAggression, + speciesActivity, strain, speciesOpportunism, random, true); + if (isMicrobeHunting) + return; bool outOfSomething = false; foreach (var compound in compounds.Compounds) @@ -472,7 +477,7 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor // check if species can hunt any prey and if so - engage in chase bool isHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, ref cellProperties, ref control, entity, compounds, speciesFocus, speciesAggression, - speciesActivity, speciesOpportunism, strain, random, false); + speciesActivity, strain, speciesOpportunism, random, false); if (isHunting) return; @@ -521,7 +526,7 @@ private bool CheckForHuntingConditions(ref MicrobeAI ai, ref WorldPosition posit 10.0f * engulfer.EngulfingSize; // if out of ATP and the prey is out of reach to engulf, do nothing - if (outOfAtp && !engulfPrey) + if (!(outOfAtp && engulfPrey)) { return false; } @@ -758,7 +763,7 @@ ref otherMicrobeInfo.Entity.Get(), speciesOpportunism, speciesFoc foreach (var otherMicrobeInfo in entry.Value) { - // Based on species fear, threshold to be afraid ranges from 0.8 to 1.8 microbe size. + // Based on species fear, threshold to be afraid of, ranges from 0.8 to 1.8 microbe size. if (otherMicrobeInfo.EngulfSize > engulfer.EngulfingSize * fleeThreshold) { var distance = position.Position.DistanceSquaredTo(otherMicrobeInfo.Position); @@ -810,25 +815,42 @@ private void PursueAndConsumeChunks(ref WorldPosition position, ref MicrobeAI ai } private void FleeFromPredators(ref WorldPosition position, ref MicrobeAI ai, ref MicrobeControl control, - ref OrganelleContainer organelles, CompoundBag ourCompounds, in Entity entity, Vector3 predatorLocation, - float speciesFocus, float speciesActivity, float speciesAggression, float speciesFear, float strain, - Random random) + ref OrganelleContainer organelles, ref CompoundStorage compoundStorage, in Entity entity, + Vector3 predatorLocation, Entity predatorEntity, float speciesFocus, float speciesActivity, + float speciesAggression, float speciesFear, float strain, Random random) { + var ourCompounds = compoundStorage.Compounds; control.SetStateColonyAware(entity, MicrobeState.Normal); ai.TargetPosition = (2 * (position.Position - predatorLocation)) + position.Position; control.LookAtPoint = ai.TargetPosition; + // TODO: shouldn't this distance value scale with predator's and prey's cell radius? + // When the players cell is really big this distance value might not be enough if (position.Position.DistanceSquaredTo(predatorLocation) < 100.0f) { bool shouldSprint = true; + + var predatorState = predatorEntity.Get().State; + if ((organelles.SlimeJets?.Count ?? 0) > 0 && RollCheck(speciesFear, Constants.MAX_SPECIES_FEAR, random)) { // There's a chance to jet away if we can control.SecreteSlimeForSomeTime(ref organelles, random); } + else if (ourCompounds.GetCompoundAmount(Compound.Mucilage) > Constants.MUCOCYST_MINIMUM_MUCILAGE && + organelles.MucocystCount > 0 && (strain >= Constants.MAX_STRAIN_PER_ENTITY * 0.70 || + RollCheck(speciesFear, Constants.MAX_SPECIES_FEAR, random) || + predatorState == MicrobeState.Engulf)) + { + // If the microbe is exhausted, too close to predator or the predator starts to engulf, use mucus + control.SetMucocystState(ref organelles, ref compoundStorage, entity, true); + + // Don't take any other action + return; + } else if (RollCheck(speciesAggression, Constants.MAX_SPECIES_AGGRESSION, random)) { // If the predator is right on top of us there's a chance to try and swing with a pilus From 502ea9bb3bd0968bac5079b6ef68ab707d2b8092 Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Tue, 3 Dec 2024 22:00:44 +0100 Subject: [PATCH 07/17] Fix --- src/microbe_stage/systems/MicrobeAISystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 284c7a27950..f9db7d92ec8 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -477,7 +477,7 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor // check if species can hunt any prey and if so - engage in chase bool isHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, ref cellProperties, ref control, entity, compounds, speciesFocus, speciesAggression, - speciesActivity, strain, speciesOpportunism, random, false); + speciesActivity, speciesOpportunism, strain, random, false); if (isHunting) return; @@ -526,7 +526,7 @@ private bool CheckForHuntingConditions(ref MicrobeAI ai, ref WorldPosition posit 10.0f * engulfer.EngulfingSize; // if out of ATP and the prey is out of reach to engulf, do nothing - if (!(outOfAtp && engulfPrey)) + if (outOfAtp && !engulfPrey) { return false; } From c9eb9cbfef5a4384cb9c330aa79d021e80aef1f0 Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Tue, 3 Dec 2024 22:02:32 +0100 Subject: [PATCH 08/17] Fix 2 --- src/microbe_stage/systems/MicrobeAISystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index f9db7d92ec8..79ddd452985 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -345,7 +345,7 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor // even if we are out of ATP and there is microbe nearby, engulf them bool isMicrobeHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, ref cellProperties, ref control, entity, compounds, speciesFocus, speciesAggression, - speciesActivity, strain, speciesOpportunism, random, true); + speciesActivity, speciesOpportunism, strain, random, true); if (isMicrobeHunting) return; From e698eea396c593cb26d1e0e13c58a09d8dad6eaf Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Thu, 5 Dec 2024 20:51:10 +0100 Subject: [PATCH 09/17] rebase --- src/microbe_stage/systems/MicrobeAISystem.cs | 26 +++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 79ddd452985..ae5ab4dd35d 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -280,6 +280,8 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor ref var control = ref entity.Get(); + ref var cellHealth = ref entity.Get(); + ref var compoundStorage = ref entity.Get(); var compounds = compoundStorage.Compounds; @@ -330,8 +332,10 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor control.SetMucocystState(ref organelles, ref compoundStorage, entity, false); } + float atpLevel = compounds.GetCompoundAmount(Compound.ATP); + // If this microbe is out of ATP, pick an amount of time to rest - if (compounds.GetCompoundAmount(Compound.ATP) < 1.0f) + if (atpLevel < 1.0f) { // Keep the maximum at 95% full, as there is flickering when near full ai.ATPThreshold = 0.95f * speciesFocus / Constants.MAX_SPECIES_FOCUS; @@ -339,15 +343,19 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor if (ai.ATPThreshold > MathUtils.EPSILON) { - if (compounds.GetCompoundAmount(Compound.ATP) < - compounds.GetCapacityForCompound(Compound.ATP) * ai.ATPThreshold) + if (atpLevel < atpLevel * ai.ATPThreshold) { - // even if we are out of ATP and there is microbe nearby, engulf them - bool isMicrobeHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, - ref engulfer, ref cellProperties, ref control, entity, compounds, speciesFocus, speciesAggression, - speciesActivity, speciesOpportunism, strain, random, true); - if (isMicrobeHunting) - return; + if (cellHealth.CurrentHealth > 2 * Constants.ENGULF_NO_ATP_DAMAGE) + { + // even if we are out of ATP and there is microbe nearby, engulf them. + // make sure engulfing doesn't kill the cell + bool isMicrobeHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, + ref ourSpecies, ref engulfer, ref cellProperties, ref control, entity, compounds, + speciesFocus, speciesAggression, speciesActivity, speciesOpportunism, strain, + random, true); + if (isMicrobeHunting) + return; + } bool outOfSomething = false; foreach (var compound in compounds.Compounds) From 10ce6e6e71f50908afa109442d6d9faacbd79738 Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Sat, 7 Dec 2024 10:13:41 +0100 Subject: [PATCH 10/17] Fix --- src/microbe_stage/systems/MicrobeAISystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index ae5ab4dd35d..301e8abfded 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -343,7 +343,7 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor if (ai.ATPThreshold > MathUtils.EPSILON) { - if (atpLevel < atpLevel * ai.ATPThreshold) + if (atpLevel < compounds.GetCapacityForCompound(Compound.ATP) * ai.ATPThreshold) { if (cellHealth.CurrentHealth > 2 * Constants.ENGULF_NO_ATP_DAMAGE) { From fecacc842f546692d7511fd25dae1e38f806c9a4 Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Thu, 12 Dec 2024 19:28:55 +0100 Subject: [PATCH 11/17] Fix --- src/microbe_stage/systems/MicrobeAISystem.cs | 44 +++++++++++++------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 301e8abfded..46d2487ede5 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -347,13 +347,12 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor { if (cellHealth.CurrentHealth > 2 * Constants.ENGULF_NO_ATP_DAMAGE) { - // even if we are out of ATP and there is microbe nearby, engulf them. + // Even if we are out of ATP and there is microbe nearby, engulf them. // make sure engulfing doesn't kill the cell - bool isMicrobeHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, - ref ourSpecies, ref engulfer, ref cellProperties, ref control, entity, compounds, - speciesFocus, speciesAggression, speciesActivity, speciesOpportunism, strain, - random, true); - if (isMicrobeHunting) + if (CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, + ref cellProperties, ref control, ref cellHealth, ref compoundStorage, entity, speciesFocus, + speciesAggression, speciesActivity, speciesOpportunism, strain, random, true, + atpLevel)) return; } @@ -484,8 +483,8 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor // check if species can hunt any prey and if so - engage in chase bool isHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, - ref cellProperties, ref control, entity, compounds, speciesFocus, speciesAggression, - speciesActivity, speciesOpportunism, strain, random, false); + ref cellProperties, ref control, ref health, ref compoundStorage, entity, speciesFocus, speciesAggression, + speciesActivity, speciesOpportunism, strain, random, false, atpLevel); if (isHunting) return; @@ -507,10 +506,12 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor private bool CheckForHuntingConditions(ref MicrobeAI ai, ref WorldPosition position, ref OrganelleContainer organelles, ref SpeciesMember ourSpecies, - ref Engulfer engulfer, ref CellProperties cellProperties, ref MicrobeControl control, in Entity entity, - CompoundBag compounds, float speciesFocus, float speciesAggression, float speciesActivity, - float speciesOpportunism, float strain, Random random, bool outOfAtp) + ref Engulfer engulfer, ref CellProperties cellProperties, ref MicrobeControl control, ref Health health, + ref CompoundStorage compoundStorage, in Entity entity, float speciesFocus, float speciesAggression, + float speciesActivity, float speciesOpportunism, float strain, Random random, bool outOfAtp, float atpLevel) { + var compounds = compoundStorage.Compounds; + // If there are no chunks, look for living prey to hunt var possiblePrey = GetNearestPreyItem(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, compounds, speciesFocus, speciesAggression, speciesOpportunism, random); @@ -539,8 +540,8 @@ private bool CheckForHuntingConditions(ref MicrobeAI ai, ref WorldPosition posit return false; } - EngagePrey(ref ai, ref control, ref organelles, ref position, compounds, entity, prey, engulfPrey, - speciesAggression, speciesFocus, speciesActivity, strain, random); + EngagePrey(ref ai, ref control, ref organelles, ref position, ref compoundStorage, ref health, entity, + prey, engulfPrey, speciesAggression, speciesFocus, speciesActivity, strain, random, atpLevel); return true; } @@ -895,10 +896,21 @@ private void FleeFromPredators(ref WorldPosition position, ref MicrobeAI ai, ref } private void EngagePrey(ref MicrobeAI ai, ref MicrobeControl control, ref OrganelleContainer organelles, - ref WorldPosition position, CompoundBag ourCompounds, in Entity entity, Vector3 target, bool engulf, - float speciesAggression, float speciesFocus, float speciesActivity, float strain, Random random) + ref WorldPosition position, ref CompoundStorage compoundStorage, ref Health health, in Entity entity, + Vector3 target, bool engulf, float speciesAggression, float speciesFocus, float speciesActivity, + float strain, Random random, float atpLevel) { - control.SetStateColonyAware(entity, engulf ? MicrobeState.Engulf : MicrobeState.Normal); + var ourCompounds = compoundStorage.Compounds; + + if (atpLevel <= Constants.ENGULF_NO_ATP_TRIGGER_THRESHOLD) + { + control.EnterEngulfModeForcedState(ref health, ref compoundStorage, entity, Compound.ATP); + } + else + { + control.SetStateColonyAware(entity, engulf ? MicrobeState.Engulf : MicrobeState.Normal); + } + ai.TargetPosition = target; control.LookAtPoint = ai.TargetPosition; if (CanShootToxin(ourCompounds, speciesFocus)) From d7b3e190a34f11789a10cfc666df6c91ec7ed41c Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Thu, 30 Jan 2025 21:39:37 +0100 Subject: [PATCH 12/17] Fixes --- src/microbe_stage/systems/MicrobeAISystem.cs | 33 +++++++------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 46d2487ede5..ccd0beba96b 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -280,8 +280,6 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor ref var control = ref entity.Get(); - ref var cellHealth = ref entity.Get(); - ref var compoundStorage = ref entity.Get(); var compounds = compoundStorage.Compounds; @@ -341,20 +339,18 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor ai.ATPThreshold = 0.95f * speciesFocus / Constants.MAX_SPECIES_FOCUS; } + // Even if we are out of ATP and there is microbe nearby, engulf them. + // make sure engulfing doesn't kill the cell. The cell won't engulf if it would kill it + if (CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, + ref cellProperties, ref control, ref health, ref compoundStorage, entity, speciesFocus, + speciesAggression, speciesActivity, speciesOpportunism, strain, random, true, + atpLevel)) + return; + if (ai.ATPThreshold > MathUtils.EPSILON) { if (atpLevel < compounds.GetCapacityForCompound(Compound.ATP) * ai.ATPThreshold) { - if (cellHealth.CurrentHealth > 2 * Constants.ENGULF_NO_ATP_DAMAGE) - { - // Even if we are out of ATP and there is microbe nearby, engulf them. - // make sure engulfing doesn't kill the cell - if (CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, - ref cellProperties, ref control, ref cellHealth, ref compoundStorage, entity, speciesFocus, - speciesAggression, speciesActivity, speciesOpportunism, strain, random, true, - atpLevel)) - return; - } bool outOfSomething = false; foreach (var compound in compounds.Compounds) @@ -481,7 +477,7 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor } } - // check if species can hunt any prey and if so - engage in chase + // Check if species can hunt any prey and if so - engage in chase bool isHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, ref cellProperties, ref control, ref health, ref compoundStorage, entity, speciesFocus, speciesAggression, speciesActivity, speciesOpportunism, strain, random, false, atpLevel); @@ -534,7 +530,7 @@ private bool CheckForHuntingConditions(ref MicrobeAI ai, ref WorldPosition posit EngulfCheckResult.Ok && position.Position.DistanceSquaredTo(prey) < 10.0f * engulfer.EngulfingSize; - // if out of ATP and the prey is out of reach to engulf, do nothing + // If out of ATP and the prey is out of reach to engulf, do nothing if (outOfAtp && !engulfPrey) { return false; @@ -902,14 +898,7 @@ private void EngagePrey(ref MicrobeAI ai, ref MicrobeControl control, ref Organe { var ourCompounds = compoundStorage.Compounds; - if (atpLevel <= Constants.ENGULF_NO_ATP_TRIGGER_THRESHOLD) - { - control.EnterEngulfModeForcedState(ref health, ref compoundStorage, entity, Compound.ATP); - } - else - { - control.SetStateColonyAware(entity, engulf ? MicrobeState.Engulf : MicrobeState.Normal); - } + control.EnterEngulfModeForcedState(ref health, ref compoundStorage, entity, Compound.ATP); ai.TargetPosition = target; control.LookAtPoint = ai.TargetPosition; From 1ec349acd1f9c11ff602635fab5e42b00c48af1e Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Thu, 30 Jan 2025 21:49:43 +0100 Subject: [PATCH 13/17] Fix --- src/microbe_stage/systems/MicrobeAISystem.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 8185f9aa53d..81700b1a9de 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -351,7 +351,6 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor { if (atpLevel < compounds.GetCapacityForCompound(Compound.ATP) * ai.ATPThreshold) { - bool outOfSomething = false; foreach (var compound in compounds.Compounds) { From a558d5056e66e76bc6f8729b4906dc447af4078a Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Fri, 31 Jan 2025 20:57:14 +0100 Subject: [PATCH 14/17] Style fix --- src/microbe_stage/systems/MicrobeAISystem.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 81700b1a9de..0caa8f2a6bc 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -345,7 +345,9 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor ref cellProperties, ref control, ref health, ref compoundStorage, entity, speciesFocus, speciesAggression, speciesActivity, speciesOpportunism, strain, random, true, atpLevel)) + { return; + } if (ai.ATPThreshold > MathUtils.EPSILON) { @@ -477,11 +479,13 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor } // Check if species can hunt any prey and if so - engage in chase - bool isHunting = CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, - ref cellProperties, ref control, ref health, ref compoundStorage, entity, speciesFocus, speciesAggression, - speciesActivity, speciesOpportunism, strain, random, false, atpLevel); - if (isHunting) + if (CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, + ref cellProperties, ref control, ref health, ref compoundStorage, entity, speciesFocus, + speciesAggression, + speciesActivity, speciesOpportunism, strain, random, false, atpLevel)) + { return; + } // There is no reason to be engulfing at this stage control.SetStateColonyAware(entity, MicrobeState.Normal); From b032d5f64f831aa44999c37c13040154fef9b689 Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Fri, 31 Jan 2025 22:28:15 +0100 Subject: [PATCH 15/17] Fixes --- src/microbe_stage/systems/MicrobeAISystem.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 0caa8f2a6bc..19cd5997fe3 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -343,8 +343,7 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor // make sure engulfing doesn't kill the cell. The cell won't engulf if it would kill it if (CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, ref cellProperties, ref control, ref health, ref compoundStorage, entity, speciesFocus, - speciesAggression, speciesActivity, speciesOpportunism, strain, random, true, - atpLevel)) + speciesAggression, speciesActivity, speciesOpportunism, strain, random, true)) { return; } @@ -482,7 +481,7 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor if (CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, ref cellProperties, ref control, ref health, ref compoundStorage, entity, speciesFocus, speciesAggression, - speciesActivity, speciesOpportunism, strain, random, false, atpLevel)) + speciesActivity, speciesOpportunism, strain, random, false)) { return; } @@ -507,7 +506,7 @@ private bool CheckForHuntingConditions(ref MicrobeAI ai, ref WorldPosition posit ref OrganelleContainer organelles, ref SpeciesMember ourSpecies, ref Engulfer engulfer, ref CellProperties cellProperties, ref MicrobeControl control, ref Health health, ref CompoundStorage compoundStorage, in Entity entity, float speciesFocus, float speciesAggression, - float speciesActivity, float speciesOpportunism, float strain, Random random, bool outOfAtp, float atpLevel) + float speciesActivity, float speciesOpportunism, float strain, Random random, bool outOfAtp) { var compounds = compoundStorage.Compounds; @@ -540,7 +539,7 @@ private bool CheckForHuntingConditions(ref MicrobeAI ai, ref WorldPosition posit } EngagePrey(ref ai, ref control, ref organelles, ref position, ref compoundStorage, ref health, entity, - prey, engulfPrey, speciesAggression, speciesFocus, speciesActivity, strain, random, atpLevel); + prey, engulfPrey, speciesAggression, speciesFocus, speciesActivity, strain, random); return true; } @@ -897,11 +896,14 @@ private void FleeFromPredators(ref WorldPosition position, ref MicrobeAI ai, ref private void EngagePrey(ref MicrobeAI ai, ref MicrobeControl control, ref OrganelleContainer organelles, ref WorldPosition position, ref CompoundStorage compoundStorage, ref Health health, in Entity entity, Vector3 target, bool engulf, float speciesAggression, float speciesFocus, float speciesActivity, - float strain, Random random, float atpLevel) + float strain, Random random) { var ourCompounds = compoundStorage.Compounds; - control.EnterEngulfModeForcedState(ref health, ref compoundStorage, entity, Compound.ATP); + if (engulf) + { + control.EnterEngulfModeForcedState(ref health, ref compoundStorage, entity, Compound.ATP); + } ai.TargetPosition = target; control.LookAtPoint = ai.TargetPosition; From 6241339c6c9a2fd17a3a4add7720f29a4f9294db Mon Sep 17 00:00:00 2001 From: Patryk26g Date: Fri, 31 Jan 2025 22:31:55 +0100 Subject: [PATCH 16/17] Fix --- src/microbe_stage/systems/MicrobeAISystem.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 19cd5997fe3..9f5967b0608 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -904,6 +904,10 @@ private void EngagePrey(ref MicrobeAI ai, ref MicrobeControl control, ref Organe { control.EnterEngulfModeForcedState(ref health, ref compoundStorage, entity, Compound.ATP); } + else + { + control.SetStateColonyAware(entity, MicrobeState.Normal); + } ai.TargetPosition = target; control.LookAtPoint = ai.TargetPosition; From aa72d08d4f280ff08ac6f62f268bb2ee3094461c Mon Sep 17 00:00:00 2001 From: Patryk26g <73027854+Patryk26g@users.noreply.github.com> Date: Mon, 3 Feb 2025 11:15:42 +0100 Subject: [PATCH 17/17] Update MicrobeAISystem.cs comment fix --- src/microbe_stage/systems/MicrobeAISystem.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/microbe_stage/systems/MicrobeAISystem.cs b/src/microbe_stage/systems/MicrobeAISystem.cs index 9f5967b0608..efbefc4c0e8 100644 --- a/src/microbe_stage/systems/MicrobeAISystem.cs +++ b/src/microbe_stage/systems/MicrobeAISystem.cs @@ -339,8 +339,7 @@ private void ChooseActions(in Entity entity, ref MicrobeAI ai, ref CompoundAbsor ai.ATPThreshold = 0.95f * speciesFocus / Constants.MAX_SPECIES_FOCUS; } - // Even if we are out of ATP and there is microbe nearby, engulf them. - // make sure engulfing doesn't kill the cell. The cell won't engulf if it would kill it + // Allow the microbe to engulf the prey even if out of ATP if (CheckForHuntingConditions(ref ai, ref position, ref organelles, ref ourSpecies, ref engulfer, ref cellProperties, ref control, ref health, ref compoundStorage, entity, speciesFocus, speciesAggression, speciesActivity, speciesOpportunism, strain, random, true))