conanac

Creating custom sticker for Rabbids Go Home game (part 2)

Rate this Entry
Now, in this second part, we will be going through the second segment of the tutorial video. In this segment, we run the extractstickers.exe as well as insertstickers.exe applications. Let's start with describing the first one.

extractstickers.exe application can be used to extract all existing stickers (24 pieces) in the savegame file SLT_0_2.SAV. As mentioned in my previous blog (the first part in this series), each sticker actually contains two images. One is for the picture and the other is for the background (to create a transparent background). In order to properly extract these two images (into two separate files), we must understand the data structure of these two types of image.

The data structure of both types of image is relatively simple and looks like the following:
1. sticker header
2. image data/file
where the sticker header structure contains 12 bytes:
a. bytes 0-3 are 0x00
b. bytes 4-7 store sticker id or tag
c. bytes 8-11 store filesize of the image data/file
Therefore, for the picture image these bytes 8 to 11 are 0x00005000, and for the background image they are 0x00002800 (see the first part of this blog series).

With this information, we are ready to put a code together that will extract those image data/files. And since the image format is JFIF/JPEG, we could just put extension .jpg to each file, and they are ready to be edited or changed by any image editor that could work with JFIF/JPEG format.

To make sure that we could insert back these stickers (after editing them) to the savegame file, I choose to put them in a directory (based on the name of the savegame file) and use some standard for their names. For the picture image, the file name convention is "stickerpctXX.jpg". Similarly "stickerbgdXX.jpg" is for the file name convention for the background image. "XX" represents the number in hexadecimal from 0x01 to 0x18 (or 24 in decimal). So "0A" means the tenth sticker.

You could find the codes and the zipped executable files for both extractstickers.exe and insertstickers.exe applications in the google code project hosting of rghsticker. They are simple PC applications. You just need to unzip each downloaded file, and then drag and drop the savegame file SLT_0_2.SAV onto these executable files. The process is to extract first, then edit the stickers, and the last step is to insert them back. The codes have not been optimized and were put together quickly. So they only have minimal error-trapping or robustness features. Nevertheless, if you see or find any bugs, let me know.

Have fun using them, and let me know if you are able to make or create nice stickers. Perhaps, you could also share those in this forum to others.

This part 2 blog concludes the series. Cheers.

Until next time...

Comments

  1. Vash's Avatar
    Nicely done as always I'll definitely be trying out my own sticker creations!