Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compact chunk updates, for full blocks from server instead of delta #136

Closed
satoshinm opened this issue May 17, 2017 · 4 comments
Closed
Labels
Milestone

Comments

@satoshinm
Copy link
Owner

From the original Craft readme, https://github.com/fogleman/Craft#database:

Only the delta is stored, so the default world is generated and then the user changes are applied on top when loading.

and the server sends deltas using the B, command. But to decouple the client terrain from the server terrain, it would be useful to instead change this to have the server send all of the blocks. To do this efficiently, ought to support a packed chunk format, as compact as possible (not B,p,q,x,y,z,w for each block - mass block chunk updates).

@satoshinm
Copy link
Owner Author

Compact chunk updates may help address the problem described in today's review on https://www.spigotmc.org/resources/websandboxmc.39415/ "The only pitfall Ive come across though is the high amount of resource consumption Ive noticed it takes up. (Depending on your render radius mind you) Mine was set to 100 and it rose my 6GB RAM from 30% usage up to 65%"

@satoshinm
Copy link
Owner Author

ThinkMap sends chunks data like this: https://github.com/satoshinm/ThinkMap/blob/75fec8c065a7b83ec723cff99336c10368b431ad/bukkit/src/main/java/uk/co/thinkofdeath/thinkcraft/bukkit/world/ChunkManager.java#L210-L254 - world.getChunkAt(x, z) then on the Chunk object, getChunkSnapshot(): https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Chunk.html#getChunkSnapshot-boolean-boolean-boolean-. This looks appropriate: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/ChunkSnapshot.html "Purpose is to allow clean, efficient copy of a chunk data to be made, and then handed off for processing in another thread (e.g. map rendering)"

@satoshinm
Copy link
Owner Author

Using a short for future expansion (16-bit blocks: #55), so far writing the web block types to a buffer and compressing it, a nice savings - to do: send it

23:59:16 [INFO] [WebSandboxMC] uncompressed: 65536
23:59:16 [INFO] [WebSandboxMC] gzip'd: 3031

@satoshinm
Copy link
Owner Author

Added in #173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant