Help with SkyRoads compressed level format

Discuss classic and favorite computer or console games here.
User avatar
Malvineous
Shikadi Webmaster
Posts: 382
Joined: Wed Oct 31, 2007 21:48
Location: Brisbane, Australia
Contact:

Help with SkyRoads compressed level format

Post by Malvineous »

Hi all,

I'm trying to reverse engineer the compression algorithm used by SkyRoads to compress its levels. If anyone is able to help, here are four example files, both compressed and decompressed. The decompressed versions were obtained from a DOSBox memory dump, so there are extra trailing 0x00 bytes which are not part of the input data.

The first 222 bytes of the compressed files are known and are unrelated to the compression, so the compressed data starts at offset 222 in a level file.

Each file has a "decompressed size" field stored in another file (the archive file these level files were extracted from.) These values are: road1=770, road2=1610, road6=672, road28=3276. The output data seems to stop after this many bytes plus 0x2C, so I am not certain whether the first 0x2C bytes in the decompressed file are actually part of the decompressed data. I included it because it is different for each level so it may be relevant.

To experiment further, you can download the full version (it's been released as freeware), open roads.lzs in a hex editor, go to offset 0x02CB and you will be at the start of road1.lzs. (So you will want to seek a further 222 bytes to offset 0x03A9 to get to the start of the compressed level data.) This is the first level, and the one loaded by the game if you launch it and keep bashing the Enter key until you're in a level.

If you're using the DOSBox debugger, you can grab a dump of the decompressed level by breaking into the debugger as soon as the level starts and running the command "memdumpbin ds:1600 1000". This is how I produced the files containing the decompressed level data.

If anyone is able to take a look at this and see if they can work out what the compression algorithm might be, I would really appreciate it! The file extensions suggest something like LZSS but it doesn't look like this to me, and none of the standard LZSS decompressors expand it.
User avatar
DoomJedi
Vorticon Elite
Posts: 888
Joined: Mon Dec 14, 2009 11:22
Location: Israel

Post by DoomJedi »

Aaah, loved that game in the old times.
Still have both normal and XMAS edition on my comp
User avatar
Levellass
S-Triazine
Posts: 5266
Joined: Tue Sep 23, 2008 6:40

Post by Levellass »

Oh poop, lzs. This is like that blasted Keen Dreams compression.
What you really need, not what you think you ought to want.
User avatar
Malvineous
Shikadi Webmaster
Posts: 382
Joined: Wed Oct 31, 2007 21:48
Location: Brisbane, Australia
Contact:

Post by Malvineous »

Oh just in case anyone stumbles across this in future, a kind soul on the Xentax forum was able to reverse engineer the compression algorithm so this is now known.

Not sure how to display SkyRoads levels in the Camoto tile-based map editor though...it kind of needs an isometric level editor I think.
Nickssoft
Vortininja
Posts: 98
Joined: Thu Nov 01, 2007 3:47

Post by Nickssoft »

Looks great! Cant wait to make a Skyroads mod
User avatar
KeenRush
Android Dummy
Posts: 2560
Joined: Sat Oct 27, 2007 20:57
Location: KEEN1.EXE
Contact:

Post by KeenRush »

I can't believe it! :D This is my freaking dream come true! I've been waiting for this to happen for so many years. Definitely making new levels, maybe a level editor... :drool
My newest mod - Commander Keen: Sunset: viewtopic.php?t=8568 | codename H.Y.E.N.A.
Nickssoft
Vortininja
Posts: 98
Joined: Thu Nov 01, 2007 3:47

Post by Nickssoft »

:christmas :christmas

We can make a Skyroads 2014 or Skyroads 2 woot
User avatar
troublesomekeen
Vorticon Elite
Posts: 1245
Joined: Fri Feb 03, 2012 8:01
Location: Three-Tooth Lake
Contact:

Post by troublesomekeen »

Nickssoft wrote::christmas
We can make a Skyroads 2014 or Skyroads 2 woot
SkyRoads Xmas Special is too bluudy hard. :bloody
Image
Commander Keen in... Canteloupe Quest!
Keening_Product
Kuliwho?
Posts: 2167
Joined: Fri Jan 20, 2012 7:02
Location: Tied up in the Oracle Chamber's basement
Contact:

Post by Keening_Product »

If you get an editor going is there some way I could help? I've been wanting to mod Skyroads for years now and would really, really love to do so, but I have very little experience of modding anything.
Keening_Product was defeated before the game.

"Wise words. One day I may even understand what they mean." - Levellass
User avatar
KeenRush
Android Dummy
Posts: 2560
Joined: Sat Oct 27, 2007 20:57
Location: KEEN1.EXE
Contact:

Post by KeenRush »

Unidentified flying platforms detected. :dead2
Image
On the right the modified road 1 of Skyroads (demo). The editor has all the required functionality at the moment for opening roads, editing them (adding rows, changing tiles, removing rows, etc.) and saving the new roads. More or less the only thing that needs to be done is the color editor. Can't promise when this is out -- anything can happen with my projects -- but by the end of this month might be a safe bet. :)
My newest mod - Commander Keen: Sunset: viewtopic.php?t=8568 | codename H.Y.E.N.A.
Keening_Product
Kuliwho?
Posts: 2167
Joined: Fri Jan 20, 2012 7:02
Location: Tied up in the Oracle Chamber's basement
Contact:

Post by Keening_Product »

My appreciation for you two, KeenRush and Malv, surpasses my ability to express it on this forum. Really well done!

I look forward to the first mods, not just level packs (which I can't wait to have a go at creating) coming out.
Keening_Product was defeated before the game.

"Wise words. One day I may even understand what they mean." - Levellass
User avatar
DoomJedi
Vorticon Elite
Posts: 888
Joined: Mon Dec 14, 2009 11:22
Location: Israel

Post by DoomJedi »

This is amazingly great news :)
User avatar
KeenRush
Android Dummy
Posts: 2560
Joined: Sat Oct 27, 2007 20:57
Location: KEEN1.EXE
Contact:

Post by KeenRush »

Got a new ride. :smokin In other words, just got my graphics import/export program working:
Image
If you can't spot the difference, the original vehicle is blue. :dopefish The level itself is a random test level.
My newest mod - Commander Keen: Sunset: viewtopic.php?t=8568 | codename H.Y.E.N.A.
Keening_Product
Kuliwho?
Posts: 2167
Joined: Fri Jan 20, 2012 7:02
Location: Tied up in the Oracle Chamber's basement
Contact:

Post by Keening_Product »

How difficult/possible do you think it would be to implement in-game graphics switching? Or adding extra graphics? I'm thinking choice of ship or ability to collect points to buy a new ship kinda thing.
Keening_Product was defeated before the game.

"Wise words. One day I may even understand what they mean." - Levellass
User avatar
KeenRush
Android Dummy
Posts: 2560
Joined: Sat Oct 27, 2007 20:57
Location: KEEN1.EXE
Contact:

Post by KeenRush »

That would be cool but not possible unless you know a good deal of Assembly and how this particular game works. Nothing like that will be possible with my editor, obviously, since it's just a level editor. :)
My newest mod - Commander Keen: Sunset: viewtopic.php?t=8568 | codename H.Y.E.N.A.
Post Reply