Basic Needs Simulation AI

I’m studying the behavior trees and I plan to make a Sims-like/Prison Architect-like/Rimwold-like needs simulation in the game. The generic units will be following the behavior tree to fulfill their needs according to their basic needs and also depending on their personalities which I will tackle later on. I’ll need to make a fully working very basic tree. My question would be, first of all,

I’ve searched a lot, but I couldn’t find a similar concept using behavior trees. All out there is about combat and detection. I know it’s relatively easy to convert these tasks into performing simple tasks that alter some numbers saved on a unit such as hunger, sleep etc… But I would like to be able to view and observe an already working method rather than trying to reinvent the wheel myself. I would love to be able to add my own flavor to that said system.

Another thing to ask would be, is it possible to create a whole needs system using a single tree? How further can I stress this tree? Are there anyone who have done a similar task to this and achieved a good result that can aid me in some directions to help me out from the start?

Thanks for your time btw :slight_smile:

Unless you want to buy a plugin off the marketplace, lots of wheel reinventing is going to be involved. Even with a premade plugin or tutorial, you’ll need to reinvent a few wheels anyway to get it to suit your needs.

But, yea, it’s entirely possible to make a needs system using behavior trees. Starting from a basic combat-based AI system which there’s a million tutorials on, one would branch off from a patrol/wander type node, then have selectors to run branches further down based on need priorities.

If I were to make such a thing, I’d probably run a service near the top of the tree which ticks rather slowly to check things like hunger/energy/etc… and sets flags for the selectors downstream to use for decision making.

In a sense, it’s not much different than a patrol system from a combat behavior tree; only instead of visiting patrol points, the pawn would goto a bed or a food source or whatevs if it needs it.