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

How do saving works? #85

Open
Favkis opened this issue Jun 19, 2021 · 5 comments
Open

How do saving works? #85

Favkis opened this issue Jun 19, 2021 · 5 comments
Labels

Comments

@Favkis
Copy link

Favkis commented Jun 19, 2021

Can't seem to find how it works and how do I reset save?

@Zylann
Copy link
Owner

Zylann commented Jun 21, 2021

This relates to VoxelStream, which is a part of the voxel engine that remains to be documented.

Currently in the blocky_game, the terrain is continuously streamed block by block (where "block" is a 16x16x16 chunk) and saved to files under a folder. Currently it uses VoxelStreamRegionFiles so the format is similar to Minecraft: a bunch of region files, where each contains a bunch of blocks. The path to this directory is set in the editor, but could be set at runtime if necessary (as long as it's done before the scene runs).
Depending on the settings, blocks get saved:

  • Straight after being generated, if save_generator_output is enabled on the stream
  • They get out of range and had changes
  • VoxelTerrain.save_modified_blocks() is called, typically used before quitting the game

To reset a save, deleting the contents of the folder or changing the path to another folder will make it go back from scratch.

@LVLRGames
Copy link

where might one find more detailed instructions on how to set up a voxelStreamSqlite? I've been at it for 3 days and cant get voxel tools to locate the database file.
What would a correct example of a database path look like?
What is it relative to?
What file extension should the database file be saved in ?

@Zylann
Copy link
Owner

Zylann commented Mar 7, 2023

The path must be a file inside an existing directory. The file will be created if it does not exist. The path must not be relative to res://, and currently doesnt support user:// (though there might be a way to convert).
I think file extension doesn't matter, but I've been using .sqlite.

This is indicated in the doc https://voxel-tools.readthedocs.io/en/latest/api/VoxelStreamSQLite/#i_database_path

The schema of the database itself is documented here: https://voxel-tools.readthedocs.io/en/latest/specs/sqlite_format/
But it is generated automatically when the file is created.

@WithinAmnesia
Copy link

WithinAmnesia commented Feb 20, 2024

This relates to VoxelStream, which is a part of the voxel engine that remains to be documented.

Currently in the blocky_game, the terrain is continuously streamed block by block (where "block" is a 16x16x16 chunk) and saved to files under a folder. Currently it uses VoxelStreamRegionFiles so the format is similar to Minecraft: a bunch of region files, where each contains a bunch of blocks. The path to this directory is set in the editor, but could be set at runtime if necessary (as long as it's done before the scene runs). Depending on the settings, blocks get saved:

* Straight after being generated, if `save_generator_output` is enabled on the stream

* They get out of range and had changes

* `VoxelTerrain.save_modified_blocks()` is called, typically used before quitting the game

To reset a save, deleting the contents of the folder or changing the path to another folder will make it go back from scratch.

How do we make multiplayer saves happen?

How does the chunk data get saved and how can the server get and save and access the chunk data / big array of chunks?

How can this be simplified if its top down 2D as in just tiles? This is the only working multiple client voxel multiplayer game with Godot engine example. I have tested hundreds of demos and projects.

Is there documentation / where should one look? Where does one find or how to make multiplayer saving work and get it working with an example to learn from?https://voxel-tools.readthedocs.io/en/latest/overview/#saving-voxels-to-disk or https://voxel-tools.readthedocs.io/en/latest/api/VoxelStreamSQLite/#i_database_path or https://voxel-tools.readthedocs.io/en/latest/search.html?q=save what are the data saving options and what are your thoughts and suggestions? What would work well for a 2D array for example and or ~2K-16K players in a simplified top down open-world on the same server? What are multiplayer and server save game data options? What should be done?

This would help myself and others and the entire community make massive multiplayer games with a working multiple client multiplayer seamless chunk system that can work in all cases from 2D, 2.5D, 3D and static and dynamic for this project is a 3D dynamic open-world. If we can get the multiplayer saving to hard-drive / folder and then to have the server load up the same saved dynamic world chunk data just like Minecraft then we are have a massive success.

What are your thoughts and suggestions? What should be done to solve this puzzle? All feedback is welcome.

@WithinAmnesia
Copy link

#100 (comment) This can solve this issue and it can be close for we figured out how to do a somple but sure fire way for multiplayer saving.

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

4 participants