Homegrown 0.3.3 - Tool System Update
🕑 Added 2023-05-19 14:05:12 +0000 UTCIt's been an intense month of programming! In preparation for adding more content to Homegrown I've be reworking a lot of the tool system to make sure it has support for all that I have planned. Hopefully it's now more flexible and easier to use, both in terms of gameplay and future development.
Gamer Tier+ patrons can download and play Homegrown here.
And for Programmer Tier+ patrons the code is available here.
Tool System
The main changes and additions are as follows:
- The area that a tool affects can now have non-square dimensions.
- You can rotate the tool area (if it's not a square) by clicking the middle mouse button.
- You can reduce the size of the current tool's area by holding shift and scrolling the mouse wheel.
- Tools with a multi-tile area snap to the grid when active. E.g. when active, a 2x2 tool only moves 2 tiles at a time, so it doesn't cover the same tile twice.
- Tools that directly affect objects (harvesting, fruit picking, etc.) now highlight the affected objects.
- Object-affecting tools also now snap to multi-tile entities (e.g. harvesting blueberry bushes feels more intuitive now)
- Unequip all current items by clicking the right mouse button.
- Examining objects now works by hovering over or right-clicking on an object when you have nothing equipped. Might feel slightly off at the moment, but in the future the UI will appear as a small pop-up above the relevant entity, which I think will make more sense.
- You can temporarily go into examine mode by holding ctrl. This will allow you to quickly check the health of a plant without having to unequip your items first.

Code changes
There were also some big restructuring changes in the code that I thought were necessary in order to make the tool system more flexible:
Component based architecture
The biggest change is that I've got the items using a component based architecture now. This allows items to have many different functions and purposes, instead of just one. The easiest example of this is that the compost heap now accepts any items that have the "compostable" component, regardless of what else that item can do. E.g. you can now compost your vegetables if you want. Previously, being "compostable" would have had to be the sole purpose of the item.
This new system opens up many more possibilities for future content and more interesting items!

Objects can provide functionality
Up until now it was the tools themselves that provided all the functionality for interaction with objects in the world. For example, equipping a watering can would open up the "watering" tool, which had functionality for watering tiles and for refilling the watering can at the well. The well object itself provided no functionality.
For some of the features I've got planned in the future it seemed like this system could be a little bit limiting. Just as an example, say I decided to add durability to the tools in the future, and then added a "tool sharpener" object that you could place in your farm that could be used to repair your tools. With the old system, the functionality for this repairing would have to be handled by any tool that wanted to use the tool sharpener (and that could be multiple tools!).
So I changed things about a bit and allowed objects to provide their own functionality and to define which items they can interact with. To use the same example, the tool sharpener object would provide the functionality to repair the items, and would accept any items that have the "durability" component. The tools wouldn't have to be updated at all.
You won't notice this change in the game much at the moment, but in the future it will make it much easier for me to add objects that use or process items in some way.
New Items
On top of everything else there are a few new tools available in the tool shop, as well as a new collectible trophy!

Coming Soon...
Sticking to a similar theme, I'll be reworking the item system next. I'm going to be implementing an upgrade system which will allow you to spend coins on improving and customizing your tools, instead of always having to buy new ones.
Finally, sorry that there isn't a new devlog video yet! This update was very code-heavy and I decided to just knuckle down and power through it without having to film anything. I'll do the same for the item update next week and then make an update video showing a summary of these two updates together.
Thanks as always for the support!
Karl