All the Mods 9 - ATM9

All the Mods 9 - ATM9

9M Downloads

[Suggestion] Delete obsolete claims/chunks

cthae opened this issue · 2 comments

commented

Hey!

I suggest to make a piece of funtionality that: If a chunk is not loaded for N weeks, and has no player blocks placed in it, delete the chunk.

This would dramatically reduce the chunks stored. Probably about 70% of chunks generated are never visited again. That is, if you allow rtp. Rtp is the major source for it. Without rtp it probably becomes about 30%.

Complexity.

Not much complexity. All the chunk/claim deletion shouldn't be done in real time. It's ok to run it in batches on server startup.
All this requires is to record the date of when a chunk was unloaded (if there's a chunk unload callback) and just one flag per chunk to indicate whether it has player-placed blocks in the block placement callback. One timestamp and one boolean per chunk to reduce the size of the server by about a half. Should be good.

commented

The chunk claim expiration is a feature already in FTB Chunks. In world/serverconfig/ftbchunks-world.snbt there are settings for this. Specifically:

        # Maximum time (in real-world days) where if no player in a team logs in, the team automatically loses their claims.
        # Prevents chunks being claimed indefinitely by teams who no longer play.
        # Default of 0 means no automatic loss of claims.
        # Default: 0.0
        # Range: 0.0 ~ 3650.0
        max_idle_days_before_unclaim: 0.0d

        # Maximum time (in real-world days) where if no player in a team logs in, any forceloaded chunks owned by the team are no longer forceloa>
        # Prevents chunks being forceloaded indefinitely by teams who no longer play.
        # Default of 0 means no automatic loss of forceloading.
        # Default: 0.0
        # Range: 0.0 ~ 3650.0
        max_idle_days_before_unforce: 0.0d

commented

that's amazing. I'll shrink the suggestion only to chunks deletion then, thanks!