Skip to content

Commit

Permalink
Remove CreatureInputs "ClosestVisibleCreatureAggressionPercentage" an…
Browse files Browse the repository at this point in the history
…d "ClosestVisibleCreatureSuccessfulAttackPercentage"

It doesn't make sense for creatures to know what another did throughout their entire lifetime. Maybe in the future an input will be added that will allow them to observe another creature's actions.
  • Loading branch information
ME-MarvinE committed Mar 6, 2024
1 parent d9a984f commit c194996
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 30 deletions.
4 changes: 1 addition & 3 deletions MaceEvolve.Core/Enums/CreatureInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@ public enum CreatureInput
ClosestVisibleCreatureEnergyPercentage,
ClosestVisibleCreatureAgePercentage,
ClosestVisibleCreatureHealthPercentage,
ClosestVisibleCreatureAggressionPercentage,
ClosestVisibleCreatureSuccessfulAttackPercentage,
SizeToClosestVisibleCreatureSize,
ClosestVisibleCreatureSizeToSize,
AnyVisibleCreatures,
AnyVisibleFood,
AnyVisibleFood
}
}
27 changes: 0 additions & 27 deletions MaceEvolve.Core/Models/Step.cs
Original file line number Diff line number Diff line change
Expand Up @@ -730,33 +730,6 @@ public Dictionary<CreatureInput, float> GenerateCreatureInputValues(IEnumerable<
creatureInputValue = creature.InitiatedAttacksCount == 0 ? 0 : (float)creature.SuccessfulAttacksCount / creature.InitiatedAttacksCount;
break;

case CreatureInput.ClosestVisibleCreatureAggressionPercentage:
closestVisibleCreature ??= visibleCreaturesOrderedByDistance.FirstOrDefault();

if (closestVisibleCreature == null)
{
creatureInputValue = 0;
}
else
{
int closestVisibleCreatureAttemptedAttacksAndEats = closestVisibleCreature.AttemptedAttacksCount + closestVisibleCreature.AttemptedEatsCount;
creatureInputValue = closestVisibleCreatureAttemptedAttacksAndEats == 0 ? 0 : (float)closestVisibleCreature.AttemptedAttacksCount / closestVisibleCreatureAttemptedAttacksAndEats;
}
break;

case CreatureInput.ClosestVisibleCreatureSuccessfulAttackPercentage:
closestVisibleCreature ??= visibleCreaturesOrderedByDistance.FirstOrDefault();

if (closestVisibleCreature == null)
{
creatureInputValue = 0;
}
else
{
creatureInputValue = closestVisibleCreature.InitiatedAttacksCount == 0 ? 0 : (float)closestVisibleCreature.SuccessfulAttacksCount / closestVisibleCreature.InitiatedAttacksCount;
}
break;

case CreatureInput.SizeToClosestVisibleCreatureSize:
closestVisibleCreature ??= visibleCreaturesOrderedByDistance.FirstOrDefault();

Expand Down

0 comments on commit c194996

Please sign in to comment.