AI & Toxin hazard

Here’s a quick thought about AI running into toxins. It should of course, as a rule of thumb, avoid them (the how is another question, at the moment, they would need to get access to scene entities, and avoid if too close I guess).

However, I think that running into them is not necessarily stupid : in fact, when I have a lot of HP, I sometimes don’t care enough about toxins to divert my cell from gathering compounds.

A possibility could be to have a random chance to avoid it, with a formula like:
divertChance = 1 - HPFactor * BOLDNESS
HPFactor = (currentHP - toxinDamageHP) / maxHP

Boldness (between 0 and 1) could be an evolutive value, or some hardcoded value for a generic AI behavior. This could also perhaps be related to already existing factors (agressivity/opportunism?).
Note that in any case, this formula would make sure that no cell will hit a toxin if this would be lethal to it, and BOLDNESS = 0 would make a cell avoid toxins whatever.


EDIT: Current proposal
divertChance = 1 - HPFactor * BehaviorFactor
HPFactor = (currentHP - toxinDamageHP) / maxHP
BehaviorFactor = %FOCUS*(1-%FEAR)

1 Like

Instead of Boldness you could probably use the Fear personality trait as I suppose they are similar, or a mix of other traits like Focus and Aggression. If you go to Species.cs you can see all the personality traits which are Aggression, Opportunism, Fear, Activity, and Focus.

2 Likes

I pretty much like the idea of a mix: it diversifies behaviors without adding complexity.

I feel like Focus could be very suited, because I was specifically mentioning this before. Fear seems also to be adapted to this, so I think we could go like this

divertChance = 1 - HPFactor * BehaviorFactor
HPFactor = (currentHP - toxinDamageHP) / maxHP
BehaviorFactor = %FOCUS*(1-%FEAR)

Note: renamed BOLDNESS into BehaviorFactor.

1 Like

Can anyone speak to the role of the environment toxins in the first place? The player should never be running into them by accident, they rarely kill anyway, and once we upgrade the AI they aren’t a trap to lure other cells into. It seems that other than the AI messing up all the toxin does in gameplay is force the player to turn a little bit sometimes.

Once we get currents they might become a bit more interesting. But until then they don’t have any clear meaningful impact on gameplay

They at least make moving require a little bit of attention, as there’s something to avoid.

I think the AI chunks list should already include the environmental toxins…

Yes, I realized this shortly afterwards, they actually already have access.

Still, the point is that this design in itself could be changed: compounds-releasing chunks could by found by gradient-ascending their released clouds. There isn’t such a thing for toxins. So, while it actually fits in the current design, it adds further dependency on it, so double-thinking it is not completely useless, in my opinion. But I indeed think this could be pretty easily implemented as of now.

2 Likes