PedrelliLuca / ScalarField

A TopDown RPG Game, where magic works by interacting with the environment.
4 stars 0 forks source link

Make the AI worry about its Temperature when the Player is not in sight #47

Closed PedrelliLuca closed 1 year ago

PedrelliLuca commented 1 year ago

What?

We want the AI to care for its well-being when the player is not in sight. This means that the AI should make sure it is not taking damage from its temperature being out of its Comfort Interval. In case the AI is taking damage, it should move its Character to some location whose temperature is compatible with its Comfort Interval.

How?

  1. Edit the AI Controller so that, once every few frames, it checks the UThermodynamicComponent and the UTemperatureDamageHandlerComponent to see if and how much damage it is taking from Temperature. This amount is sent to the Blackboard.
  2. Edit the Behavior Tree we currently have so that, when the AI doesn't have the player in sight:
    1. It checks a float value of the Blackboard that tells it if and how much the controlled character's temperature is taking Temperature Damage and how much per second.
    2. If it's taking damage, it runs the Env Query we made in #46 and then moves to its location