dead_name Posted September 5, 2011 Share Posted September 5, 2011 They're not standard bitmaps. Stop trying to tweak them into being parseable, because it won't work. I've figured most of it out. // all multi-byte types, unless stated otherwise, are little-endian. struct lr1_bmp { byte bit_depth; // the bit-depth of the [paletted] image. 0x04, 0x08, or 0x98 // where bit_depth is 0x98, IDK what the format is. byte palette_length; // length of the palette -1. i.e. For a palette with 37 entries, this would be 36. u16 width; // Width of the image in pixels. u16 height; // Height of the image in pixels. color[palette_length+1] palette; // zero-indexed color palette block[] blocks; // image data blocks. keep reading these from the file until you hit the end-of-file. } struct color { byte B; byte G; byte R; } struct block { u16 raw_length; // length of the decompressed block data. seems to have a maximum of 1000. u16 length; // length of the compressed block data byte[length] data; // block data. If length != raw_length, the data is compressed, and we have yet to figure out the algorithm used. If length == raw_length, the data is not compressed. } if you add together the raw_length of every block, you get the same value as width * height (or half if the image is 4bits per pixel), so we know all this is probably correct. Decompress each block in turn and append the raw data into a buffer. That buffer now contains the bitmap data. All we have to do now is to figure out the decompression algorithm. Quisoves Potoo 1 Link to comment Share on other sites More sharing options...
McJobless Posted September 5, 2011 Share Posted September 5, 2011 It's good we have someone on the case. Nice work, and looking forward to hopefully seeing the final bits of the puzzle figured out. Link to comment Share on other sites More sharing options...
dead_name Posted September 5, 2011 Author Share Posted September 5, 2011 updated documentation. we're all done apart from finding the compression/decompression algorithm. Link to comment Share on other sites More sharing options...
Cyrem Posted September 5, 2011 Share Posted September 5, 2011 Excellent work there origami! Link to comment Share on other sites More sharing options...
dead_name Posted September 5, 2011 Author Share Posted September 5, 2011 And in the rare case that none of the blocks are compressed, we can get some rips http://dl.dropbox.com/u/3770169/screens/2011_09_05_14_28_05.png http://dl.dropbox.com/u/3770169/screens/2011_09_05_19_04_01.png Link to comment Share on other sites More sharing options...
dead_name Posted September 5, 2011 Author Share Posted September 5, 2011 Okay, so. last 2 bytes of each (compressed) block are constant 0, and the preceding 2 bytes seem to be a checksum of some sort. Link to comment Share on other sites More sharing options...
Oboe Shoes Posted September 5, 2011 Share Posted September 5, 2011 Nice! I can confirm the structure is correct, my Dad and I got that far when we took a crack at these, but we never noticed the few files with no compressed blocks. We were also able to get them to open by adding the correct header, but the image comes out garbled because (of course) we don't know the compression. However, the two images you posted with no compressed blocks got me thinking. There's no pure white or black in either of them (infact both images only have shades of one color) The compression algorythm may have something to with do with either pure black or white. Seeing as the game seems to treat pure black as transparent, a simple compression algorythm would be to compresss all the black pixels out of the image. Of course, it could be something completely different and entirely more complex, but it's worth looking in to. Link to comment Share on other sites More sharing options...
dead_name Posted September 5, 2011 Author Share Posted September 5, 2011 Nice! I can confirm the structure is correct, my Dad and I got that far when we took a crack at these, but we never noticed the few files with no compressed blocks. We <i>were </i>also able to get them to open by adding the correct header, but the image comes out garbled because (of course) we don't know the compression. However, the two images you posted with no compressed blocks got me thinking. There's no pure white or black in either of them (infact both images only have shades of one color) The compression algorythm may have something to with do with either pure black or white. Seeing as the game seems to treat pure black as transparent, a simple compression algorythm would be to compresss all the black pixels out of the image. Of course, it could be something completely different and entirely more complex, but it's worth looking in to. Interesting theory on the compression. Personally I'm thinking it's just some sort of run-length encoding, so that a long strip of identical pixels gets compressed down into storing the palette entry index and the length. Something like that. Unrelated: here's what happens if I tell it to render the Dark Forest Dash map, showing only the uncompressed blocks. I then overlay the actual map at 10% opacity. Perfect match http://dl.dropbox.com/u/3770169/screens/2011/09/2011_09_06_00_15_03.png Link to comment Share on other sites More sharing options...
dead_name Posted September 7, 2011 Author Share Posted September 7, 2011 http://will.loadingchunks.net/uploads/misc/lr_modded_backdrp.png hacked together an uncompressed image, inserted it into the game. boom. Link to comment Share on other sites More sharing options...
McJobless Posted September 7, 2011 Share Posted September 7, 2011 Almost there, presumably. This is awesome. Link to comment Share on other sites More sharing options...
lol username Posted September 7, 2011 Share Posted September 7, 2011 Oh heck YES! :D Link to comment Share on other sites More sharing options...
Cyrem Posted October 9, 2011 Share Posted October 9, 2011 How has the progress on the BMP's been going? Link to comment Share on other sites More sharing options...
McJobless Posted October 9, 2011 Share Posted October 9, 2011 How has the progress on the BMP's been going? http://will.loadingchunks.net/rru/lr1/bmp/ He sent me this link a little bit back. Figured it out, I believe. Link to comment Share on other sites More sharing options...
dead_name Posted October 9, 2011 Author Share Posted October 9, 2011 Figured it out, I believe. Not quite. Lot of work to do on a) the compression and b) the 0x98 variant. Link to comment Share on other sites More sharing options...
McJobless Posted October 9, 2011 Share Posted October 9, 2011 Figured it out, I believe. Not quite. Lot of work to do on a) the compression and b) the 0x98 variant. Ah, that stuff...well, good work so far. Link to comment Share on other sites More sharing options...
RocketRacer Posted November 2, 2011 Share Posted November 2, 2011 Awesome to see people spending some time on this... Love LR Link to comment Share on other sites More sharing options...
Lair Posted November 2, 2011 Share Posted November 2, 2011 Has anything been done with this, or has everyone been focusing on the tracks? I know someone got textures recently. Link to comment Share on other sites More sharing options...
dead_name Posted November 2, 2011 Author Share Posted November 2, 2011 I've left RRU in general to one side recently, as University work has been taking priority (...and I got sidetracked looking at Portal 2 files...). I'll get back to this soon. Link to comment Share on other sites More sharing options...
Cyrem Posted November 2, 2011 Share Posted November 2, 2011 I know someone got textures recently. That would be origamiguy and he only can get some textures, not all. Compressed images haven't been figured out. He was mainly working on the track viewer at the moment. But I heard he is also working on a tool that can convert a number of LR files since they all use similar formats. EDIT: Origami beat me. Link to comment Share on other sites More sharing options...
le717 Posted February 24, 2012 Share Posted February 24, 2012 I've been reading this topic, but I can't find the answer to my question. This topic says that we are looking for the compression algorithm, but on the other topics, it's being said that we are looking for the compression code, as if we know the algorithm. So which one is it? If it's the code, I have an idea on how it might be found. Link to comment Share on other sites More sharing options...
Cyrem Posted February 24, 2012 Share Posted February 24, 2012 The compression algorithm needs to be figured out first. Link to comment Share on other sites More sharing options...
le717 Posted February 25, 2012 Share Posted February 25, 2012 @Cyrem Thanks. I didn't know which one was needed. Link to comment Share on other sites More sharing options...
le717 Posted May 4, 2012 Share Posted May 4, 2012 From origamiguy's YouTube channel: Awesome face just became truly awesome. :af: Link to comment Share on other sites More sharing options...
Fluffy Cupcake Posted May 5, 2012 Share Posted May 5, 2012 I wonder why he didn't post it here himself. Link to comment Share on other sites More sharing options...
lol username Posted May 5, 2012 Share Posted May 5, 2012 Cirevam, Lair, myself, and origamiguy were all on a voice chat when that happened. I mentioned that I wanted to mod the rolling rocks in Adventure Temple Trail to have awesomefaces, which origamiguy then did. Then a while later he bumped it up a few notches and made a batch script to replace EVERY TEXTURE IN THE GAME with awesomefaces, and, well... Yeah. That was one heck of a night. Pretty sure he just used TGA textures, by the way. Link to comment Share on other sites More sharing options...
Recommended Posts