Welcome to another Cowzy Friday update! This week, I’ve been focusing on refining villager behavior and beginning work on the villager energy system. Let’s dive into the details!
Depleting a resource
When a villager finished harvesting a resource and drops off the loot, they will check nearby if there is a new resource to harvest. When a villager runs out of resources to harvest locally, they now transition into our Idle Behavior tree, which currently has them wander around until they are assigned a new task.

Introducing the Energy Component
This week also marked the creation of a new BP_EnergyComponent for the townsfolk. Villagers now have a finite amount of energy for the day, which depletes as they perform tasks like gathering resources or moving around.
Here’s how it works:
Energy Depletion: As villagers work, their energy drains.
Energy Check: When their energy runs out, the system automatically transitions them to the Idle Behavior Tree.


Villagers cannot work forever! They need a well-earned break every now and then. The energy component will be expanded over time but right now it's a good step in the right direction.
A Silly Bug Moment
While implementing the energy system, I ran into a silly bug. I had accidentally set the True/False logic on a branch node the wrong way, causing villagers to not find a new resource.

What’s Next?
Here are the upcoming features I’m excited to work on:
Basic Tools System: Tools will now impact energy usage, with upgrades reducing energy consumption.
Villager Energy UI: Adding a UI element to display a villager’s energy level when selected, giving players better visibility into their workforce.
Day and Night Cycle: Villagers will refresh their energy with the start of a new day! The function is here and works but the cycle must be implemented.
Share Your Thoughts!
What do you think about the addition of energy mechanics??
I’d love to hear your feedback or any ideas you have for future updates!
Thanks for following along, and stay tuned for more progress as The Cowzy Game continues to grow. Have a great weekend! 🐄✨
Comentarios