When designing a game (or any piece of software, really) you'll often find yourself partially implementing sections of functionality to be completed later. These are called stubs. I did that with a few things in Realms, pertaining to several tasks with AI.
I already have a system in place that allows easy changing of items in units' hands, such as equipping an axe to chop a tree, or a hammer to build something. The part that was missing is *when* to do it. Currently, these are equipped at the immediate start of the task, whether assigned by the AI director or the player. That isnt the final goal. But, it allowed me to focus on the entire task and making the action happen in a more simplistic form.
So, this week I have been working on going back over these tasks and making them more complete. The initial spawn area contains a new tool rack with two axes and two hammers. These are required to perform wood gathering and building tasks.
The AI has been updated to be able to detect what tool is in a unit's hand, and if not, the nearest tool rack containing the required tool is located. The unit will move to that location and play the animation to pick up that tool, optionally replacing their current one on the rack. If there isnt a tool available, the task fails and the unit will be free to go do something else.
This works for wood chopping and building only, but several other tasks will be updated this week to include the same functionality, among other additions.
This makes placement of supply depots much more critical, and means that getting Blacksmiths early on will be more important as well, as they are the ones that can build additional tools for use.
That's all for now though. As always, thanks for reading!