Help with exporting maps from Crystal Caves 3

Discuss game modding
Post Reply
pidgezero
Less than a nibble
Posts: 1
Joined: February 13th, 2018, 7:19 pm

Help with exporting maps from Crystal Caves 3

Post by pidgezero »

Hi all,

I am a speedrunner of the Crystal Caves series and am working on some tutorial resources. A speedrun of CC3 has never been done before to my knowledge.

I'm attempting to use Camoto to export the maps from CC3, however I understand that the maps in CC3 are stored at a different address than the ones in CC1 and CC2. Attempting to view the CC3 levels in Camoto (with the EXE decompressed by UNLZEXE) shows something that at least looks logical, but with incorrect co-ordinates, so to speak. For example, opening Level 1 shows part of level 1 and part of the overworld, as seen here: https://imgur.com/a/80fUQ

If I'm not mistaken, Crystal Caves 1 modding tools are hard-coded into Camoto. I am a developer myself, but don't have a lot of experience with C projects. Would it be feasible for me to modify the source code of Camoto to target offset 0x8F24 and compile to get it to show the levels properly? If so, where in the code would I have to do that? I'm not sure if this is the right approach yet from browsing through the source code.
Malvineous
8-bit mega nerd
Posts: 292
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: Help with exporting maps from Crystal Caves 3

Post by Malvineous »

Crystal Caves is unfortunately a bit complicated, but the short answer is yes, you'll need to copy and paste the episode 1 stuff and modify it for episodes 2 and 3.

In libgamearchive, there are files src/fmt-exe-ccaves.cpp (and .hpp) which you could modify to make work with episode 3, or if you'd like to contribute your code back, I'd suggest copying and pasting them to make fmt-exe-ccaves2.cpp/.hpp and ...ccaves3.cpp/.hpp which I would be happy to commit back into the libgamearchive codebase. This is where all the offsets to the map data are hard-coded, because we don't yet know whether there's a way to extract the offsets from somewhere else. The concept here is that the Crystal Caves .exe file is treated a bit like a .zip file, and you can extract a file for each game level as if you're extracting them from a .zip file.

Once you've done this you'll need to edit the data/games/crystal-caves.xml file in Camoto Studio to add entries for the new episodes, corresponding to the new files that you added to libgamearchive in the previous step. There's no need to recompile anything here, assuming you can get Camoto Studio to pick up the updated libgamearchive library (.dll on Windows, .so on Linux).

If exporting maps is your goal, you might also want to take a look at the 'gamemap' command-line utility (part of libgamemaps.) It can export full map files to .png images, although you won't get some of the attributes that the Studio draws (those purple arrows) which may or may not be a problem.

I hope this gives you something to go on!
User avatar
K1n9_Duk3
4-bit nibble
Posts: 31
Joined: March 26th, 2013, 8:12 am
Contact:

Re: Help with exporting maps from Crystal Caves 3

Post by K1n9_Duk3 »

pidgezero wrote: February 13th, 2018, 8:05 pmI'm attempting to use Camoto to export the maps from CC3
If viewing the levels is all you want to do, then you could just use "maps" made of a bunch of screenshots. I happen to have a complete set for all three episodes:
cc_maps.zip
Disclaimer:
I didn't create these images. All I did was converting the images from GIF to PNG format. I honestly can't remember where I got these from, otherwise I would have posted a link instead of attaching the zip archive.
You do not have the required permissions to view the files attached to this post.
Frenkel
5-bit member
Posts: 41
Joined: March 3rd, 2007, 10:50 am

Re: Help with exporting maps from Crystal Caves 3

Post by Frenkel »

User avatar
K1n9_Duk3
4-bit nibble
Posts: 31
Joined: March 26th, 2013, 8:12 am
Contact:

Re: Help with exporting maps from Crystal Caves 3

Post by K1n9_Duk3 »

Frenkel wrote: March 6th, 2018, 4:18 pm Crystal Caves @ VGMaps.com
These don't seem to be the same images that I posted, and there's absolutely nothing for Episode 3 of Crystal Caves on that site, so I'm not sure why you would bring that up in this thread. Apart from the fact that the site hosts a ton of maps for various games, that is.

Also, just in case anyone wants a way to display the actual level data, I have a tool for that on my website. Due to the nature of the game's code, the level data isn't always a 1:1 match to what you see while playing the game, but viewing the level data shows you a few things that all the maps I've seen so far simply don't provide. For example, you can see the invisible markers the prevent the green "tadpole" enemies from leaving certain areas of the level. And you actually get to see the starting location for all of the monsters.
Frenkel
5-bit member
Posts: 41
Joined: March 3rd, 2007, 10:50 am

Re: Help with exporting maps from Crystal Caves 3

Post by Frenkel »

K1n9_Duk3 wrote: March 6th, 2018, 6:46 pm
Frenkel wrote: March 6th, 2018, 4:18 pm Crystal Caves @ VGMaps.com
These don't seem to be the same images that I posted, and there's absolutely nothing for Episode 3 of Crystal Caves on that site, so I'm not sure why you would bring that up in this thread. Apart from the fact that the site hosts a ton of maps for various games, that is.
I didn't even notice it doesn't have Episode 3 maps :oops:
I bring it up just for convenience: you don't have to download a zip file if you only want to view one particular map.

I once made a list of Apogee games and their maps and it contains a link to The Perilous Crystal Caves Web Site.
User avatar
K1n9_Duk3
4-bit nibble
Posts: 31
Joined: March 26th, 2013, 8:12 am
Contact:

Re: Help with exporting maps from Crystal Caves 3

Post by K1n9_Duk3 »

Well, the Perilous Crystal Caves Web Site seems to be the origin of the maps that I posted earlier (the same ZIP archives that I have on my harddisk can be found near the bottom of the Downloads page). Mystery solved.
Post Reply