Extracting images from Living Books

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
Windows 95
Posts: 2
Joined: Sun Sep 10, 2017 7:58 pm

Extracting images from Living Books

Post by Windows 95 »

Perhaps this is posted in the wrong place. Maybe it shouldn't be on the forums at all, but I'm hoping someone who has worked on ScummVM can give me some pointers here.

I've been looking into extracting images from the Living Books game "Green Eggs and Ham" for a project, but it appears to be a rather troublesome challenge as they're not in a standard format. Watto Studios, the creator of Game Extractor, suggested I try looking through the source code of ScummVM, in particular "livingbooks.cpp", but I'm just not sure where to begin.

Yeah... sorry if this is a little broad. I'm looking to convert the game's image files to a usable format such as PNG8 - I can share the relevant game files if that would help?
Windows 95
Posts: 2
Joined: Sun Sep 10, 2017 7:58 pm

Post by Windows 95 »

bump
Bakhtosh
Got a warning
Posts: 19
Joined: Sun Oct 08, 2006 8:14 am

Post by Bakhtosh »

The images are stored in *.MHK archives (an archive type used by the Mohawk engine that is used by the Living Book games) splitted into files that contains the color palette and bitmap files that contains the info which pixel used which color number of a palette in a compressed format.

So it's not like you can simply extract the compressed bitmap files and create a conversion tool since the bitmap files alone are missing the real color values. You need the matching palettes to assign the real color values.

To create an image usable by a common graphics editor you need to be able to:
- extract files from the *.MHK archives
- decompress the bitmap files
- understand how the Mohawk engine assembles the scenes, so that you can extract the info which palette is active when a bitmap file is displayed

The best starting point is, as the creator of the Game Extractor has suggested, to look how the Mohawk engine loads and then computes the resources of the Living Book games step by step. Starting from the code of the "livingbooks.cpp" (which includes/uses code from other modules as well). You can find the ScummVM Mohawk engine code modules here:
https://github.com/scummvm/scummvm/tree ... nes/mohawk

The module filenames are pretty intuitive. For example you find the code to read *.MHK files in "resource.cpp", the code to decompress/read the bitmap files in "bitmap.cpp" and the code to read palette files in "view.cpp".

Of course it means you have to invest some time if you're not familiar with the syntax of c++.
Post Reply