I made a lot of progress today working on a bunch of things, and a hand full of bugs fixed as well. I’ll give you a list of the changes and explain a few frustrations.

Accomplished today:

Got bushes that will spawn as either purple or red berries. This was particularly frustrating because I lumped them into the same code, rather than making two separate bushes, and two separate empty bushes. The problem I had was that I wanted the bush to spawn randomly, but when it restocks; know what type of bush it was. This was challenging because I was essentially just telling the code to replay. So eventually I figured out that if I have the bushes, remove themselves (when a full bush is “picked” it creates an instance of an empty bush, then erases the full bush — when an empty bush is replenished, it creates a full bush of the same type and removes itself) — rather than having the actual villager delete or create anything. If reading that was confusing, imagine my sleep deprived brain trying to figure out that logic for 2 and a half hours!

Got the villagers to find bushes, get berries to drop, and then pick up berries. This involved creating some new berry objects to actually drop — thankfully we had the code cleaned up and made very universal a few days ago. Then I added a very cool leaf effect when bushes are picked. You can almost hear the rustling of leaves!

Rabbits! Sure, they aren’t very pretty but they’re functional and animated! They even flee from danger at high speeds.

Villagers now have the ability to know when their inventory is full and automatically return all of their belongings if they aren’t busy. This is helpful because now you can just send off your units to gather resources and eventually you’ll see the goods pile up in the stockpile/townhall.

Fixed a few bugs, and then cleaned up a bunch of code later. The result of the clean up is that many timers are broken (probably — still haven’t tested wolves, goblins, or rabbits) but it means in the future I’ll be able to change settings a lot easier.

Very productive day, tomorrow I’ll have to test out the other units (wolves,rabbits,goblins) and make sure that the timers all function and they all play nicely with eachother. Then I get to start having fun… and making that apple tree I forgot about until now. But that’s quick. I’ll actually get to make a system where the villagers can have a weapon equipped and if they have a bow, shoot an arrow at the enemy (or encounter friendly fire — danger!)

Thanks a lot for reading, I’ll be back tomorrow with more good stuff!