Fractal Block World
Saved Game Database Types
Back
The game now uses a SQLite database for saved games.
This should help Linux users.
The variable engine.chunk_db.type
specifies which database type is used.
When a new player is created,
this determines what database type is used for that player.
It does not affect existing players.
The Old Database (db1)
If you set engine.chunk_db.type to "db1" (without the quotes),
then any new game that is created will use the old (db1) database type.
So to be clear, if you want all new games you create to use db1, then
go into your file Input/Scripts/program_startup.txt and add the following line at the end:
set engine.chunk_db.type "db1"
If the file program_startup.txt does not already exist,
you can either create a blank one or copy
Input/Scripts/program_startup_backup.txt to it.
Then when you start up the program,
all new games will use db1.
The database type db1 has one file on disc per modified chunk
(resulting in potentially thousands of files) which can be slow on Linux.
These individual "chunk files" are stored in the folder named
Chunks of the player's save folder.
So let's say you have a player named Bob.
The chunk files will be in the
Data/Save/Bob/Chunks
folder.
You can tell if the player you are playing
uses this type of database if your HUD has an icon
with a yellow cylinder on it (shown above).
The New Database (db2)
If you set engine.chunk_db.type to "db2" (without the quotes),
then any new game that is created will use the new (db2) database type.
So to be clear, if you want all new games you create to use db2, then
go into your file Input/Scripts/program_startup.txt and add the following line
at the end:
set engine.chunk_db.type "db2"
If the file program_startup.txt does not already exist,
you can either create a blank one or copy
Input/Scripts/program_startup_backup.txt to it.
Then when you start up the program,
all new games will use db2.
The db2 type uses an SQLite database (one file on disc).
This should help Linux users.
The database is stored in the file
Chunks2/chunks2.db.
So let's say you have a player named Bob.
The chunk files will be in the
Data/Save/Bob/Chunks2/chunks2.db
file.
No icon will be shown
on your HUD if you are using this type of database.
Extracting the db2 Chunk Files (Debugging)
The good thing about db1 is it is trivial to see what
is in any individual chunk file (you just open the .txt file
from your file explorer).
With db2, the chunk files are all stored inside the one big
SQLite chunks2.db file.
However there is a way to extract the individual chunk files if you
are a modder and need to debug.
Open the console and run the following command:
debug_cf_dump db2_to_db1
This will create the folder
Chunks2/DebugChunks
in the player's folder and fill it with .txt chunk files.
Converting up from db1 to db2
If you set the variable
engine.chunk_db.convert_up
to true, then whenever you load a game that has a db1
but not a db2, then the db1 will be copied to make a new db2
and then the db1 folder will be renamed (thus saving it but making it unusable).
Creating the db2 from the db1 might be very slow on Linux,
because we have to read every .txt chunk file from disc.
That is,
the folder Chunks2 will be created and the old
Chunks folder
will be renamed to __Chunks.
Notice the double underscores.
Feel free to move __Chunks to another location on your computer.
It will not be used by the engine.
Or, you could simply delete the __Chunks folder
(but keep the Chunks2 folder of course).