![]() |
#1 |
Crystal Caves level editor
Hi all,
Some of you know I am working on a game editing tool called Camoto, and I am currently in the process of implementing the level editor. I am somewhat stuck on Crystal Caves however, as I can't figure out how the raw tile codes in the level files map across to images in the tileset. Modifying the maps directly in the .exe file and then playing the game doesn't really shed much light on the matter either, as the changes that occur tend to be a little unpredictable (mostly because the same bytes can mean different things depending on where in the map file they are.) So I'm just wondering whether anyone else has attempted this before, or knows of any existing Crystal Caves level editors? I'm only aware of one that was being worked on but never saw a release. So far I've just hard-coded a couple of values, but as you can see there are a number of tiles that are incorrect (half the 'danger' sign appears at the top of the level where the 'Mine ->' sign should be) and there are no background tiles (just the default grey colour of the editor.) The green areas are tile codes I haven't mapped by hand to images yet. ![]() If anyone has any clues let me know! |
|
![]() |
![]() |
#2 |
Re: Crystal Caves level editor
I just looked into this and I think that the value 0x6E is something like a "repeat" or "extend" tag (use last tile index +1) that is always used for bigger objects, like the volcano or the beams.
|
|
![]() |
![]() |
#3 |
Re: Crystal Caves level editor
Yes I think you're correct there. I'm also wondering whether the first row of each level has anything to do with setting the background tiles for the level, although not each level seems to have something like that.
I wonder whether Frank Maddin's still around?? |
|
![]() |
![]() |
#4 |
Re: Crystal Caves level editor
It's great to see level editors for Apogee games. Is it possible to create editors for i.e. Monster Bash and Bio Menace too?
|
|
![]() |
![]() |
#5 | ||
Re: Crystal Caves level editor
Quote:
Quote:
|
|||
![]() |
![]() |
#6 | |
Re: Crystal Caves level editor
Quote:
What I've found out by now is that the bytes 0x5B and 0x6E cannot be mapped to a tile index. 0x5B indicates a larger object with the following byte giving the type of that object. The value 0x6E is often used near a 0x5B object, giving it's full size and/or structure. Another thing to note is that in some of the levels the first row of tiles is "missing". The game seems to use the first row of the first in-game level instead, even if the color of the border tiles would not match if you compare screenshots. The game seems to add different offsets to the tile indices for each map, so that the same map data can be displayed using different tiles on different levels. I wrote a quick map viewer for CC1 and I can give you the tile mappings I used for it if you're interested. |
||
![]() |
![]() |
#7 | |
Re: Crystal Caves level editor
Thanks for the info. @Frenkel: Do you have any information about how the background tiles work in Secret Agent?
@King Duke: I'd certainly be interested in the tile mappings, but only if it's an algorithm doing the mapping. If it's just a list of values and the tiles they represent then I'll wait a bit longer in the hope that an algorithm can be discovered. Quote:
![]() |
||
![]() |
![]() |
#8 |
Re: Crystal Caves level editor
This is epic. First Duke2 editor and now CC and Monster Bash editor. You're making good job, hope they'll be finished soon.
|
|
![]() |
![]() |
#9 |
Re: Crystal Caves level editor
Yeah, all I've got is a list of byte values and tile indices. I don't think there is any algorithm behind that but I didn't even try to find one. And as you already know, most of the values can be mapped to different tile indices depending on level number and episode.
I know this is off-topic, but good luck on that Monster Bash level editor! I've looked at all the different file types and I was not able to find out how the switches and teleporters work (my guess is that stuff is hard-coded), so I abandoned the idea of creating a level editor for Monster Bash. |
|
![]() |
![]() |
#10 |
Re: Crystal Caves level editor
Hmm, well in that case maybe you could send through your tile mappings - perhaps I will be able to spot a pattern. You can send them to [email protected] or add them to the ModdingWiki page for the Crystal Caves map format.
I will be designing the editor to work with hard coded data (like the starting location in each Dangerous Dave level - perhaps eventually working around it by patching the .exe file) however I would be surprised if this was the case with Monster Bash. I have yet to decipher the file storing the actors in each level, so I am hoping teleporters and the like are kept in there! |
|
![]() |
![]() |
#11 |
Re: Crystal Caves level editor
The structure of the F.A.S.T. actor files (#7) is pretty simple. They contain multiple entries of the following structure: 22 UINT16LE values followed by a string. The first value is the size of the whole structure in bytes, so the string is size-44 bytes long. The x- and y-coordinates of the actors are stored in those values in pixel units, one stores something like an actor type and the rest of those values should be 0.
To view Monster Bash levels with the actors displayed, use this: http://k1n9duk3.k1.ohost.de/files/scubaview_10.zip |
|
![]() |
![]() |
#12 | |
Re: Crystal Caves level editor
Quote:
|
||
![]() |
![]() |
#13 |
Re: Crystal Caves level editor
Thanks for the info! Unfortunately it looks like Secret Agent and Crystal Caves have quite different map formats - Crystal Caves only has one map layer for starters, and it seems the first row is actually supposed to be displayed in most cases. Looks like some more reverse-engineering will be needed :-(
|
|
![]() |
![]() |
#14 |
Re: Crystal Caves level editor
Wow! thank you so much sir! that is a damn good idea (also, since you said that the editor was compatible with jill, you made my day!).
Just out of curiosity, would it happen to also be compatible with captain comic 2: fractured reality and vinyl goddesses from mars? |
|
![]() |
![]() |
#15 |
Re: Crystal Caves level editor
Yes, it's "compatible" with pretty much any platformer/sidescroller game, as well as some others that also have maps composed out of a grid of tiles (such as Wolf3D and ROTT.)
Of course support for each game has to be implemented separately, and there's nothing there at present for Captain Comic 2 or Vinyl, but certainly I hope there will be one day. The editor does now work with Captain Comic 1, and I vaguely recall there not being much difference between the two engines so it may well be it already works with Captain Comic 2. Vinyl's definitely on the list too, but at the moment the only part of it that has been reverse engineered is the music format - the levels and graphics are still unknown. |
|
![]() |
![]() |
#16 |
Re: Crystal Caves level editor
Wow! wolf and ROTT compatible too? that program certainly looks awesome!
I might be pushing it a little here given the nature of the game, but you did mention tile composed! Do you think it could theoretically handle a game like assault rigs from psygnosis? out of sheer curiosity? |
|
![]() |
![]() |
#17 |
Re: Crystal Caves level editor
Hmm, not sure, I've never played the game. Looking at the screenshots on MobyGames it looks like it could be tile-based, in which case the graphics and level formats must be reverse engineered before support can be added.
I should also mention that games don't have to be tile-based, it's just that the only level editor implemented so far is a tile-based one. If another type of level comes along (say a 3D one like Duke3D) it would require a new type of level editor to be added to the application (which is no small job) but there's no technical reason preventing that from happening. I have tried to design the entire application from the ground up to be capable of handling pretty much anything out there... |
|
![]() |
![]() |
#18 |
Re: Crystal Caves level editor
that would certainly be interesting! as assault rigs was a superb game yet a level editor was the only thing lacking to it! I'll keep an eye on this!
|
|
![]() |
![]() |
#19 |
Re: Crystal Caves level editor
Sorry for bringing up an old thread, but I just wanted to mention that I have finally figured out the Crystal Caves map format:
![]() It was pretty difficult, as it's quite clear the maps were originally designed by hand in the game's source code. There were lots of shortcuts taken that made it easier to design levels this way, but which make it very difficult for a graphical editor. To further complicate matters, thanks to compiler optimisation some maps share the same rows. Luckily this is usually just the first row in the map so it shouldn't interfere with level development too much. Interestingly all the block tiles (brown in the above screenshot) use relative codes (like "corner tile 1") which are independent of the tileset. This means all map files use the same tilesets, until I figure out where they are all set: ![]() This map is supposed to look like this. There's still a bit of stuff to reverse engineer. There are 3-4 different types of those wall-mounted laser guns, and that must be something to do with whether they are static, moving up and down the wall, or can be switched on and off. And I still don't know how switches work. But it's a start! I still have to actually get the GUI part of the level editor working. Kind of ironic that you can load and save levels but you can't actually move the tiles around yet ![]() |
|
![]() |
![]() |
#20 |
Re: Crystal Caves level editor
Have you tried to disassemble CC1.EXE? In the subroutine where the maps are created by processing the rows, at the top of each map there are a couple of variables that determine which background tiles, block tiles and other stuff are shown in the game.
|
|
![]() |
![]() |
#21 |
Re: Crystal Caves level editor
Yes I have just started doing that - I've found variables that set the I-beam colour (red in the above picture) and the thin platform colour (blue), but the background tiles seem a bit unpredictable. There are some which seem to stop switches from working too, so I guess that's where the switch controls go.
Unfortunately it looks like the values for each map are spread out through the code, so I'm not yet sure of the best way to make them accessible to the map editor. |
|
![]() |
![]() |
#22 |
Re: Crystal Caves level editor
I think your level editor must be able to interpret and edit the x86 instructions in that subroutine if you really want to change everything in a level, because each level is a bit different from the next level.
For example, the main level in each episode is the only level where the background changes between rows and it changes twice. Another example is in episode 2 level 2. That level has 2 rows that overlap. This way it's possible to have an enemy behind another tile. In other words, making a fully functional level editor for Crystal Caves is a nice challenge. ![]() |
|
![]() |
![]() |
#23 |
Re: Crystal Caves level editor
Ah interesting, I've only looked at episode 1 so far. Figuring out the x86 instructions shouldn't be too tricky, the difficulty is that the level editor has been designed to work on separate level files. So cc1.exe is read a bit like it's a .zip file, and the level files are then extracted from it for the editor, just like you were unzipping those files from a .zip.
So these tile attributes will probably have to be made available as additional "files" inside cc1.exe, one for each level. But then those levels where the background changes mid-level (or that level with overlapping rows) are so different I'm wondering whether it would be better to have a ckpatch style program, where all these attributes are just set by patching the .exe on load, and the level editor ignores most of the changes and just sticks with the same tileset for each level. At least Secret Agent shouldn't suffer from the same problem thanks to its external level file. |
|
![]() |
Bookmarks |
|
|