The latest addition is a priority system for NPCs.
Each has a queue that determines what it should currently do, which updates as the different tasks change their urgency and estimated cost.
For example, wanting to partake in a snowfight might have a high cost if the nearest child is too far. In this case, another task will have priority. If and when a child comes near - making the cost of snowfighting lower (less walking time to start the activity), this task might supersede a task that so far has been higher up in the queue.
Having said that, the snowfighting itself is implemented mostly as a state machine: collect snow, aim, charge the shot, release, and repeat!
P.S. This is likely my last update on Childflakes for a while, or at all; like those of my NPCs, it seems that my own tasks have a dynamic priority as well.
I had great fun working on the project, and will currently move on to further work on my game-dev library DanoGameLab.
Comments