From 6e63ab7fdc61deefa743efbbfd78701a3339cc06 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Fri, 12 Feb 2021 14:14:09 +0900 Subject: [PATCH] savegame format upd? --- src/net/torvald/terrarum/serialise/SavegameWriter.kt | 7 +++++++ work_files/DataFormats/Savegame container.txt | 6 +++--- work_files/DataFormats/Worldmap format.txt | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/net/torvald/terrarum/serialise/SavegameWriter.kt b/src/net/torvald/terrarum/serialise/SavegameWriter.kt index ef0d8a85b..50c3aa53d 100644 --- a/src/net/torvald/terrarum/serialise/SavegameWriter.kt +++ b/src/net/torvald/terrarum/serialise/SavegameWriter.kt @@ -18,6 +18,13 @@ import kotlin.math.roundToInt internal class RNGPool() { private val RNG = HQRNG() private val used = SortedArrayList() + + init { + for (i in 0 until 32767) { + used.add(i) + } + } + fun next(): Int { var n = RNG.nextLong().ushr(32).toInt() while (used.contains(n)) { diff --git a/work_files/DataFormats/Savegame container.txt b/work_files/DataFormats/Savegame container.txt index 85bd10594..a7bbdf1b6 100644 --- a/work_files/DataFormats/Savegame container.txt +++ b/work_files/DataFormats/Savegame container.txt @@ -14,9 +14,9 @@ Files contained the TerranVirtualDisk is as follows: Has fixed Entry ID of 32763 world[n] -- Layer Data (TEMD); [n] is a serial number of the world (starts at 1) Has fixed Entry ID of [n] - (any random number in Hex ACTORID_MIN..FFFFFFFF) -- Serialised Entity Information (including Player) - (PLAYER_REF_ID in Hex -- 91A7E2) -- Player Character Information (Serialised--JSON'd--Entity Information) - (51621D) -- The Debug Player (Serialised Entity Information) + (any random number in Hex ACTORID_MIN..FFFFFFFF) -- Serialised Entity Information (including Player), Entry ID is random + (PLAYER_REF_ID in Hex -- 91A7E2) -- Player Character Information (Serialised--JSON'd--Entity Information), Entry ID is random + (51621D) -- The Debug Player (Serialised Entity Information), Entry ID is random load_order.txt -- LoadOrder.csv (NOT zipped) Has fixed Entry ID of 32767 diff --git a/work_files/DataFormats/Worldmap format.txt b/work_files/DataFormats/Worldmap format.txt index db32dfa5e..c8a9ce1ed 100644 --- a/work_files/DataFormats/Worldmap format.txt +++ b/work_files/DataFormats/Worldmap format.txt @@ -53,7 +53,7 @@ Ord Hex Description Payload "TERR" -- world terrain data in Uint16 Uncompressed size will be 2x of (width * height) -Payload "WALL" -- world walls data in Unit16 +Payload "WALL" -- world walls data in Uint16 Uncompressed size will be 2x of (width * height) Payload "TdMG" -- world terrain damage data, array of: (Int48 tileAddress, Float32 damage)