Memory Matrix, and AI Bugs

Hey Folks! Hope everyone had a good weekend. This was perhaps our most normal one yet here in Seattle. Mostly household chores, errands, and even some family outings! We're looking forward to more like this.

Back on the prototype today, I resumed work on the new AI code. By the time lunch came, I had it mostly doing what I was aiming for. Namely, it was keeping an internal record of which interactions had what effect on certain stats. That, and for each visible condition on the target of the interaction (a.k.a. "them"), it tracked the individual effects.

My intention is for this to help AIs determine not only which interaction they should be trying next, but also which target is best to try it on. I want the AI to come up with some sort of score for each possible move, and make it choose that. And the way it records data, it'll learn a bit as it goes, hopefully forming something that appears to be a relationship.

E.g. Sreyovich always avoids socializing with Mann, and instead prefers chatting with Brickell. One day, however, Brickell is really annoyed at something, and snaps at Sreyovich. Srey logs this and it starts affecting his choice of whom to socialize with, possibly preferring Mann or that new crew member that joined at the last port.

Before I could go much further, though, there was a bug to solve. My AIs would occasionally get stuck waiting forever, usually trying to eat a food packet. It seems they may be trying to access the same food packet as another AI at the same time, and one of them gets it while the other keeps waiting for a packet that no longer exists.

There are a lot of ways to deal with this scenario, including some colorful drama. But the tricky part is detecting when it happens so the AI can act accordingly. Ideally, I will find a way to avoid this bug before it happens, so AI don't unrealistically wait for nonexistent items. But worst-case scenario, I could also have them periodically check that their target is still there, and move on if not.

Once that bug is solved, I should be able to watch a large crew go at it for a while, and dump a log of their memory "matrix" for review. It should give me a better idea of how the AI could work with that memory to make better (i.e. more entertaining) decisions.

Have a good night, all!


Malacodor's picture

I'd go for periodical checks, this seems to be the safest and most robust solution. In most cases it's also more realistic than magically sensing through the wall that someone just ate the last dessert.

Ran around with a clown mask before it was cool

ra1's picture

The more deterministic a program is, the easier it is to debug.

dcfedor's picture

@Malacodor, I think that would solve the problem the fastest. But I'm worried there may be an underlying bug causing items to lose their "busy" status prematurely, which could make it harder to solve problems down the line.

But since I'm still not finding the cause, maybe I need to just apply this "band-aid" and move on.

@ra1, this is true. Though, in this case, I may have made the deterministic parts so complex as to remove that benefit :)

Dan Fedor - Founder, Blue Bottle Games