Treasure Mountain Save File

From ModdingWiki
Jump to navigation Jump to search
Treasure Mountain Save File
Format typeSaved game
Save locationsReturned to level start
Elements savedPlayer and saved game level data
Games

The DAT Format is used to store player data and currently saved level if there is any.

This file is 3,242 bytes in total. It functions as a repository for player-specific data, encompassing individual player profiles and their respective saved game level.

File format

Each player is saved in 360 bytes sections, with a maximum of 9 players. 360 x 8 = 3240 and the remaining 2 bytes are just the end of the file 0x0000

The file begins with the following structure:

Decimal Hex Data Type Description
0 0x00 BYTE Start of file
1 0x01 UINT16LE ! Unknown
3 0x03 ASCIIZ Player Name(9-char null-padded fixed length strings)
12 0x0C BYTE Saved game(Boolean)
13 0x0D UINT16LE Player Score
105 0x69 UINT16LE[9] 9 Quizzes for the elves
123 0x7B BYTE[9] Elf answers state
132 0x82 BYTE|[9] Words for the current game
141 0x89 BYTE[48] Treasures collected
190 0xBE BYTE[10] Level Chunks level 3
203 0xCB BYTE[15] Level Chunks level 2
219 0xDB BYTE[19] Level Chunks level 1
238 0xEE BYTE Secret Cave Chunk (0x4B coins, 0x49 no coins)
239 0xEF BYTE Level 3 Exit Chunk (0x26 Closed, 0x3C Open)
240 0xF0 BYTE Level 3 Bridge Chunk (0x2F Stable , 0x30 Broken)
241 0xF1 BYTE Level 3 Exit Chunk (0x26 Closed, x03C Open)
242 0xF2 BYTE Level 2 Exit Chunk (0x38 closed, 0x35 Open)
243 0xF3 BYTE Level 2 Bridge Chunk (0x2F Stable , 0x30 Broken)
244 0xF4 BYTE Level 2 Net Rock Chunk
245 0xF5 BYTE Level 1 Net Rock Chunk
246 0xF6 BYTE Level 1 Exit Chunk (0x40 closed, 0x4C Open)
247 0xF7 BYTE[11] Level 3 Treasures in each chunk
260 0x104 BYTE[13] Level 2 Treasures in each chunk
276 0x114 BYTE[20] Level 1 Treasures in each chunk
307 0x133 BYTE[3] Amount of treasure collected each level
310 0x136 BYTE[6] Treasure duplication
323 0x143 BYTE Game Difficulty
225 0x145 BYTE Current Tileset
327 0x147 UINT16LE Player Coin count in current saved game
329 0x149 UINT16LE Player Net count in current saved game
335 0x14D BYTE Current level key state (Collected or not)
337 0x14F BYTE Net Spawned
338 0x151 UINT16LE[8] Player and Camera Saved Position
347 0x15B BYTE Amount of coins left required to open net rock
348 0x15C UINT16LE Net count amount for player for new game
350 0x15E UINT16LE Coin count amount for player for new game
353 0x161 BYTE Music on or off (Boolean)
355 0x163 BYTE Sound on or off (Boolean)
359 0x167 BYTE Currently selected treasure in clubhouse

File Information

Player Name

Player name is a string with null terminator at the end, this string can only be maximum 8 characters so 9 BYTES in total if including null terminator

Player Score

Player score has a rank system based on it's value

Score Range Rank
0 - 4 Trainee
5 - 24 One Star
25 - 69 Two Star
70 - 114 Three Star
115 - 169 Four Star
170 - 229 Five Star
230 - 299 Six Star
>= 300 Champion

Elf

Quiz

Elf quizzes are indexed based from 0 to the last quiz there is. The quiz is made up of 2 bytes, the first byte is the index of quiz from the Treasure Mountain Puzzles file. The next byte is if the quiz has been solved or note, 0x00 if it has not been solved otherwise 0x80 if it has been solved.

Position/Status

This is the status of the quiz at it's current answered state, now the position of both the quizzes and the elf change in the save file. ! Unsure exactly what controls which position they take or how it tracks it There are different codes 0x07 to 0x00, 0x07 means nothing has been chosen and 0x00 means all choices have been made. ! The other codes in between unsure exactly what they are for, 1 answered, 2 answered maybe which answer top/bottom etc?

Level Code Words

There are 9 code words and they are stored and indexed from the SST.EXE file, it starts at position 100416/0x18840 and increments by one separated by a null terminator until position 100734/0x1897E. It is saved in it's index value + 123 and when the word is found you minus 123 again to save that the word has been found.

Treasure Collection

This is the treasure collected in game there are 48 treasures to collect in total, it is arrayed based where by default all slots start with no treasure 0x80. The first treasure starts at 0x06 and is incremented by 2 until each treasure until the final of 0x64.

Hex Treasure
0x06 Handkerchief
0x08 Sail Boat
0x0A Ice-cream
0x0C Map
0x0E Watering Can
0x10 Xylophone
0x12 Flute
0x14 Telescope
0x16 Fruit Bottle
0x18 Pie
0x1A Clam
0x1C Honey Vase
Hex Treasure
0x1E Balloon
0x20 Vase
0x22 Teddy Bear
0x24 Candy Cane
0x26 Award First Place
0x28 Four Leaf Clover
0x2A Mirror
0x2C Flower Pot
0x2E Cake
0x30 Ice Skates
0x32 Drum
0x34 Shoes
Hex Treasure
0x36 Windmill
0x38 Jack-In-The-Box
0x3A Lantern
0x3C High Heels
0x3E Necklace
0x40 Skate Board
0x42 Candle
0x44 Top Thing
0x46 Lamp
0x48 Fish Bowl
0x4A Train
0x4C Carriage
Hex Treasure
0x4E Cabuse
0x50 Rocket
0x52 Dog
0x54 Cat
0x56 Ring
0x58 Pig
0x5A GenieLamp
0x5C Pong Board
0x5E Plane
0x60 Funky Glasses
0x62 Twirly Hat
0x64 Swan

Level Chunks

The main game level in Treasure Mountain is just one big room made up of chunks it is 18 by 18 chunks, every chunk is 128x128 pixels.

Treasure Collected Amount

This is one byte for each level saying how many treasures you have collected, this is just for the sprite at the bottom right of the screen.

Hexadecimal Number
0x00 None
0x01 One
0x03 Two
0x07 Three
0x0F Four
0x1F All Treasures

Net Spawner

The chunk when closed is 0x47 and 0x46 when opened, this is when the coins left which is also stored in a byte reaches 0. Then the actual item is spawned the net spawned byte when saving is 0x00 otherwise by default it's 0x04 for nothing. Now there are sprites for numbers 1-6 so if you change the value to 6 it will show it but the game always resets it to 4. Also if you keep putting up the value it will just go through the sprite sheet and start showing all the other images in it.

Treasure Duplication

This uses bitwise operator to check which items are duplicated in your treasure collected array, the binary value of 10001101 means the first, third, fourth and eighth treasures are duplicated. Increments for each byte by 8 until you get 48 bits in total from right to left each byte for each treasure room.

Player and Camera Position

As mentioned before the game level is just one big room so there is the player and camera positions saved in the file. It goes like this player x, player y, camera x and camera y. How to read the data is it comes in 2 bytes, lets start with the second byte. This byte is the level chunk x 2, now this works with the first byte which is the distance right of the chunk specified. So 0x8003 would be 128 pixels right of the 6th chunk.

Current Treasure

By default it starts as 0xFFFF since there are no treasures collected when you make a new player, but when you collect one it will change to the treasure value. It replaces the treasure in your treasure collected array with 0x80 when saving, you can then work out the index when loading the game from that as the first 0x80 will be the current treasure index.

Credits

This file format was reverse engineered by Trogdor. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)