Skip to content

[WIP] Dynamic compression for world data - #90

Open
RecursivePineapple wants to merge 7 commits into
masterfrom
lz4-compression
Open

[WIP] Dynamic compression for world data#90
RecursivePineapple wants to merge 7 commits into
masterfrom
lz4-compression

Conversation

@RecursivePineapple

@RecursivePineapple RecursivePineapple commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator
  • LZ4 compress cube data
  • Add NBT tag/list accessors for the internal maps/lists
  • Compress saved tags with lz4 (optional)
  • Forgot to add gradle.properties
  • spotless

Summary

Chunk/cube saving unconditionally uses GZIP for compression currently. This PR adds the ability for data to be compressed with different algorithms. Currently, only LZ4 is implemented. LZ4 was chosen because it is extremely fast, which eliminates most overhead when loading or saving world data. The algorithm is configurable so that server owners can tweak it or disable it entirely. The compression level can be changed at-will, and the world will be re-compressed with the new format as chunks and cubes are re-saved. I will also add something that re-compresses rarely used chunks/cubes when players haven't visited them in several IRL days.

LZ4 compression was also added to cube data, since CC was uploading over 10MB/s to players as they moved. This should significantly reduce network usage while keeping overhead low. We previously used GZIP to compress packets, but its overhead made the game unplayable.

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

@RecursivePineapple RecursivePineapple added Enhancement Improve an existing mechanic. Please explain the change with a before/after comparison. Performance Changes with the goal of improving performance. labels Jul 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

#93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Improve an existing mechanic. Please explain the change with a before/after comparison. Performance Changes with the goal of improving performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant