Preferences and Thresholds

Hey Folks! Hope everyone had a good weekend. More of the usual here, as we did some home maintenance stuff, and visited a street fair uptown.

Back at the office, it was time to dive into the AI preferences and threshold changes I mentioned last week. It was a bit of a slog, as a fair amount of data needed rewriting, and some inevitable bugs from the refactor needed squashing.

But after most of a day's work, it's back to normal, albeit with a new system for testing thresholds. And in this version, we can dynamically change thresholds using in-game tools! (Like choosing a character strength or weakness.)

Unfortunately, within a few brief tests, I noticed a shortcoming of the system: it only really works if the thresholds are increased. There's little to no room for decreasing thresholds unless they already started high.

This is a byproduct of the way the condition system works. A long time ago, I decided that all conditions would be >= 0 for simplicity. It avoids a lot of extra logic and edge-cases if we don't have to worry about negative values. It also lets us optimize a bit, since a 0 means we can erase it from the AI and not waste cycles on it.

And up until now, that's worked pretty well.

This isn't a complete dead-end, of course. There are some things we could try to make this work as-is. We could assume some non-zero starting value for thresholds that need to go down, and adjust the data to match. We could have separate positive and negative conditions to track the + and - amounts. (It'd be complicated, and probably not worth it, but we're enumerating options here.)

On the other hand, we could do something to change the system. Maybe thresholds aren't a condition? Or maybe conditions can affect thresholds, but we store them as a signed number somewhere?

My git feeling is that the first option is best. Each threshold is specific to an object. E.g. the "hunger" thresholds are specific to a human. And we could probably choose some non-zero starting value for the thresholds, adjust the data to work with that amount, and then have a lot of room to increase or decrease as a result. It's just not a quick and easy change, so I wasn't thrilled about starting it so late in the afternoon :)

Plus, thinking on it overnight might reveal another approach!

Tags: Ostranauts


Josh_A_Culler's picture

It seems strange to have a measurement of “thresholds” if there is no point at which the rating is considered “critical” or “malfunctioning” or even “non-applicable”..

For example if a 1 rating for hunger means “starved to death” and 100 means “too stuffed to move”, then it seems like the problem of the numbers themselves is defined by analysis rather than computation

dcfedor's picture

This is basically an extension of the NEO Scavenger stats, except expanded to emotional needs.

So in your example, we have Hunger as a measure of how long we've gone without food (in hours):
0-7 = Full
7-72 = Hungry
72-650 = Malnourished
650-1350 = Starving
1350+ = Starved to Death

The thresholds here are 7, 72, 650, and 1350.

The system I'm working on lets me change these thresholds for each character (and non-characters, for stats like gas pressure, temperature, etc.).

E.g. If I have a perk called "Loner," it can adjust the thresholds for "Contact" to be higher. Meaning this person can go longer without contact before they feel negative effects. But it might also lower their thresholds for "Privacy," meaning they tire of people sooner than others.

Dan Fedor - Founder, Blue Bottle Games