Add a "nourishing" property

Registered by Erik Ogenvik

Any entity which causes plants to receive nourishment should be using a "nourishing" property.
Currently this functionality is hardcoded to be handled by the world; it should instead be handled by a property.
When nourishing contained entities, mass should be taken from the entity, unless it's marked to be "infinite" (as the world is).

Blueprint information

Status:
Started
Approver:
Erik Ogenvik
Priority:
Medium
Drafter:
Erik Ogenvik
Direction:
Approved
Assignee:
Erik Ogenvik
Definition:
Approved
Series goal:
None
Implementation:
Deployment
Milestone target:
None
Started by
Erik Ogenvik

Related branches

Sprints

Whiteboard

How exactly the infinite mass test should be performed?
/Peter

I'm wondering if we really want entities that nourish plants to lose mass.
We have two different Eat operations: "passive" and "active".
Plants are "passive" eaters (they soak up nutrients), wheres animals are "active" (the take a bite).
I'm thinking that we're just making it too complex by having plants take mass from what they are eating off.
So for now I think it's just better to not take mass from nourishing entities.
/Erik

I agree, in most cases the plants are anchored in entities that are large enough to sustain themselves so mass lose is not important.
I think we should write common nourishing property for plants and animals.
What test do you suggest for checking if entity should consume mass or not?
Does nourish operation always come from parent in case of plant (and non-parent in case of animal)?
Can one rely on this fact when deciding nourishment handling?
/Peter

The nourishing property should only be on things that can nourish plants, i.e. the world and things like pots with dirt in them.
In the case of the world only areas that are covered in soil nourish plants; this is checked by using Mercator data.
One required change is to make Eat operations specify whether they are "biting" or "soaking". That should determine whether mass is removed or not.
The origin of the Nourish operation isn't relevant; removal of mass happens when the Nourish operation is created.
/Erik

I imagined it the other way around rather as "being nourished property" attached to both plants and animals. But I see the point.
So in this case the needed work should look like this:
1.) Add flags to eat operations sended by animals and plants marking passive/active way of eating.
2) Implement NourishingProperty class with eat_handler , that performs soil & eat_op type checks and send back proper nourish op to entity that is being nourished.
/Peter

Exactly!
/Erik

Regarding removal of the nourishing property, I've had in mind the nourishment property rather (sorry) which is an equivalent of food property only for plants (am I right?). Why don't we have one food/nourishment property? Their role is the same - stack "eaten mass". Making one property here would simplify metabolizing property code.

/Peter

Yeah, perhaps it's just better to have one "nourishing" property both for things that can be eaten passively and those that can be eaten actively, and then let the value of the property determine the applicable logic. The main point is to move the code for handling Eat ops to this property.

/Erik

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.