Some marathon sessions of Rimworld last weekend got me in the mood to work on NPC tasking systems. This was long on the Mythruna to-do list and I had jokingly told my son I was “doing research” when playing Rimworld but that wasn’t far off the mark.
Friday night I threw together a simple 2D prototyping base app with some borrowed graphics from kenney.nl and then I was off.
Doing the prototype on an ES has thrown a few wrinkles in the mix that may have taken a little more time away but I think in the end what I have will be more useful for it.
Anyway, here is a video of it at the “stupid” stage as of a few minutes ago:
…best viewed embiggened at 1080p else it will be hard to see what’s happening.
From the youtube description:
In the vein of “sometimes sucking at something is the first step to being sort of good at something”, we see a dirt-stupid AI scheduler prototype. It needed to get to the stupid stage before I could start making it smarter… ie: I needed to have actual use-cases of it being stupid. Fortunately, the scenario is a lot less complicated than I thought it would have to be. Maybe 25% of my original plan for a scenario it would take to get ‘meaty’.
Mobs will haul any available wood to the stockpile and chop any trees when there is no more wood to haul. Each mob can only carry five units but trees may produce up to three logs of varying units. It’s this last bit that makes it interesting from a scheduling perspective because once one NPC has ear-marked picking up a log it’s not available for anyone else… even if that NPC will not take all of it. It leads to a nice bit of complexity that will let me play with ‘real’ job scheduling earlier than I thought.
So next step is to coordinate tasking so that NPCs don’t do stupid things like walk all the way across the map to pick up a log next to the person that just chopped it. Then add the next levels of the prototype scenario and iterate.
This is sort of the minimal environment to testing such things but the application of the ideas will be directly usable in Mythruna’s town management.
“So like Dwarf Fortress/RimWorld/Etc?” Yes, sort of like that. We’ll see how it goes.
End goal is to build a self managing town that repairs itself when disasters/players strike… and is predictable enough to simulate in broad steps when the player is not there. Reach for the stars, eh?
Music by me.
Placeholder graphics from https://kenney.nl/