Page MenuHomeFeedback Tracker

PlantBase issues
New, NormalPublic

Description

Hello. There's several issues with how PlantBase is done right now but these are most critical issues:

  • m_HasCrops doesn't get saved on the plant which means at restart a plant that was recently harvested, it will be harvestable again.
  • m_GrowthTimer doesn't resume the timer from where it was left off at restart. While generally for vanilla plants this is okay because growth time is between 22-45 minutes, any higher timers will cause issues where the timer will completely reset at restart making the plant take longer to grow. E.g. Plant takes total of 12 hours to grow. 4 stages means 3 hour growth timer. Restarts usually happen every 6 hours on modded servers, some even 4 hours. This way means there's only one growth per restart happening as the restart resets it from 0. This causes a plant meant to be grown in 12 hour to actually grow in 24 hours.

The other timers on the plant seem to save the time it has remaining and resuming that. But I understand that the m_GrowthTimer is on loop which might be the reason it is the way it is. Instead of doing a loop, restart the timer at the end of the GrowthTimerTick() function if still needed.

Minor issues:
We seem to be saving an awful lot of variables that are just constants from config of the plant.
m_GrowthTimer seems to be running constantly until the plant spoils even if the plant is mature. (i'm not 100% sure on this as I'm still digging through the massive code for PlantBase) This would be resolved if we don't do a loop or do a stop on the timer if mature.
Spoil timer seems to only start after another growth loop even though the plant has become mature in the prev loop.

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

sileed added a subscriber: sileed.Oct 23 2023, 2:32 PM
BuGs added a subscriber: BuGs.Mar 3 2024, 9:04 PM


Adding to this issue as I discovered another weird behaviour.
I have a custom child of GardenBase (a greenhouse) and the "growthTimer" doesn't actually trigger the function CreatePlant
This seems to work on GardenPlot. I do not modify these functions or anything referenced in them.
I don't see why we need the timer there as we instantly create the plant when the order of planting is inversed.
If we plant seed, then water, we create instantly.
If we water first, then plant seed, we use timer.