Thurler

Touhou Labyrinth Tri Save File Format

Apr 10th, 2025 (edited)
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.38 KB | None | 0 0
  1. ===== OVERALL / MISC INFO =====
  2.  
  3. 1F starting position is (76, 74)
  4. All files are BIG endian!
  5. DxEncrypt encryption key is "HyperGigaAnalSmasher", in classical 3peso fashion. It seems to use a recent version of DxLib that actually makes it impossible to deduce the key based on the data - I extracted this using Ghidra
  6.  
  7. ===== OD FILES =====
  8.  
  9. XXYY_OD.txt
  10. XX - Stratum / Dungeon
  11. YY - Floor
  12. Both start at 01
  13.  
  14. Map is a 150x150 grid, each tile is 1 byte:
  15. 00 - not visible
  16. 01 - visible
  17. 02 - stepped on
  18.  
  19. ===== C FILES =====
  20.  
  21. C0XX.ngd
  22. XX - Character index, starts at 01
  23.  
  24. 01 - Reimu
  25. 02 - Renko
  26. 03 - Mary
  27. 04 - Meiling
  28. 05 - Alice
  29. 06 - Nitori
  30. 07 - Aya
  31. 08 - Patchy
  32. 09 - Cirno
  33. 10 - Keine
  34. 11 - Doremy
  35. 12 - Yukari
  36. 13 - Marisa
  37. 14 - Koishi
  38. 15 - Sumireko
  39. 16 - Ran
  40. 17 - Chen
  41. 18 - Sanae
  42. 19 - Kanako
  43. 20 - Suwako
  44. 21 - Remilia
  45. 22 - Sakuya
  46. 23 - Junko
  47. 24 - Hecatia
  48. 25 to 35 - (scrubbed from demo)
  49. 36 - Byakuren (has no skills in demo)
  50. 37 to 47 - (scrubbed from demo)
  51. 48 - Miko (has no skills in demo)
  52.  
  53. Character level overflows into the negatives past 2^31 - 1
  54. EXP to next level caps at 900 billion
  55. EXP held overflows into the negatives past 2^63 - 1
  56.  
  57. Library cost caps at 1 trillion - 1
  58. Library level overflows into the negatives past 2^31 - 1
  59.  
  60. Level bonus percents don't actually have to add up to 100%, you can go over. However, loading the save and reducing any of the values makes it impossible to raise them back up until you make them add up to 100% again.
  61. Level bonus percents overflow into the negatives past 2^31 - 1
  62.  
  63. Skills are arranged into a 12x8 grid, with a character's spells and skills ocupying some slots in that grid. Unused slots are left empty in the save, and skills/spells learned will have a value of 1. If a slot is empty, its value is discarded.
  64.  
  65. 0x0 ~ 0x3 - Current level (4 bytes)
  66. 0x4 ~ 0x7 - Max level achieved (4 bytes)
  67. 0x8 ~ 0xf - EXP held (8 bytes)
  68. 0x10 ~ 0x13 - Library HP level (4 bytes)
  69. 0x14 ~ 0x17 - Library ATK level (4 bytes)
  70. 0x18 ~ 0x1b - Library DEF level (4 bytes)
  71. 0x1c ~ 0x1f - Library MAG level (4 bytes)
  72. 0x20 ~ 0x23 - Library MND level (4 bytes)
  73. 0x24 ~ 0x27 - Library SPD level (4 bytes)
  74. 0x28 ~ 0x47 - unused, placeholder for library element level (32 bytes)
  75. 0x48 ~ 0x4b - Level bonus HP percentage (4 bytes)
  76. 0x4c ~ 0x4f - Level bonus ATK percentage (4 bytes)
  77. 0x50 ~ 0x53 - Level bonus DEF percentage (4 bytes)
  78. 0x54 ~ 0x57 - Level bonus MAG percentage (4 bytes)
  79. 0x58 ~ 0x5b - Level bonus MND percentage (4 bytes)
  80. 0x5c ~ 0x5f - Level bonus SPD percentage (4 bytes)
  81. 0x60 ~ 0x63 - Number of HP Boosts used (4 bytes)
  82. 0x64 ~ 0x63 - Number of MP Boosts used (4 bytes)
  83. 0x68 ~ 0x63 - Number of TP Boosts used (4 bytes)
  84. 0x6c ~ 0x6f - Number of ATK Boosts used (4 bytes)
  85. 0x70 ~ 0x73 - Number of DEF Boosts used (4 bytes)
  86. 0x74 ~ 0x77 - Number of MAG Boosts used (4 bytes)
  87. 0x78 ~ 0x7b - Number of MND Boosts used (4 bytes)
  88. 0x7c ~ 0x7f - Number of SPD Boosts used (4 bytes)
  89. 0x80 ~ 0x83 - Number of ACC Boosts used (4 bytes)
  90. 0x84 ~ 0x87 - Number of EVA Boosts used (4 bytes)
  91. 0x88 ~ 0x8b - Number of Guidance Books used (4 bytes)
  92. 0x8c ~ 0xbb - unused, likely placeholder for 12 common skills? (48 bytes)
  93. 0xbc ~ 0x23b - Skills learned (4 bytes per skill, 96 skills) (384 bytes)
  94. 0x23c ~ 0x47b - unused, placeholder for 12 more skill rows (576 bytes)
  95. 0x47c ~ 0x86b - unused, reads data for 21 skill rows again? (1008 bytes)
  96. 0x86c ~ 0x86f - Unused skill points (4 bytes)
  97. 0x870 ~ 0x873 - unknown, seems to always be 3? (4 bytes)
  98. 0x874 ~ 0x877 - Battle points (4 bytes)
  99. 0x878 ~ 0x87b - Main Equipment level (4 bytes)
  100. 0x87c ~ 0x87f - Subequip slot 1, uses same number as shown in game (4 bytes)
  101. 0x880 ~ 0x883 - Subequip slot 2, uses same number as shown in game (4 bytes)
  102. 0x884 ~ 0x887 - Subequip slot 3, uses same number as shown in game (4 bytes)
  103. 0x888 ~ 0x893 - unused, placeholder for 3 more equip slots? (12 bytes)
  104. 0x894 ~ 0x8bb - unused, placeholder for 10 slots of things? (40 bytes) [likely 5 slots for awakening items, and 5 extra]
  105. 0x8bc ~ 0xbdc - unused
  106.  
  107. ===== EEF FILE =====
  108.  
  109. Inventory unlock flags
  110.  
  111. 00 - Locked
  112. 01 - Unlocked
  113.  
  114. 1 byte per item, 1201 item slots total
  115. Offsets likely correspond to item IDs:
  116. - Subequips from 1 to 140
  117. - Materials from 501 to 580
  118. - Break items from 701 to 780
  119. - Special items from 801 to 860
  120. - Awakening items from 1001 to 1120
  121.  
  122. 0x0 - unused
  123. 0x1 ~ 0x8c - subequips
  124. 0x1f5 ~ 0x244 - materials
  125. 0x2bd ~ 0x30c - break items
  126. 0x321 ~ 0x35c - special items
  127. 0x3e9 ~ 0x460 - awakening items
  128.  
  129. ===== EEH FILE =====
  130.  
  131. Subequip upgrade levels
  132.  
  133. 4 bytes per item, game caps at +10 but scales "fine" past it if you edit a higher value
  134. 141 item slots total
  135.  
  136. 0x0 ~ 0x3 - unused
  137. 0x4 ~ 0x233 - subequips
  138. 0x234 ~ 0x7d3 - unused
  139.  
  140. ===== EEN FILE =====
  141.  
  142. Inventory amounts
  143.  
  144. 4 bytes per item, same deal with the offsets from EEF, 1201 item slots
  145. There doesn't seem to be a soft cap to the number of copies you can hold of an item
  146.  
  147. 0x0 ~ 0x3 - unused
  148. 0x4 ~ 0x233 - subequips
  149. 0x7d4 ~ 0x913 - materials
  150. 0xaf4 ~ 0xc33 - break items
  151. 0xc84 ~ 0xd73 - special items
  152. 0xfa4 ~ 0x1183 - awakening items
  153.  
  154. ===== EVF FILE =====
  155.  
  156. Event flags (1 usually means available, 2 means seen/opened/activated/etc)
  157.  
  158. GLHF to whoever wants to figure all of these out
  159. 4 bytes per flag, for some reason (That's 20k + 10k flags for a 120kb file)
  160.  
  161. ===== PGD FILE =====
  162.  
  163. Misc game data
  164.  
  165. Each value seems to be 4 bytes long, but there are exceptions (as noted)
  166. Money held caps at 100 quadrillion - 1
  167.  
  168. 0x0 ~ 0x3 - unused
  169. 0x4 ~ 0xc3 - character unlock flags, see C files for character order (4 bytes per character)
  170. 0xc4 ~ 0x18f - unused, placeholder for total of 100 character unlocks (204 bytes)
  171. 0x190 ~ 0x1bf - characters in party (4 bytes per character)
  172. 0x1c0 ~ 0x1c7 - play time, in seconds (8 bytes)
  173. 0x1c8 ~ 0x1cf - total exp acquired (8 bytes)
  174. 0x1d0 ~ 0x1d7 - total money acquired (8 bytes)
  175. 0x1d8 ~ 0x1df - money held (8 bytes)
  176. 0x1e0 ~ 0x1e3 - battle count (4 bytes)
  177. 0x1e4 ~ 0x1e7 - number of steps in dungeon (4 bytes)
  178. 0x1e8 ~ 0x1eb - number of party wipes (4 bytes)
  179. 0x1ec ~ 0x1ef - number of nitori crafts (4 bytes)
  180. 0x1f0 ~ 0x1f3 - ??? (4 bytes)
  181. 0x1f4 ~ 0x1fb - money acquired from selling items (8 bytes)
  182. 0x1fc ~ 0x1ff - number of treasures opened (4 bytes)
  183. 0x200 ~ 0x203 - number of locked treasures found (4 bytes)
  184. 0x204 ~ 0x843 - ??? 400 slots of something (4 bytes each, 1600 total)
  185. 0x844 ~ 0x8e3 - regular enemy bestiary rewards (4 bytes each, 40 slots, 160 total) (0 = unclaimed, 1 = claimed)
  186. 0x8e4 ~ 0x983 - large enemy bestiary rewards (4 bytes each, 160 total) (0 = unclaimed, 1 = claimed)
  187. 0x984 ~ 0xa23 - rare enemy bestiary rewards (4 bytes each, 160 total) (0 = unclaimed, 1 = claimed)
  188. 0xa24 ~ 0xac3 - achievement rewards (4 bytes each, 40 slots, 160 total) (0 = unclaimed, 1 = claimed)
  189. 0xac4 ~ 0x1103 - 400 slots for map completion rewards (4 bytes each, 1600 total) [still working out the details]
  190. 0xaef - 1f half
  191. 0xaf3 - 1f full
  192. 0xaf7 - 2f half
  193. 0xafb - 2f full
  194. 0x1104 ~ 0x1107 - ??? (4 bytes)
  195. 0x1108 ~ 0x110b - ??? (4 bytes)
  196. 0x110c ~ 0x110f - ??? (4 bytes)
  197. 0x1110 ~ 0x1113 - unused (4 bytes)
  198. 0x1114 ~ 0x1433 - achievement data (4 bytes per achievement, 200 slots) (800 bytes) (0 = locked, 2 = acquired)
  199. 0x1434 ~ 0x15c3 - treasure id list on lounge (4 bytes per id, 100 slots) (400 bytes)
  200. 0x15c4 ~ 0x16b3 - ??? 12x5 matrix slots of something (4 bytes each, 240 total)
  201. 0x16b4 ~ 0x4d63 - ??? 100x7x5 matrix slots of something (4 bytes each, 14000 total)
  202. 0x4d64 ~ 0x4d87 - alice subequip craft slots [id, timer, ???] (4 bytes each, 3 slots, 36 total)
  203. 0x4d88 ~ 0x4e27 - cirno shop slots [item id, price factor] (4 bytes each, 20 slots, 160 total)
  204. 0x4e28 ~ 0x4e77 - equipped break items (4 bytes per item, 20 slots, 80 total) (uses some weird id?)
  205. 0x4e78 ~ 0x4f17 - ??? 40 slots of something (4 bytes each, 160 total)
  206. 0x4f18 ~ 0x5237 - ??? 200 slots of something (4 bytes each, 800 total)
  207. 0x5238 ~ 0x525f - ??? 10 slots of something (4 bytes each, 40 total)
  208. 0x5260 ~ 0x5263 - number of break item crafts (4 bytes)
  209. 0x5264 ~ 0x5267 - ??? (4 bytes) [It's used for something in the demo, I just didn't isolate what... Yet]
  210. 0x5268 ~ 0x526b - unused (4 bytes)
  211. 0x526c ~ 0x526f - number of cirno purchases (4 bytes)
  212. 0x5270 ~ 0x527f - break items auto use flags (4 bytes per item, ?? slots, ?? total) (0 = not auto, 1 = auto)
  213. 0x5280 ~ 0x7537 - unused
  214.  
  215. ===== PKO FILE =====
  216.  
  217. Bestiary data
  218.  
  219. 4 bytes per monster, 10000 enemy slots, stores death count - possibly aligns with enemy ID:
  220. - 101 is Weakling Kedama
  221. - 102 is Seed of Forgetfulness
  222. - 103 is Giant Walnut-Cracking Squirrel
  223. - 104 is Forest Flower Fairy
  224. - 105 is Fairytale Flower Girl
  225. - 106 is Sea of Trees Kedama
  226. - 107 is Nightmare Chrysalis
  227. - 108 is Juvenile Great Tree
  228. - 109 is Fairytale Man-Eating Wolf
  229. - 110 is Emerald Elemental
  230. - 111 is Bomb Fruit
  231. - 112 is Nightmare Disciple
  232. - 113 is Gluttonous Memorytrap
  233. - 201 is Magic Circle Kedama
  234. - 202 is Glaring Magic Doll
  235. - 203 is Mind Sphere
  236. - 204 is Amethyst Elemental
  237. - 205 is Shadowcat
  238. - 206 is Nightmare Foot Soldier
  239. - 301 is ?????
  240. - 302 is ????????
  241. - 5011 is Golden Seed
  242. - 5012 is Giant Gold-Cracking Squirrel
  243. - 5013 is Storybook Assassin Girl
  244. - 5014 is Guardian Great Tree
  245. - 5021 is Hexagonal Mind
  246. - 6011 is Forest Team
  247. - 6012 is Forest Band
  248. - 6013 is Forest Squad
  249. - 6021 is Dream Path Team
  250. - 6022 is Dream Path Band
  251. - 7001 is Cirno
  252. - 7003 is Nightmare Avatar
  253. - 7005 is Nightmare Shikigami Master
  254. - 7006 is Exploding Katashiro
  255. - 7008 is Ran
  256. - 7009 is Black Nightmare Shikigami
  257. - 7015 is Protector of Sumireko
  258.  
  259. 0x194 ~ 0x1c7 - Oblivion Forest regular enemies
  260. 0x324 ~ 0x33b - Dream Path regular enemies
  261. 0x4b4 ~ 0x4bb - Unused regular enemies
  262. 0x4e4c ~ 0x4e5b - Oblivion Forest rare enemies
  263. 0x4e74 ~ 0x4e77 - Dream Path rare enemies
  264. 0x5dec ~ 0x5df7 - Oblivion Forest large enemies
  265. 0x5e14 ~ 0x5e1b - Dream Path large enemies
  266. 0x6d64 ~ 0x6d9f - Boss enemies
  267.  
  268. ===== SHD FILE =====
  269.  
  270. Summary data for the save screen
  271.  
  272. Changing these doesn't actually change anything in the save, just the displayed data on the save select screens
  273.  
  274. 0x0 - always 0x01 to indicate save is used
  275. 0x1 ~ 0x8 - play time, in seconds (8 bytes)
  276. 0x9 ~ 0xc - average party level (4 bytes)
  277. 0xd ~ 0x10 - number of allies (4 bytes)
  278. 0x11 ~ 0x14 - unused? (4 bytes)
  279. 0x15 ~ 0x18 - money held (4 bytes)
  280. 0x19 ~ 0x1c - battle count (4 bytes)
  281. 0x1d ~ 0x20 - achievement count (4 bytes)
  282. 0x21 ~ 0x50 - characters in party (4 bytes per character id, see C files for character order)
  283.  
  284. Rest of file seems unused?
Add Comment
Please, Sign In to add comment