Forensic Friday 46: The AI Revolution Begins
Hiya everyone! Apologies for the delayed Forensic Friday post, but we’re here now. There’s not too much new content this week, but still some interesting parts nonetheless (at least in our opinions! :D). Happy reading!
NPC AI Overhaul Begins #
There’s not too much more to say on this that wasn’t described last week. However, in case someone decides to use this blog as inspiration for their own game, we’ll describe a couple of the quirks we have encountered along the way, and our solutions so far.
The “tunnel-vision” NPC problem #
One of the biggest issues we’ve encountered has been the “tunnel-vision” NPC problem, that occurs when NPCs in game start one task, and fixate on it until it’s conclusion, without considering other relevant factors in their environment. This can make NPCs appear stupid, as they fail to react appropriately to changing circumstances or prioritise tasks effectively. While in other games, like the Sims, this is just passed off as “dumb” behaviour, in our game this may often be the difference between life and death, or successful containment and containment breaches.
Therefore, to counteract this problem, we now make NPCs rank and choose their preferred task every game tick. However, due to the random nature of NPCs choosing one of their top 3 ranked tasks, we’ve made it so NPCs only change tasks if a new task is made available that an NPC ranks higher than their current task. By making it change every tick, NPCs now will be able to react to events in real time, which hopefully makes them more flexible and adaptive. For instance, a builder may stop by a coworker for a chat, before continuing with moving materials to a construction site, or someone taking a shower will now stop if someone starts shooting at them - all common-sense and realistic behaviours.
Fighting for tasks (Race conditions) #
Another issue that arose came because of this change to reranking and choosing tasks every game tick. Depending on which NPC executed its code first, that NPC would get first choice for every task available in the world. However, since the order in which NPCs execute code isn’t always the same, this would lead to high rated tasks constantly switching hands between NPCs, all relying on the lottery of which NPC would choose first. In real game terms, this could mean a bunch of NPCs constantly getting in and out of a shower every tick, as they jostle over the highest rated task - showering - in the area.
Therefore, we have introduced a task reservation system, whereby an object advertising a task keeps track of the NPC that is carrying out its task. This advertisement is then temporarily locked for 2 ticks to the NPC in question. If the NPC decides to stop the task, then 2 ticks later, the object can advertise to everyone again. Meanwhile, in the more common case that the NPC would continue its task, it has special priority to choose its current task, creating more seemless task completion, and less tug-of-war style situations!
Social Media Revival Underway #
We’ve also been starting our slow social media revival over the last week, with daily posts on Twitter (yes, we’re still calling it that). Whether it’s bad memes, blog post announcements or just general updates, give us a follow for some of the content of all time! (plus likes and retweets for the algorithm are much appreciated)
The first twitter post
Case Closed #
And that’s a wrap for this week. Not too much new content to show while we continue Utility AI, but we hope to have this finished by next Friday! In the meantime, thanks for reading as always, and we’ll see you on Monday in our Discord for the next anomaly poll!!