Colonists not preferring simple meals over nutrient paste

Started by lewisd, February 27, 2014, 11:36:48 PM

Previous topic - Next topic

lewisd

I have a bunch of simple meals (made of potatoes, spoils in 0.5 to 0.8 days) sitting on the ground next to the nutrient paste dispenser. (The stove is there too, so that's where it dumped them)
My colonists keep coming up and taking nutrient paste meals, and then complaining about it!
Is that a bug?

autohost

I solved this problem by turning off the nutrient paste dispenser.

lewisd

Yea... I have it there though so they don't starve when I forget to micromanage them making food.

Thunder Rahja

They will use the nutrient dispenser if it's closer to them than the meals are. Still, it might be possible to modify this behavior with the existing mod system. I'll look into it.

lewisd

Hmm.  It would be cool if the distance to the food source was modified by a factor based on their preference for the type of food, when the game is deciding which food they'll go get. (*nudge* Tynan ;))

Tynan

Quote from: Thunder1 on February 28, 2014, 03:09:57 AM
They will use the nutrient dispenser if it's closer to them than the meals are. Still, it might be possible to modify this behavior with the existing mod system. I'll look into it.

You'd have to write some new behavior code.

This is an interesting design decision. I avoid soft weighting decisions by the AI for complexity/predictability reasons. So which should it be - should they travel unlimited distance to get the best meal they can, or should they get the closest meal source? Or should it just distinguish nutrient paste from real meals? Hmm.

There already is a food priority system, but it doesn't distinguish between different meals (only between plants/raw/meal).
Tynan Sylvester - @TynanSylvester - Tynan's Blog

FowlJ

Given how harsh the penalties are for eating poor food, getting the best available would probably be better.

Alternatively, though I don't know how technically close this gets to what you want to avoid, colonists could get the best food when they are only 'hungry' and the closest when they are 'urgently hungry' or starving.

lewisd

Quote from: Tynan on February 28, 2014, 12:31:32 PMI avoid soft weighting decisions by the AI for complexity/predictability reasons.

You mean you're not going to use multiple factors in the weight for those decisions? weight = distance * foodQuality, vs, weight = distance? If you're choosing not to do that, I guess there must be more to it?  I don't know what you mean by "soft weighting".  I wasn't suggesting giving each pawn a different preference, just having the quality of the food on it's own be included in the weighing.

Tynan

What you describe is soft weighting (as I call it). It is theoretically better, but I've had a rule against it because it creates a lot of bugs and tends to make the AI unpredictable. It's easy enough for simple cases like this, but tends to snowball into an incomprehensible, untunable mess quickly if applied freely. I just avoid it.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

lewisd

Quote from: Tynan on February 28, 2014, 12:56:50 PMmake the AI unpredictable

Well, in my opinion (disclaimer: not a game dev), there needs to be some level of unpredictability on the AI or the game ends up being boring, due to being too predictable.  So many of the fun stories, that make the game what it is, are driven by unpredictability on the part of the AI.

I've got a paste dispenser in my prison, which is a ways from the base, so when colonists are working up there, I expect them to go get paste, despite not liking it as much.  But when they're in my main base area, they're getting paste or meals depending on which half of the base they're on.  One half is closer to the paste dispenser, one half is closer to the cook stove, even though the two are in the same room, virtually side by side.  It makes me want to do "exploiting" things like build the room with only one door, so they have to walk past the meals to get to the paste dispenser, but that only works if the distance the AI is using is walking distance, vs crow-flies.  Either way, it feels like I'm exploiting the AI because the pawns are being boneheaded.

TokMor

Quote from: Tynan on February 28, 2014, 12:31:32 PM
This is an interesting design decision. I avoid soft weighting decisions by the AI for complexity/predictability reasons. So which should it be - should they travel unlimited distance to get the best meal they can, or should they get the closest meal source? Or should it just distinguish nutrient paste from real meals? Hmm.

There already is a food priority system, but it doesn't distinguish between different meals (only between plants/raw/meal).
So I'm not an expert in AI programming, but what if rather than using a distance based algorithm, the decision was:
Find the best meal in the home zone. If there are no meals in the home zone, follow the existing logic.

This way they won't try to go all the way across the map to eat something if you have a food supply in your base, but they will still get simple meals over food paste if both are available in your base.

lewisd

That's an interesting idea.  It solves the problems I've seen, including some I wasn't expecting to be solved, eg. Pawn near the paste machine in the prison, a fair ways from the rest of the base.

I wonder how it interacts with something else though. Do you have any thoughts about splitting the home zone's purposes?  Right now it's fire fighting and cleaning, gets done in the home zone. It's nice sometimes to have firefighting outside my base, to prevent fires from getting right to my walls before they do anything about it, but then they go outside the base to sweep too. (Unless that's been fixed somehow and I didn't notice?)

Tynan

I worry about lashing too many hidden conditions to the home zone. I think I'd end up with players here frustrated as to why their dudes are acting weird, and then telling them that it has something to do with a seemlingly unrelated mechanic.

Anyway, I've rewritten the code so they'll pursue the best food they can find. Lavish, then fine, then simple, then existing nutrient meals, then nutrient dispensers, then raw. There's a special case (as before) for human meat to make it last on the list.
Tynan Sylvester - @TynanSylvester - Tynan's Blog

Thunder Rahja

Could you also throw in the preference for berries before consuming other raw foods? It'd make it easier than to manually forbid every other raw food type when a solar flare prevents you from making new meals.

colonistPally

Quote from: Tynan on February 28, 2014, 04:02:36 PM
I worry about lashing too many hidden conditions to the home zone. I think I'd end up with players here frustrated as to why their dudes are acting weird, and then telling them that it has something to do with a seemlingly unrelated mechanic.

Anyway, I've rewritten the code so they'll pursue the best food they can find. Lavish, then fine, then simple, then existing nutrient meals, then nutrient dispensers, then raw. There's a special case (as before) for human meat to make it last on the list.

I agree with everything you said. I think the only thing is having it radius based like what's the best within 50 steps, what's the best within 100 steps, 150 steps, 200 steps. Maybe rationalize it that way. So if I get hit with a flare and eclipse and run out of food and all of that at the same time, I can count on them to take care of it while I micromanage the harvesting (since they don't seem to harvest on their own, even if they're starving......)

Is it asking too much to just toss the harvesting code into this? :P