The End Is Nigh

2 minute read

The End Is Nigh

The End Is Nigh is a fun game that I have been playing recently by Edmund McMillen (and Tyler Glaiel), creator of Super Meat Boy, amongst other things.

One of the things I particularly enjoyed in the game were the collectable game cartridges that unlocked mini-games within the main game. I loved the retro-style title screens that each of the games has, although I was a little frustrated that you don’t get long to look at them in game and that they are displayed with a retro television effect which blurs the images.

So, I set about to see if I could find the images inside the game code.

Here’s what I found …

Well, nothing at first, as like most games, the game assets are packed into an archive file.

In this case I was able to guess the format of the archive file by looking at it in a hex editor, then writing a QuickBMS script to do the extraction. I’m not going to bother posting it here as someone else has already written a similar one on the Zenhax forum here. Someone else has posted code for an extractor here on github, too.

The title images for the cartridges are all in the extracted textures folder, but stored as 1280x720 pixel greyscale images, whereas in game they are in colour.

(As an aside, there are no texture images for any of the in-game graphics, leading me to suspect they are all in the “endnigh.swf” file in Shockwave vector format.)

There is a single image called palette.png which contains the colour information for the greyscale images, and in the shaders folder there is a shader called palette_textured.shader which gives the GPU instructions on how to colour the images using the palette.

If you type “find “cart_intro_” tilesets.txt” you can get a list of which row in the palette.png file corresponds to which cartridge image.

Armed with that information I wrote a relatively basic Unity program to display the image textures on a material with a shader that mimicked the one that came with the game.

The 1280x720 images were actually made up of 8x8 blocks, so I set the screen size to 160x90 so the cartridge images would be displayed with just a single pixel per block. I also had to take care of a few image issues by disabling filtering in the image rendering options, and also disabling image compression. Then I ran the program and had it save out the images to disk.

And here they are in all their retro-low-res pixelly glory! Full credit to the artist, Matt Kap.

Categories:

Updated: