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

Save and load all modified chunks #331

Merged
merged 2 commits into from
Jan 11, 2024
Merged

Conversation

patowen
Copy link
Collaborator

@patowen patowen commented Dec 17, 2023

Whenever a block is updated, ensure that an updated version of the relevant node is written to the save file. When a world is initialized on the server-side, all modified chunks are loaded from the save file and stored in memory, to be retrieved whenever the relevant node is to be added to the graph.

This is a temporary implementation, as it does not properly scale for larger worlds, where we may not want to store all modified chunks in RAM.

Note that while this implements loading save data, it only loads voxels. Entity locations, such as the player's location, are ignored.

server/src/sim.rs Outdated Show resolved Hide resolved
@patowen patowen force-pushed the loading-voxels branch 2 times, most recently from add052c to d53b969 Compare December 21, 2023 04:28
@patowen patowen marked this pull request as ready for review December 21, 2023 04:29
@patowen patowen requested a review from Ralith December 21, 2023 04:29
server/src/sim.rs Outdated Show resolved Hide resolved
save/src/lib.rs Outdated Show resolved Hide resolved
server/src/sim.rs Outdated Show resolved Hide resolved
server/src/sim.rs Show resolved Hide resolved
@patowen patowen requested a review from Ralith January 11, 2024 04:47
@Ralith Ralith merged commit 37625ea into Ralith:master Jan 11, 2024
6 checks passed
@patowen
Copy link
Collaborator Author

patowen commented Jan 11, 2024

Thanks for reviewing/merging!

@patowen patowen deleted the loading-voxels branch January 11, 2024 05:10
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