Add "grows" property

Registered by Piotr

Currently plants have ability to grow, given the changes in the metabolism code this should be moved into property too.
I suggest making numerical property with "set_handler" that will account for check for changes in the mass of entity and increase the bbox and model accordingly.
Possibly we should implement growing for animals too.

Blueprint information

Status:
Started
Approver:
Erik Ogenvik
Priority:
Undefined
Drafter:
Piotr
Direction:
Needs approval
Assignee:
Piotr
Definition:
New
Series goal:
None
Implementation:
Beta Available
Milestone target:
None
Started by
Piotr

Related branches

Sprints

Whiteboard

One possible solution would be to trigger the growth code inside metabolizingProperty tick, rendering this blueprint obsolete - however how one should check wether the thing is a plant or animal?
/Peter

Yeah, the logic should be contained in the metabolizingProperty class, but the data for controlling it could very well be placed in a "grows" property (which then wouldn't have any logic itself)
/Erik

At the moment grows property determines if entity grows with mass increase. By default size scalling is equal to cube root of relative mass increase that is: size_scale = pow(new_mass/old_mass, 1/3).
Server only scales the bbox of the entity the client is supposed to take care of the rest.
/Peter

When working on other improvements to the entity system (such as the "transforms" property) I've come to the conclusion that we need to handle uniform scaling of both size and mass much better than what we do now.
The default is that all entities scale uniformly. They pretty much never scale non-uniformly.
Thus, instead of having to update the bbox ourselves we should instead use a "scale" transform and then apply that to the base bbox.
But then what about the mass? Well, mass is always the result of the size of the entity times its density.
Thus, we instead need a "density" property, which when present will update the mass whenever the size of it changes.
This would make the "grows" property unnecessary.
/Erik

Each time you update any of "mass, density, transform.scale" other properties should be updated too. They need to have handler (for set operation?) that reacts to changes - how do you propose to construct such logic?

Grows property should tell if entity grows at all - I'm not sure if its obsolete even with density introduced.Hmm, but maybe we can assume that everything with metabolism grows.

I agree that growing using "scale" transform is a better way to go than writing bbox update.
In case of plants does the code form transforms scale the area_property attached to them aswell?
If yes I will rewrite the "grow" function for metabolism to use transform scale.
/Peter

Scaling the area is something that's specific for plants, so it's not part of the Transforms code.
However, it's as you said not always true that a metabolizing entity grows (we probably don't want that for player characters), so this property should be kept.

/Erik

(?)

Work Items

Work items:
Implement MetabolizingProperty:grow function: DONE
Add grow property to entities that should have it: INPROGRESS

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.