Talk:Crystal Caves
No modding tools exist for Crystal Caves, correct?
Also, it appears that the levels are located in the UNP'd executable starting at seg000:7332 (or $8C30 in the UNP'd exe). I believe tiles are stored as byte values, in pascal strings. Each row of tiles is 40 long, so there is an array of strings of length 41. Also, just looking at the ASCII representation of the hex values, you can clearly see the outline of the main level. Therefore, this should be easily patchable using a CKPATCH like utility.
(2222222222222222222222222222222222222222 ( ( Y ÛÜ ( [A ( nn (Dddddddddddddddddddddddddddddddddddddddn ( ÛÜ ( Y ( [5 ( [B ( nn (z mN z (z z (z un z (z Y Žn z (zZZZZZZZ[mZZZZZZZZZZZZZZZZZZnnnZZZZZZZz (lklklklklklklklklkKlkLKlkLKlkLKlkLKk kLk (k Õ Õ Õ [d L (l x x ±±±±± l (LÕ ±±± H ±±±±±±±±±±±±±±±±± ðn ² k (K ² ðn x ðn ú ³nx²Æk (kù ±±± [d ³n ±±±± Õ ³n ±±±±±±± L (lú ² Õ ³n ðn ³n ðn ² l (Lùù x²x ³n ³n ù ³n ú ³nx² k (k±±±±±±±±±±±±±±±±±±±±±± ³n ùùú ³n±±VK (l ðnÕ Õðn ²Õ ±±±±±±±±±±±± k (kx ³n ³n x² x ² ðn ðn l (K±±±±± ±±±±±±± ±±±±±±±±²x ³n ³n K (k ðnÕ Õðn ² ðn Õ ±±±±±±±±±±±± k (Lx ³n ³n x²x ù ³n x² K (l±±±±± V ±±±±±±±±±±±±±±±±±±±±±±±±±±±±± k (k ðn [4n ðn ðn L (Kx ³n Õ Õ ³n Õ ³n Õ L (kK ³n ³n ³n k (lKkLkKklKLklKLKkKlkLKlkLKlkLKlkLKlkLKlkl (1111111111111111111111111111111111111111
Lemm 13:31, 9 December 2009 (GMT)
Nifty. There are a handful of graphics editors for it, but nothing else. This should help with level editing muchly. -- Draik 05:33, 10 December 2009 (GMT)
- How many versions of Crystal Caves are there? In my unlzexe'd version the level data starts at 0x8CE0 instead. The levels seem to be of varying height though - the map is 36 rows high, most of the levels are 24 rows high but either e1l6 or e1l7 seems to be only 23 rows high. Maybe there's an array somewhere with all the level heights? -- Malvineous 13:25, 9 July 2010 (GMT)
- Here are my guesstimations based on the look of each level. Map is 36 tiles high, levels 7, 8 and 14 are 23 tiles high, and the rest are 24 tiles high. -- Malvineous 13:43, 9 July 2010 (GMT)
- Be aware that UNP and Unlzexe don't create the same output on the same input! Calvero 11:48, 10 July 2010 (GMT)
- Yes that's true, but I'm not sure if there's a way around that either. I believe it's the segment offsets that are different, so perhaps there's a list of these segment offsets in the .exe header that could be used? I wonder whether it's possible to take advantage of this to manually relocate or resize a segment, in order to fit more data in it? Because at the moment the levels could only be edited in-place, there's no way to adjust the level size. -- Malvineous 12:01, 10 July 2010 (GMT)
- Hehe. There appears to be a setup_level function in the executable (CC1: seg000:B1A9) that takes the level number as an argument. A large switch/case statement loads each row of tiles individually as a string, with each case representing a different level. There appears to be level -2, -1, 0, and 1 to 16 (these are the acceptable cases). The strings are loaded by calling load_map_row (row_number, string*) for EACH string, meaning that the map height is actually encoded in the .exe based on however many calls to the load_map_row function are made. Lemm 12:23, 18 June 2011 (GMT)
Map rendering
If anyone has any ideas how to figure out which tile to draw at which map location, do share. I can't see any sort of pattern between map values and an index into the tileset, and randomly changing values in the map yields some very strange results for some values! -- Malvineous 12:17, 19 May 2011 (GMT)
- I think I've found the MacDaddy function that responds to every tile value. The load_map_row function (seg000:25F0) that I mentioned above contains what appears to be a monster switch case statement for all the possible tile values, and possible other tile combinations. The function itself is 0x48F0 (18.6 kB) of mnemonics. Have fun with that one. Lemm 12:23, 18 June 2011 (GMT)
Graphics editors
They can be found over at http://spikenexus.toxicsheep.com/pccw/pages/index.php?page=downloads