Cautious Companion

If you liked this item, please rate it up on Steam Workshop page.

Author: Missing Minus

Last revision: 12 Nov, 2024 at 21:24 UTC

File size: 444.72 KB

On Steam Workshop

Description:

Companions/allies have a more cautious AI in combat, with some options.

The default vanilla mechanic for non-player-characters running away only triggers at < 1/5 * MaxHP, with some randomness weighted by how hard the character was hit. See the topmost graph, if you have 44 hp then getting hit 40 damage has a higher chance of making you run away than getting hit by 5 damage at an Hp of 15. Makes sense.

This mod adds two features at the moment, which only affect your party members:
– Higher health to consider running away at. This is now set to 1/3rd of MaxHP.
– Distance calculation

The base game does not consider the distance from the player when considering whether to run away. This mod adds two distance modes, where the further away you are, the more likely it is to run away when taking damage. The primary cases for this are (a) the ally follows enemies a long distance, (b) you are running away.
The "Alone" distance is *very* fearful when it is alone.

The health to consider running away at and the distance calculation method can be changed per-ally by speaking with them.

I suggest the default distance (Sigmoid-ish/"Gradual Distance" in-game), but I’m still uncertain about the precise tuning of the health.

The graphs use a MaxHP of 58 (the default for the cat, I believe).

If you have any feedback, like you want a curve somewhere in the middle, or some suggestion for how to calculate fear then feel free to suggest it. I’m not doing powerful levels of combat yet, so this may be too aggressive, or perhaps it is still ignoring too much.

—-

Addition/Removal Status: Safe, will revert back to vanilla. Does not modify any game data permanently, and stores data in its own file.

—-

TODO: Add a MMB/R command to simply tell your pet to flee immediately.
TODO: Consider adding a custom condition for fleeing towards the player. The default fear just runs away from the enemy, which might send them deeper into the dungeon.
TODO: Use information about the number of enemies and fellow allies (besides the player) nearby? Harder to calculate the probability of running…

Source Code: https://github.com/MinusGix/elin-mods/tree/master/CautiousCompanion