Jump to content

Recommended Posts

Posted

I've seen negative videos about running into ice and snow during the summer on youtube so that needs to be headed off.

So today, I logged on my entire field of pumpkins updated over about 8 seconds.    About 1000 blocks worth of vines and pumpkins.  With no performance hit.

I think you could speed up ice and snow removal without a severe negative impact.

There are three stages to this.

Here is how I would implement it in an efficient way.

1) When the player logs on, I would determine daily temperature range.   If the night temperature is below 0C and the daily high is below 5C, there is no need to check for enhanced snow and ice removal.
2) Establish a configurable "Ice and snow removal budget" with a range of 255 to X (where your testing or experience shows X is a reasonable maximum but 32767 would probably be good).

3) When snow and ice blocks are placed, flag the chunk as having ice or snow.  <-- this is important for performance

4) When the chunk is loaded, if it is flagged as having ice or snow, add a soft pointer (one that will fail gracefully if the chunk is unloaded before the snow cleanup can get to it) to the chunk to a list.

5) Each server tick, process snow chunks until the budget per tick is reached.

I'm pretty sure this will be performant even on servers.   Within 15 seconds, it would probably remove the snow and ice.    You might also have a "range from player" that checks if the chunks are within "X" chunks of the player (likely good value 16 which would mean about 750 chunks per player to process which would be about 191,000 surface blocks to clear).

Right now you appear to be doing the "choose a certain number of random blocks in a chunk and process them" each tick approach.

A lighter weight approach than above would be 
"When removing a snow or ice block, remove a manhattan distance diamond of all blocks within 3 blocks.

It is jarring when 
a) You wade through fields of snow at the end of summer
b) They don't thaw before the next winter arrives even tho it's 26C out.

  • Like 2
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.