Wednesday, July 24, 2013

Creature behavior components

Planning on doing creature behaviors via a System in my entity-component system that manages various possibly-conflicting emotional states.  For example:

Fear of X: The creature will avoid being near X.  Fear should be influenced by a creature's HP, as well as seeing the damage output of X.  If the player is dealing a large amount of damage, a creature should become afraid even if it's not being directly attacked.  Fear should decrease over time to its default value.

Hatred of X: The creature will attack X.  All enemy creatures should start with this.  Dealing damage to a creature should increase its hatred - this allows for non-hostile creatures to become hostile if attacked.  Hatred should decrease over time to its default value.

Fear and Hatred will combine differently depending on the combat capabilities of the creature.  A creature with only melee attacks will not engage in combat if its Fear is too great, while a ranged creature may be able to stay far enough away to satisfy its Fear but still able to attack.


No comments:

Post a Comment