ClassiCube / MCGalaxy

A Minecraft Classic / ClassiCube server software
GNU General Public License v3.0
162 stars 76 forks source link

Extension to improve map reloads [suggestion] #731

Open rdebath opened 1 year ago

rdebath commented 1 year ago

Doing /reload on a large map does a slow load and rebuild of the map, as well as the bug of resetting the spawn position. Even reloading a small map is rather visible.

I would like to propose a new extension for making large edits to the client side map. Supported edits would be ...

For client side efficiency it may be reasonable for all these capabilities to be represented in a single packet so that a resize and relocate can be done as a single operation (eg: adding cells at the low edge). The map chunks would be in packets analogous to existing type 3 and 4 packets. (The effective sequence would likely be Extend, Relocate, Reduce, Download)

Use cases for this include: 1) Improve the /reload command so that it can just clean up a small region round the player or do the whole map in an incremental pattern. 2) Incremental download of a extra large map (possibly by extending an initial small map or just filling an empty one). 3) Allow a method of creating an infinite map by using map shifting and map "chunk" downloads. 4) Possibly improve large drawing commands. 5) Possibly improve /resizelvl command.

Possibly limitations, alterations and features. Extension version 1 may only have "Download" and "Relocate" as these are likely easier to implement than Extend and Reduce (especially when combined) and allow the majority of the functionality.

The "Extend, Relocate, Reduce" combined function can be implemented as distinct components unless performance is proven to be required.

Extend and reduce can be the same operation with just a new (x,y,z) size for the map. Larger ordinates are extend, smaller are reduce.