Hello,
I'm testing out the Utility Selector and I was wondering how to tackle a specific problem.
I'm trying a simple "Sims" style utility evaluation where a character has a hunger and boredom value that is used for the evaluation. When the Boredom branch is picked the character goes to a Sofa, sits on it, and then continues to watch tv. Slowly decreasing its boredom value.
Now here is where I'm a bit stuck. When the hunger value becomes larger than the boredom value, the Utility Selector (correctly) switches to the Hunger branch where it will do its own thing. However my character is still sitting on the sofa and needs to "get up" first so to speak. So I need to put a GetUp task somewhere in my tree.
Is there a way to make the Evaluate Boredom tree part execute something before being fully aborted by the utility selector? Something equivalent to an OnExitState you would have in an FSM? The only other option I'd see it to have a check at the start of every branch of every branch to see if the character is sitting down on something, but that feels inefficient.
Am I looking at this the wrong way? Or am I missing something here?
Thanks in advance!
I'm testing out the Utility Selector and I was wondering how to tackle a specific problem.
I'm trying a simple "Sims" style utility evaluation where a character has a hunger and boredom value that is used for the evaluation. When the Boredom branch is picked the character goes to a Sofa, sits on it, and then continues to watch tv. Slowly decreasing its boredom value.
Now here is where I'm a bit stuck. When the hunger value becomes larger than the boredom value, the Utility Selector (correctly) switches to the Hunger branch where it will do its own thing. However my character is still sitting on the sofa and needs to "get up" first so to speak. So I need to put a GetUp task somewhere in my tree.
Is there a way to make the Evaluate Boredom tree part execute something before being fully aborted by the utility selector? Something equivalent to an OnExitState you would have in an FSM? The only other option I'd see it to have a check at the start of every branch of every branch to see if the character is sitting down on something, but that feels inefficient.
Am I looking at this the wrong way? Or am I missing something here?
Thanks in advance!