Имя | Тип | Длина | Описание |
---|---|---|---|
⬤ Версия файла | int16
|
2 байта | Номер версии файла сохранения. |
⬤ Смещение Двоичных Данных | int32
|
4 байта | Это смещение файла, с которого начинаются встроенные двоичные данные. |
⬤ Неизвестно | int32
|
4 байта | Кажется, это неиспользуемые данные (все тесты считываются 0) |
⬤ Смещение Таблицы Имен | int32
|
4 байта | Это смещение, с которого начинается таблица имен. |
⬤ Смещение сегмента данных объекта | int32
|
4 байта | Это смещение, с которого начинаются сериализованные данные объекта (свойства). |
⬤ Время игры | float
|
4 байта | В этом разделе хранится внутриигровое время. |
⬤ Счетчик сохранений | int32
|
4 байта | В этом разделе хранится количество сохранений файла. |
Формат Соранения Файла (ASE)
На этой странице описан пользовательский формат файла сохранения, используемый ARK: Survival Evolved в файлах .ark
, и она предназначена для всех, кто хочет изучить или прочитать файлы сохранения напрямую. Файлы .ark
содержат текущее состояние мира, включая существ, инвентарь, предметы, построенные конструкции и состояние листвы. Это двоичный файл с несколькими сегментами, и в настоящее время существует одиннадцать версий формата с номерами от 1 до 11. На этой странице основное внимание уделяется версии 9.
Чтобы понять все это, вам нужны базовые знания о Двоичных файлах и базовое понимание представления чисел в памяти (числа с плавающей запятой, целые числа, и т.д.).
Основной процесс чтения данных файла сохранения Ark выглядит следующим образом:
- Чтение Объекта заголовка файла Ark
- Чтение Объекта имен двоичных данных
- Чтение Объекта таблицы имен
- Чтение Встроенного объекта двоичных данных
- Чтение Неизвестного объекта данных
- Чтение Массива игровых объектов
- Для каждого из игрового объекта прочтите Свойства объекта
Сегменты
Заголовок Файла
Заголовок расположен в самом начале файла и содержит такую информацию, как адреса сегментов, количество сохранений и общее время воспроизведения.
Объект Имен Двоичных Данных
Чтобы прочитать эту таблицу, вам нужно прочитать данные Строк в объект столько раз, сколько было указано в длине массива.
Имя | Тип | Длина | Описание |
---|---|---|---|
Длина массива | Int32 | 2 байта | Это говорит нам, сколько Строк содержится в этом массиве. |
Строковые данные | Строка | Неизвестные байты | Размер этих объектов неизвестен, поскольку данные считываются на лету. |
Таблица Имен
Концепция
"Имена" - это концепция Unreal Engine, которая (в рамках движка) позволяет эффективно сравнивать строки (нужно сравнивать только индексы или хэши (вычисляемые внутри), а не всю строку целиком) и сокращать использование памяти для часто повторяющегося текста. Имена состоят из двух частей:
- Центральная строковая таблица (которой является этот сегмент), которая в двоичном файле специфична для файла и объединена в глобальную, общую для всех объектов в движке во время выполнения;
- И ссылки на эту таблицу, состоящие из индекса таблицы
int32
и номера экземпляраint32
.
Ненулевой номер экземпляра добавляется (уменьшается на единицу) к строке, которой предшествует одиночное подчеркивание.
Распространенным "вариантом использования" имен являются имена объектов и активов, пути, имена и типы свойств и другие строки, которые могут часто появляться.
Сериализованный формат
Этот сегмент начинается со смещения, найденного в заголовке.
Имя | Тип | Длина | Описание |
---|---|---|---|
Array length | int32
|
4 bytes | This tells us how many strings are contained within the table. |
Entries | string[]
|
Null-terminated sequence of strings, the number of which is determined by the fore-mentioned array length field. |
Embeded Binary Data Object
The use of this data is unknown, we will read an array of arrays, containing Int32 numbers. First we will read the Array Length and do a loop that many times, on each of these loops we will:
Read the next 4 bytes as Int32 and loop that many times reading each time another Int32 value into the SubArray.
Name | Type | Length | Description |
---|---|---|---|
Array Length | Int32 | 4 bytes | This tells us how many Arrays are contained in this Array |
SubArray Length | Int32 | 4 bytes | This tells us how many Strings are contained in this Array |
Int32 Data | Int32 | SubArray Length * 4 bytes | Int32 numbers on the array |
Unknown Data Object
This is some unknown data object, we need to read it correctly in case Ark uses it at some point
Name | Type | Length | Description |
---|---|---|---|
Array Length | Int32 | 4 bytes | This tells us how many Arrays are contained in this Array |
Unknown Number | Int32 | 4 bytes | This is an unknown number which appears to be some kind of flags |
Unknown Object Count | Int32 | 4 bytes | This is an unknown number which appears to tells us an object count |
String Data | String | Unknown bytes | Some Unknown String Data |
Object metadata table
This is the primary segment that acts as an index of all game world objects contained within the file.
Name | Type | Length | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Array length | Int32 | 4 bytes | This tells us how many entries are within this table. | ||||||||||||||||||||||||||||||||||||||||||||||||
Entries |
|
Properties Object
This is one of the most "fun" parts to read data from. To create this object we will fill it with an array of the objects we read from the file, first we need to sum the Ark File Header Object's Properties Block Offset with the Game Object's Properties Offset and begin reading from there, until we reach a Class Name named "None"
Name | Type | Length | Description |
---|---|---|---|
Class Name | Ark Class Object | 8 Bytes | Class name of the property if the Result is "None" we need to stop reading at the end of this property. |
Properties Content | Property Object | Unknown Bytes | If the Previous Class Name was not "None" then we begin to read the contents of the property accordingly |
Unknown Integer | Int32 | 4 Bytes | Unknown integer which appeaars to always be 0 (It may be simply a 4 byte long NUL) |
Extra Data | Extra Data Object | Unknown Bytes | Sometimes there's extra data at the end of the properties, you should save this data because it may contain important information. |
Property Object
After reading the property's Class Name you need to read the data according to it's classification:
BoolProperty Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | PropertyBoolean | 1 Bytes | The boolean Value |
ByteProperty Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read, Funny enough this sometimes does not tell us the exact size of bytes to read. |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | UInt8 Or Ark Class Object Or Raw Bytes | 1, 8 or Unknown Bytes | If Length is 1 read as UInt8, If Length is 8 then Read as a Ark Class Object followed with a value of another Ark Class Object, If the Length is different read as Raw Bytes. |
FloatProperty Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | Float | 4 Bytes | The Float Value |
DoubleProperty Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | Double | 8 Bytes | The Double Value |
IntProperty Object
This is read the same as Int32Property Object
Int8Property Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | Int8 | 1 Byte | The Signed Int8 Value |
UInt8Property Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | UInt8 | 1 Byte | The Unsigned UInt8 Value |
Int16Property Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | Int16 | 2 Bytes | The Signed Int16 Value |
UInt16Property Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | UInt16 | 2 Bytes | The Unsigned UInt16 Value |
Int32Property Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | Int32 | 4 Bytes | The Signed Int32 Value |
UInt32Property Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | UInt32 | 4 Bytes | The Unsigned UInt32 Value |
Int64Property Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | Int64 | 8 Bytes | The Signed Int64 Value |
UInt64Property Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | UInt64 | 8 Bytes | The Unsigned UInt64 Value |
NameProperty Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
Value | Ark Class Object | 8 Bytes | The Ark Class Name Object |
ObjectProperty Object
Name | Type | Length | Description |
---|---|---|---|
Length | Int32 | 4 Bytes | Length in bytes of the data to read |
Index | Int32 | 4 Bytes | Index of the data read (Used on some properties that repeat themselves multiple times) |
ID | Int32 | 4 Bytes | This is an ID of some sort (Unknown use) |
Value | Int32 Or Ark Class Object | 4 or 8 Bytes | If the Length is 8 then Read the Int32 value, if it's 12 read the Ark Class Object as Value |
StructProperty Object
ArrayProperty Object
PropertyText Object
StrProperty Object
Ark Class Object
When reading an Ark Class Object you need to read always 8 bytes, and when an index is defined (more than 0) you need to append that index at the name of the class, so if you have your Name Table Object and in position #72 you have PrimalItem_WeaponEmptyCryopod_C (Note: There's no position 0 on the Name Table Object) it means that if your index = 1 you need to append _0 at the end making it PrimalItem_WeaponEmptyCryopod_C_0 and if your index=135 then you need to append _134.
Name | Type | Length | Description |
---|---|---|---|
ID | Int32 | 4 Bytes | The corresponding ID on Name Table Object |
Index | Int32 | 4 Bytes | The index of this Name, the game takes the Names and represents them with a _INDEX at the end, if this number is 0 we do not append a _0 to the name, we leave the original name as is, if we find a 1 or more in this value we need to start counting from 0, which means that Index=1 is Append=_0 |
Data Types
Below are the data types and how to read them accordingly.
String
Name | Type | Length | Description |
---|---|---|---|
String Length | Int32 | 4 bytes | This tells us how many bytes to read |
String Data | String | String Length bytes | Read this data as a string, keep in mind the last character will be a 0x00 NUL character. |
Bool
Read 32Bit (4 Byte) In which the least significant bit indicates true
Double
Read 64Bit (8 Byte) Double Number
Float
Read 32Bit (4 Byte) Float Number
Int8
Read 8Bit (1 Byte) Signed Integer
UInt8
Read 8Bit (1 Byte) Unsigned Integer
Int16
Read 16Bit (2 Byte) Signed Integer
UInt16
Read 16Bit (2 Byte) Unsigned Integer
Int32
Read 32Bit (4 Byte) Signed Integer
UInt32
Read 32Bit (4 Byte) Unsigned Integer
Int64
Read 64Bit (8 Byte) Signed Integer
UInt64
Read 64Bit (8 Byte) Unsigned Integer
PropertyBoolean
Read 8Bit (1 Byte) In which the least significant bit indicates true.