Weekly Update - AI Cooking and Deliveries

As the mid-year point closes in I spent time this week trying to wrap up the foundational NPC behaviors and get a few new behaviors in place. As I transition to working on a video update over the next few weeks these updates will likely look a little different - with tasks related more to debugging and video production and less world building.

Delivery Behavior

Up to this point the Taipii NPCs have been working completely independently, mostly performing continual "tests" of the various AI behaviors. Some will catch fish while others chop down trees and gather firewood, but so far these behaviors haven't been related to one another.

This week I wanted to start moving beyond basic tests and towards a working community and economy, so I added some new behaviors that allowed me to set up an NPC to act as a traveling merchant/delivery person. This character carries cooked food out to the logging camp, and while there picks up some firewood to bring back to Taipii Base Camp. After delivering the firewood they pick up more food, and deliver that food to the fishing pier. While there they pick up any fish the fishers have caught and return those to base camp as well.

Cooking Behavior

To complete the cycle I started above, I needed to implement a few more AI behaviors to grill the fish. This character will take firewood and stock one of the firepits in the old base camp, light the fire, and then cook up a tray of fish. The character monitors the grill and removes the fish individually as they reach their cooked state.

(There are several intentional jump-cuts in this animation, as cooking takes a bit of time.)

It's been neat to see all this come together and interesting to watch - the fishers and loggers produce firewood, lumber, and raw fish, while the two other NPCs move the items around, cook the fish, and deliver food back to those camps. The NPCs can even "boostrap" these systems starting with no equipment and empty containers. If they don't have the equipment they need to do a job they'll go take the free low-tier gear from dispenser crates, and if the food crates are empty they'll forage nearby food plants until cooked food arrives.

After the upcoming video I'd like to spend some time getting the economy going with some NPC shops, which will raise some interesting new challenges with regards to where the 'seed' currency is coming from and if I can get the system to self-regulate. There's no sense in catching and cooking fish if most of them spoil because nobody is buying.

Container Improvements

Another thing that needed to be sorted out this week was how changes made to the inventory of containers were kept in sync between the server and client apps. With NPCs adding and removing fish and firewood from crates now I wanted to ensure the inventory screens were accurate even as the contents were changed. It helped to have it working when debugging the new behaviors, and it would be needed for multiplayer in the future anyway - so I went ahead and implemented a better sync system.

That's all for this week. Next week I plan to capture some "test" footage for the upcoming video. Typically when capturing early test footage I'll encounter bugs that I then go back and tidy up before doing re-takes and starting on the final video, so next week's update will likely focus on bug fixing.