Some time ago, I started working on NPC creatures for my simulation game. I'm currently focused on refactoring the behavior code to an object-oriented system with automatic sorting based on priority. This is where I'm a bit stuck.
You see, “motives” as they're called are supposed to be the primary driver of how creatures behave. These include health, hunger, and rest, with a sexual reproduction system planned for later. Motives are sorted and compared based on their fulfillment, which is basically the current value divided by the max value (for example, a creature with 10 max health and 5 health has 50% health fulfillment, and a creature with 20 hours of energy that has been active for 5 hours will have 75% rest fulfillment.)
The part I'm having trouble with involves decision-making based on motives. As of right now, motives and behavior are separate systems with separate priorities. I can't figure out how to tie these together.
Can somebody help with this? I just need some advice, but having someone to work on the project with would be great.
If anyone wants to review the code, it's available at https://git.gay/bunabyte/Creaturizer.git . I am accepting pull requests under a GPLv3 license if anyone wants to contribute. This project will remain free.