[Feedback] Testing 224 - Crop growth times

its a question of scale here though. If you were just planting a single crop and then sat there waiting for it to grow… then yeh I agree rng is horrific. but when you have a small field full of crops, it doesnt really matter if 1 or 2 crops continuously hit a cycle of bad rng and dont mature for longer, when the reset of the field fully matured (and parts of it matured even more quickly), especially when you can “plant and forget” if you want and you arent consuming valuable resources in the process of growing crops like with forging too.

yea and thats the thing with it when i was runing it tho my head i was thinking like a backyard garden 1 maybe 2 plots big cuz if you are a builder starting out leveling is brutal(my main was only 42 when i quit after 5 months or so of playing) even more so if you are solo player(due to the fact that some professions like mineing makeing next to no xp till you hit end game and no longer really need it) i did not start getting any buffer cubits till my late 20’s mid 30’s and for sure would not have had any to spare to build a 10-25 plot big farm so a lot of mid tier players are going to only have 3 or 4 crop farm.

1 Like

even with 1 plot you can have hundreds of crops, I dont even see the point in doing farming at all if you only have 3 or 4 crops…

4 Likes

1 plot gets you less than 64 plants. Unless you ignore optimization, then you get exactly 64 with a greatly reduced yield. For a single smart stack of mats you are look at 8 plots with room for optimizing blocks.

2 Likes

ok i was messing up bad then the little test i ran i only got 30 on 1 plot i guess i was thinking minecraft logic and did not try to see how many i could shove in there

No, you are right. With optimizing blocks you are looking at about 30 blocks of actual plants. Tho you can get crazy with ramp planting to make the most use of the 8 by 8 cube.

How are fields ticking in their planting order, are you storing some kind of timestamp when it was last ticked, or planting time? I don’t think the ticking always happens at midnight.

I did some tests and I’m not sure what to think of the data, the number of ready crops doesn’t follow the poisson distribution as well as I had thought.

Number of crops ready as time goes on

expectedDays = 80
cropStages = 8
success = Math.random() < expectedDays / cropStages / 100;
image
Field fully grown in 211 ticks

Multiple runs

Field fully grown, took 211 ticks to complete
Field fully grown, took 194 ticks to complete
Field fully grown, took 211 ticks to complete
Field fully grown, took 193 ticks to complete
Field fully grown, took 183 ticks to complete
Field fully grown, took 180 ticks to complete
Field fully grown, took 203 ticks to complete

Just to confirm it’s not a design issue, but a programming one? Showing the players the worst case scenarios in the tooltips would also make less frustrated players. If it says 18 hours and it’s not ready after 3 days I wouldn’t like it.

If you keep count of failed growth attempts (this growth stage only, in the case of a 10 day/stage crop it’s taking up 5 bits), cutting that tail is possible. Probably you can come up with a more intricate one, if you store some kind of a time stamp it’d become a lot easier.

success = Math.random() < expectedDays / cropStages / 600 + expectedDays / cropStages / 300 * failedAttempts;
image

All graphs made with Boundless Grow Simulator

edit: I know storing the failed count isn’t realistic as the size can be much larger, I was just trying to see how it’d affect the curve. There should be a more efficient way of achieving the same.

2 Likes

You can squeeze a lot more than 30 optimal plants into a plot if you utilize the space better… but where is the fun in single plot farms? I want to build towering hydroponic stacks and sprawling fields of flooded rice paddies. Dozens, maybe hundreds of plots. It would be silly if plant’s code was so complex that I was restricted to farms that were dwarfed by the average workshop.

1 Like

I want to say thank you for this very in depth and informative response, I really appreciate that you took the time.

Especially as it probably feels like telling a 5 year old how electricity works!

4 Likes

Each simulation cell (16x16x16) has a timestamp of when it was last updated for crops, and there are 24 buckets the crops are sorted into based on placement time (modulo crop cycle) so that crops placed within 1 minute of eachother will update at the same time, then the crops placed in the next minute and so forth; mostly this is about reducing the amount of work done per-frame since its unlikely “every crop” in the cell is placed into the same bucket, but also means that you never have a case of placing a crop and then it “instantly” ticking, it’ll always tick 23-24minutes later and then every 24th minute from then on.

cant see the code of your simulator, but based on your “Math.random()” line, that is only the case of 1 tick, its possible for the crop to go any number of ticks in a single update (just much less likely), the tick is more like:

L = deltaTime * growthStages / timeToMature;
u = random();
p = s = exp(-L);
for (i = 0; stage < growthStages && u > s; ++stage)
{
  p *= L / ++i;
  s += p;
}
2 Likes

That will be improved in the next update; no crop-simulation time was being lost, but the fast-forwarding functioned so that some crops may not have done their fast-forward for nearly 24 minutes in the worst-case; all crops will tick once to fast-forward when revisting within roughly 12 seconds in the next update.

3 Likes

Not sure I implemented it correctly but it didn’t change much. The code is in https://boundless.mayumi.fi/farming/simulator/javascript.js tickArray()

I wasn’t sure what your deltaTime contains, I’m assuming it’s for retroactively ticking multiple times?

js code
let stage = arr[x][y]; // current growth stage
let growthStages = cropStages.length; // crop total growth stage count
let L = growthStages / expectedDays;
let u = Math.random();
let p = s = Math.exp(-L);
for(let i = 0; stage < growthStages && u > s; ++stage)
{
    p *= L / ++i;
    s += p;
    arr[x][y]++; // stage is not a reference for some javascript reason
}

The curve didn’t change much, but I’d presume the average number of ticks went down. Sample size is too small to say really.

image

Field fully grown, took 200 ticks to complete
Field fully grown, took 193 ticks to complete
Field fully grown, took 192 ticks to complete
Field fully grown, took 249 ticks to complete
Field fully grown, took 195 ticks to complete
Field fully grown, took 207 ticks to complete
Field fully grown, took 191 ticks to complete
Field fully grown, took 212 ticks to complete

1 Like

well what do you mean by it doesnt follow poisson? that by definition is poisson; the loop is generating a stage increment according to the poisson distribution with parameter L.

yes the deltaTime is for fast-forwarding.

I’m probably just misunderstanding what it means

The horizontal axis is the index k , the number of occurrences. λ is the expected number of occurrences, which need not be an integer.

I read that as the probability of > 2λ should be 0. The graphs go a lot longer, but now that I think of it that’s because of the cumulative effects, what you’re saying is that a single growth tick follows the poisson curve, not that the whole field should be ready according to it?

In any case that’s not the point, and I can live with it, I’m only afraid that the tooltip growth times can be misleading to players because there can be such great variance in field growth times. I’m seeing 80 day crop fields take 180 - 250 days to be 100% ready.

“fully grown” is the CDF of the poisson which looks like your graph (just upside down).

Yup I missed the CDF part. :stuck_out_tongue:

Some content too: on average, on day 80 of a 80 day crop, the field is 65% complete :thinking:

If I increase the growth stages to 22, the field is 55% ready at day 80, but the whole field is ready much earlier than with 8 stages. On average at 150 days. Maybe there’s a bug in my simulator.

You can actually get a fairly optimised farm with just 2 plots, giving a total of 96 crops. This is all on a single level, but could potentially be increased to multi-level using gleamlight instead of daylight

I’m currently working out best optimisations for all crops and will be happy to share all my findings when I have finished.

2 Likes

more stages with same growth time reduces the variance in the simulation, eventually if you have as many growth stages as days of growth, it just becomes a lock-step 1 growth-step per day exactly.

BTW, would it be an idea for the update to Testing later today to lower growing times for testing purposes only? That way we are able to test things a bit more quickly.

Tho make sure to add to patch notes that it’s just for testing purposes and not the actual growing times :wink:

I am not sure this is a good idea. If all the crops mature to quickly then we will be unable to see how bad the rng is affecting what percentage of the crops are not reaching maturity when the rest of the field is fully mature.

1 Like