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

Pumpkin saving format #444

Open
wants to merge 16 commits into
base: anvil-saving
Choose a base branch
from
Open

Conversation

suprohub
Copy link
Contributor

@suprohub suprohub commented Jan 2, 2025

I think will be cool, if now we write a simple file format for saving, like a temp solution, because anvil is not working now.
When in future, we can modify and remove java & mojang & skill issues.
Also will be cool make post in docs

Testing

cargo run
join -> leave -> join
when say "Yaaa yooo its works wooow"

Please follow our Coding Guidelines

@Snowiiii
Copy link
Member

Snowiiii commented Jan 2, 2025

Does this actually even work ?. If you modify the terrain and restart the Server will the new placed blocks be saved ?. I also wonder how we should get the exact chunk from the region file which contains multiple chunks in one file because there is no location table. I also already can guess that these files will be really large since there is no compression (or any optimization at all)

I also want to mention that making our own "File Format" or a "Protocol" or any kind of thing you or others want to use in the future, you should write an good Specification before doing that.

I'm sorry to say but this just seems really error prone and i'm sure this will have many issues, Lets just wait until the anvil saving thing will be ready, It will be one day. It would be more useful if you would try to help with that than making an own Format

@suprohub
Copy link
Contributor Author

suprohub commented Jan 3, 2025

SPecificatiob
Its works not correctly now, because its depends on palette system from anvil, but i fix it (i try create a normal system with using bytes instead of longs). Also i not want to use nbt.

So how it works: i want no use region files, and rely on os filesystem, because file systems are designed to handle large numbers of files. So we can just get chunk by name.
Also separating chunks by what can increase performance in theory, because we not need to compress & decompress large data every second what player places block or other things.

Compression

Compression is difficult, its need talks. We need to use many different techniques, like palette or rle (RleVec), and on output use standart compression like lz4. For regions optimization, we can create a settings what defines a region size (like 2 chunks, 4 chunks, etc..), because some people wants a wery big performance, and other wants a big compression ratio. For region compression we can use zip.

@suprohub
Copy link
Contributor Author

suprohub commented Jan 3, 2025

also, user can set custom filesystem to increase performace or stability

@suprohub
Copy link
Contributor Author

suprohub commented Jan 3, 2025

@suprohub
Copy link
Contributor Author

suprohub commented Jan 3, 2025

https://docs.rs/bitvec/latest/bitvec/

bitvec enables you to write code for bit-addressed memory that is simple, easy, and fast. It compiles to the same, or even better, object code than you would get from writing shift/mask instructions manually. It leverages Rust’s powerful reference and type systems to create a system that seamlessly bridges single-bit addressing, precise control of in-memory layout, and Rust-native ownership and borrowing mechanisms.

@suprohub
Copy link
Contributor Author

suprohub commented Jan 3, 2025

@Snowiiii
2025-01-03_21 43 50

@suprohub
Copy link
Contributor Author

suprohub commented Jan 3, 2025

saving works very good

@suprohub
Copy link
Contributor Author

suprohub commented Jan 3, 2025

btw, this is isze
изображение

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

Successfully merging this pull request may close these issues.

2 participants