mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-16 16:46:07 +09:00
new savegame scheme suggestion
This commit is contained in:
@@ -1,74 +1,31 @@
|
||||
## Format ##
|
||||
## Introduction ##
|
||||
|
||||
Contain everything on [TEVD](github.com/minjaesong/TerranVirtualDisk)
|
||||
On the main game, any player can access any generated worlds, and thus players data and worlds are saved separately.
|
||||
|
||||
* Save meta
|
||||
- binary
|
||||
- Filename : world (with no extension)
|
||||
The main game directory is composed of following directories:
|
||||
|
||||
|Type |Mnemonic |Description |
|
||||
|----------|-----------|-----------------------------|
|
||||
|Byte[4] |TESV |Magic |
|
||||
|Byte[n] |name |Savegame name, UTF-8 |
|
||||
|Byte |NULL |String terminator |
|
||||
|Byte[8] |terraseed |Terrain seed |
|
||||
|Byte[8] |rogueseed |Randomiser seed |
|
||||
|Byte[4] |crc1 |CRC-32 of worldinfo1 entry |
|
||||
|Byte[4] |crc2 |CRC-32 of worldinfo2 entry |
|
||||
|Byte[4] |crc3 |CRC-32 of worldinfo3 entry |
|
||||
|Byte[4] |crc4 |CRC-32 of worldinfo4 entry |
|
||||
|Byte[32] |hash4321 |SHA-256 of crc4..crc3..crc2..crc1|
|
||||
|Int |refid |Reference ID of the player |
|
||||
|Long |time_t |Current world's time_t |
|
||||
|Byte[6] |t_create |Creation time of the savefile in time_t|
|
||||
|Byte[6] |t_lastacc |Last play time in time_t |
|
||||
|Int |t_wasted |Total playtime in time_t |
|
||||
|
||||
Endianness: Big
|
||||
|
||||
each entry on the disk contains CRC of its data, we can compare CRC saved in meta && CRC of entry header && CRC of actual content
|
||||
```
|
||||
.Terrarum
|
||||
+ Players
|
||||
- <Player Name Here>, JSON.gz
|
||||
+ Shared
|
||||
- <e.g. Disk GUID>, TEVD { * }
|
||||
- <this directory can have anything>
|
||||
+ Worlds
|
||||
- <World Name Here>, TVDA { WriteWorld, actors JSON, chunk data, screenshot.tga.gz taken by the last player }
|
||||
```
|
||||
|
||||
* Actor/Faction data
|
||||
- GSON
|
||||
- Filename : (refid) (with no extension)
|
||||
(TEVD stands for Terrarum Virtual Disk spec version 3, TVDA stands for spec version 254; both have MAGIC header of `TEVd`)
|
||||
|
||||
## Prerequisites ##
|
||||
|
||||
* Prop data
|
||||
- CSV
|
||||
- Filename : (with no extension)
|
||||
worldinfo2 -- tileprop
|
||||
worldinfo3 -- itemprop
|
||||
worldinfo4 -- materialprop
|
||||
worldinfo5 -- modules loadorder
|
||||
1. Player ID must not be strictly 9545698 (0x91A7E2)
|
||||
1. Use classname `net.torvald.terrarum.modulebasegame.gameactors.IngamePlayer` to check
|
||||
2. Each world has to be uniquely identifiable
|
||||
1. Use GUID, World Name, etc.
|
||||
3. `ActorNowPlaying` must be drawn on top of other actors of same RenderOrder
|
||||
|
||||
## Goals ##
|
||||
|
||||
* Human-readable
|
||||
- Tiles_list.txt -- list of tiles in csv
|
||||
- Items_list.txt -- list of items in csv
|
||||
- Materials_list.txt -- list of materials in csv
|
||||
- load_order.txt -- module load order
|
||||
|
||||
|
||||
|
||||
## How it works ##
|
||||
* If hash discrepancy has detected, (hash of csv in save dir != stored hash || hash of TEMD != stored hash), printout "Save file corrupted. Continue?" with prompt "Yes/No"
|
||||
|
||||
Directory:
|
||||
|
||||
+--- <save1.tevd>
|
||||
--- 2a93bc5f (item ID) Actor/DynamicItem/Faction/etc. data (JSON)
|
||||
--- 423bdc83 (item ID) Actor/DynamicItem/Faction/etc. data (JSON)
|
||||
--- Items_list.txt Human-readable
|
||||
--- Materials_list.txt Human-readable
|
||||
--- Tiles_list.txt Human-readable
|
||||
--- world save meta (binary)
|
||||
--- worldinfo1 TEMD (binary)
|
||||
--- worldinfo2 tileprop (CSV)
|
||||
--- worldinfo3 itemprop (CSV)
|
||||
--- worldinfo4 materialprop (CSV)
|
||||
+--- computers
|
||||
--- (UUID) virtual disk
|
||||
+--- tapestries
|
||||
--- (random Int) tapestry
|
||||
|
||||
Alongside with save1.tevd (extension should not exist in real game), keep save1.backup.tevd as a last-working save.
|
||||
1. Allows multiple players share same world
|
||||
2. Makes multiplayer possible
|
||||
|
||||
Reference in New Issue
Block a user