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

Separate chunk saving #470

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

suprohub
Copy link
Contributor

@suprohub suprohub commented Jan 10, 2025

Description

WHat??? what the separation? u sily?
..

No.
My idea its separate chunk reading and writing. I want make 2 steps.

First we serialize a chunk in bytes. Its can be a simple vanilla anvil serialization.
Second we need write chunk to disk.
But how? Mojang for java now uses a location table. its a simple approach and not very good.

Will be cool add a db like in bedrock, or some other solutions. And also will be cool to use custom more optimized format.

But what, if server owner wants very fast chunk saving and not prioritizes space on disk what chunks are consuming? Or if owner wants another solution - dont waste disk space and have slow chunk saving? Or he wants a better vanilla compalibitle but want fast chunk access?

So, for all these questions i make solution - separated chunks.
Now its looks like this (example) :

db:

  • InformativeTable (Location + Timestamp)
  • RocksDB
  • SurrealDB
  • LevelDB
  • iWantUseMultipleFiles

format:

  • Anvil
  • MCRegion
  • Pumpkin
  • StupidSolutionsInc

Also its not a final version, and i want to discuss with us. And yeah, plugins can also make impls simplier, because for plugins dont need to be recreate location table functions.

Testing

cargo run
see inital works, see errors in console
see whats all savings and chunks working

Please follow our Coding Guidelines

@Snowiiii
Copy link
Member

  1. This is called abstraction, using that term is more clear than "Separate chunk saving".
  2. The ChunkStatus enum is gone from pumpkin-world

I don't link the abstraction you made, You just put in 4 different types into level now

@suprohub suprohub force-pushed the chunk-saving-separator branch from 4996784 to 5bcb5ad Compare January 24, 2025 12:48
}
}

/*#[cfg(test)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you commented out the test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk.
Maybe because i waited opinions, amd forgor fix test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can uncomment it. Or i can fix it when can

@Snowiiii
Copy link
Member

Looks like you just copy pasted the anvil implementation into InformativeTable. Also we should use Anvil as default

@suprohub
Copy link
Contributor Author

Looks like you just copy pasted the anvil implementation into InformativeTable. Also we should use Anvil as default

Yeah, but like.. How i can name it?? "Anvil raw saving implementation?"
I named it with short name for simplicity.

@suprohub
Copy link
Contributor Author

And also we use anvil by default

@Mili-ssm Mili-ssm mentioned this pull request Jan 28, 2025
2 tasks
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