Implement a new ``type`` for plants / Expand furniture functionality for plants
#75,776 创建于 2024年8月17日
描述
Is your feature request related to a problem? Please describe.
When reading and responding to #75708 I realized I never actually wrote down my thoughts on plants anywhere, I have just been rambling on discord for the past 2 years. I am not able to implement absolutely anything here, but at least writing this down means that some poor C++ capable fool might fall into my trap and implement this.
The long story short is - we really have a painfully poor system for plants as it stands. It is currently split into:
- Terrain plants - which are harvestable and can regrow after some (I believe static) amount of time so they can be harvestable again - have all the flaws associated with terrain and the harvestable/harvested versions need to be separate terrains, meaning each of those needs to be specified in the JSON twice - this is nonideal on the code side, and actively problematic on the tileset side as it means each of those needs 8 sprites to have full coverage across all the seasons
- Furniture plants - which are harvestable and then they're just fucking gone - this is mostly fine, albeit barebones - they don't exactly have many issues (other than just the system being crude) other than not supporting transformation through harvest to my knowledge
- Crops - which are furniture under the hood but have a plethora of hardcoded interactions and carry the data primarily from the seed item
All of those have something the others don't have, and neither is even close to perfect. The terrain approach is a massive JSON churn and a pain in the ass from the tileset side, the furniture can't regrow, and neither of those can have growth stages like the crops do.
Solution you would like.
Either expand the functionality of type: furniture or implement a new type: plant to handle this. Have the chosen type be able to track growth stages as well as harvest results/yield, and ideally temperature tracking, so that plants can automatically stop growing/producing their harvest when temperature goes below a certain threshold (this is why the new type approach is handy - having ALL furniture track temperature I believe would slow the game down to a crawl). This would, ideally, allow us to unify crops, furniture, and terrain in the same functionality and allow more plants to be planted.
What I am saying is have the growth timers as well as harvestable/harvested distinction be handled in the metadata of a single JSON object, instead of requiring multiple to function, and be able to be placed on different terrain while doing so.
If chosing the new type option, this would also require the terrain/furniture migration to be expanded to support this type.
Describe alternatives you have considered.
This poses a lot of performance concerns. This change would mean that not only do all affected plants track upgrade timers like #75708 proposed, but they also track temperature. How much that'd slow the game down I cannot predict, but given that in most cases plants are pretty common I would say the impact would be nonzero, and if anything I presume this would be the main dealbreaker on this idea.
Additional context
It would also be nice to have support for plants growing on other plants, such as shelf fungi on trees, but realistically that's just wishful thinking and I cannot think of a use case for this that isn't cosmetic.
And if anyone in the comments points out I just called fungi a plant I will lose my mind