Welcome back to another Cowzy Friday update! This week, I’ve been working on the tools database, incorporating that with villager energy, and I’ve started setting up a building preview mode for building new buildings!!
Tool Database Integration
All tools now have proper entries in our database, complete with their enums, meshes, materials, and energy use settings. A tool is of struct FTool. Each tool has the following variables defined below.

This allows us to define a database that sets all of these variables and to use them in the game.

Future-Proofing Tool Upgrades
We currently have six tools and at the start of the game, we set the ToolManagerComponent that is attached to the TownManager so all the tools begin at their most basic upgrade. A few challenges came from this:
How can we future proof it?
How can we make it so we still dynamically load what we need instead of storing all upgrades as loaded objects?
To answer question 1, by using Append with an enum of ToolType, we can now search the database and add new tools without needing to search manually. So if we add a new tool, all we have to do is follow Cowzy naming conventions and you can dynamically add new tools without having to worry!

To solve part 2, we can simply follow the same logic by searching the Jobs datatable for whatever resource type we need and assign the tools accordingly.


This keeps things flexible and scalable as the game grows.
Dynamic Villager Tools and Energy Use
Villagers now pull their energy usage from the DT_UpgradeTable instead of having these values hard-coded. As tools get upgraded, the energy consumption changes!

Building Preview Mode
We’ve also started working on a Building Preview Mode! When placing a building, it now displays with a blue material and a gold outline to indicate valid placement.
Upcoming Focus
Further refining the Building Preview Mode
Villagers being able to build the buildings
Thanks for following along with The Cowzy Game! Stay tuned for more updates as we continue to build out our cozy game!! 🐄🏡
Comments