AI Relations and Decision Making

Hey Folks! I finally got the new interaction data format working, and was able to start testing again.

The good news is that it seems to be working as designed. I'm now seeing the upgraded stat counter values change accordingly, including the poop relief of -25 units. (Basically, clearing a full day's worth of food from the bowels.)

The bad news is, I'm starting to notice problems in my AI decision-making. AI still seems to bee-line for the food despite having bigger priorities in their list. And it seems to be stemming from the first draft of the relationship system I added way back.

Basically, whenever an AI is deciding what to do next, they check their current priority list for top issues. Then, for each in turn, they check all shipboard ConditionOwners (COs, or basically interactive objects) for interactions that could satisfy their need. Whichever one has the best combo of high priority and high reward wins, and they walk to that. So far, so good.

However, the way the AI is calculating the reward of the interaction is a bit wonky. I have a relationship object for each pair of COs in the world which is basically their mental image of each other. They decide whether to try an interaction based on this relationship. But the values for these relationships aren't really balanced. It's easy for one relationship to blind the AI to all others until it cannot be chosen anymore. E.g. raiding the fridge until it's empty, despite being super tired or needing to poop.

The solution, I'm thinking, is to make the relationship more about properties of the target, not just the target itself.

For example, the AI will have a list of conditions it knows about, like "Malfunctioning," "Kitchen," "Infirmary," and "Fridge." If it successfully gets food from the Kitchen Fridge, both "Fridge" and "Kitchen" get a bump in their score. If the AI fails to get food from the Infirmary Fridge, "Infirmary," and "Fridge" get docked points. Over time, the AI starts to build a mental model of things that work vs. not, so they might end up knowing that "Fridge" can be hit or miss, but things like "Kitchen" increase their chances of finding food, while "Infirmary" reduce them. They may still try a non-kitchen fridge in a pinch, but will definitely prefer the one in the kitchen if they have one.

There's more to it than that. I think it'll need to account for specific instances of objects, like "Jones." Things like "Man" and "Old" are good info to work from, but for drama to take place, the AI is going to need relations to specific people, not just people categories.

I'm also thinking I might have to tweak the way scores are assigned to each value so that it accounts for multiple interactions in a chain. So if an AI starts a conversation with "Jones" that results in a blow-out argument, that initial interaction should get colored with that negative data to reduce the desire to try it again in the future.

I think. This is pretty heavy stuff, and pretty theoretical. I'll have to be careful not to fall too far down this rabbit hole :)