Here is the save format structure. The save format will hopefully be cross-platform to ensure using the game on different computers or trading saves, etc. At the moment some prototypes of the save format have succeeded, but the save format is still VERY experimental.
Here's an outline of the contents that will be/are stored in a save file:
Types:char*: text
int32_t: numeric range -2,147,483,648 to 2,147,483,648
uint8_t: numeric range 0 to 255
uint16_t: numeric range 0 to 65,535
uint32_t: numeric range 0 to 4,294,967,295
uint64_t: numeric range 0 to 18,446,744,073,709,551,615
Element | Type | Size | Constant value (if any) | Comment |
Header | raw text | std::string.length() | CTPRPHT | File format validation |
Format version | uint64_t | sizeof(uint64_t) | | (year/month/day/hour/minute) |
Map ID | uint16_t | sizeof(uint16_t) |
Map Phase ID | uint8_t | sizeof(uint8_t) |
Current Map Position X | int32_t | sizeof(int32_t) |
Current Map Position Y | int32_t | sizeof(int32_t) |
Gold Amount | uint32_t | sizeof(uint32_t) |
Inventory Item Count | uint8_t | sizeof(uint8_t) |
Item ID | uint16_t | sizeof(uint16_t) | | for every item entry |
Item Stack | uint8_t | sizeof(uint8_t) | | for every item entry |
Character Count | uint8_t | sizeof(uint8_t) |
Character ID | uint8_t | sizeof(uint8_t) | | for every character entry |
Character Name Length | uint8_t | sizeof(uint8_t) | | for every character entry |
Character Name | char* | Character Name Length | | for every character entry |
Character Experience | uint32_t | sizeof(uint32_t) | | for every character entry |
Character Status Flags | uint16_t | sizeof(uint16_t) | | for every character entry |