Tuesday, March 31, 2020

How to extract the 3D model of a Mighty Pirate from Escape from Monkey Island (papercraft Guybrush Threepwood WIP)


I'm not a hardcore classic adventure gamer and I really only played LucasArts' Grim Fandango and the Curse, Escape and Tales from Monkey Island games. But I did really like them! 😉 So after Grim Fandango's Manny, I had to do a Monkey Island Guybrush papercraft as well of course. 🐵

The Escape from Monkey Island version was the first 3D Monkey Island, and I can (hopefully 😉) make it look as if he jumped directly from the computer screen onto my desk! And I can also make another tutorial about how extracted the actual game model from a game to use as reference, because you can papercraft a lot more characters from the game of course! 😃


NOTE BEFOREHAND: I'm using the Steam version of Escape from Monkey Island because that's what I have. Although I can't check to make 100% sure, the tools I use will probably work with the original PC CD-ROM game as well (I think the Steam version is just a repackaging of the original game files with some fixes to make the game run on modern computers anyway?)

ANOTHER NOTE BEFOREHAND: I'm using a Windows 10 Home 64-bits desktop computer, so that's the only operating system I can confirm this method works on. Also, sometimes I have to tell my antivirus software to ignore the extraction tools I use: only do so if YOU are completely confident that the tool can be trusted, and NEVER turn off your antivirus software completely!!



Extracting the 3D model and textures: EMI Model Viewer & GLXtractor

- Now as always: to extract the game models from a video game, you need the game (see the "NOTE BEFOREHAND" above). If like me you have the Steam version, you have to install the game first to find the needed .m4b art bundles in your Steam > steamapps > common > Escape from Monkey Island Program Files folder.


- I use Benjamin Haisch' EMI Model Viewer 0.5beta to open the model files inside the .m4b art bundles, which you can download from his Quick And Easy Software website. Unpack the .zip file to find the EmiMeshViewer.exe file inside.


- The EMI Model Viewer won't be able to extract the 3D data by itself. For that I used a tool called GLXtractor V 0.9.9 by Alexander Kaspar, you can still download it from an archived version of his website. GLXtractor is actually a graphical user interface (GUI) frontend for Eyebeam OpenLab's OGLE: the GLXtractor download includes the OGLE tool and basically makes configuring it a whole lot easier. 😉

- GLXtractor uses the same principle as 3D Ripper DX or Ninja Ripper only for OpenGL instead of DirectX9 applications; you need to run the model viewer through GLXtractor so that it can intercept the data to the model viewer to capture it.

- Start the GLXtractor.exe tool and on the first screen click the Choose App button and browse to where you saved and extracted the EmiMeshViewer.exe file (the application you want to extract from).

- On the Capture tab, make sure the Capture Textures checkbox is checked. Also make a mental note of the Folder where the capture results will be saved and of the Capture Shortcut keys (by default, it's ctrl+shift+f).

- IMPORTANT NOTE: On the Ogle Plugin tab, make sure Capture Texture Coords is checked. I left the other settings as they are. Now click the Start Application button to start the EMI Model Viewer.



- GLXtractor will automatically start the EMI Model Viewer. Choose File > Open bundle and browse to your Steam > steamapps > common > Escape from Monkey Island Program Files folder to open one of the .m4b art bundles. In the EMI Model Viewer you will then see a Files list of all the Escape from Monkey Island file types in that .m4b bundle that EMI Model Viewer can open.

- IMPORTANT NOTE: For the 3D model extraction to work, you need to select three matching files (all with the same name, like "guy" for Guybrush) in a specific order:
1st: a .meshb file (the 3D model)
2nd: the matching .sklb file (the skeletal information for the model)
3rd: a matching .animb file (the animation)
- Double-click on a .meshb file to select it in the viewer window (it looks like most of the textures are missing, but don't worry).

- Next, double-click on the matching .sklb file. This will show the skeleton of the model and also the textures will show correctly now.

- Lastly, double-click one of the matching .animb files to select it. Click the Play/Stop button to see the animation in action.



- IMPORTANT NOTE: GLXtractor will only extract the 3D data when the model is moving/being animated!

- While the animation is playing, press the Capture Shortcut keys you selected in the GLXtractor configuration screen (by default they are ctrl+shift+f) to have GLXtractor capture the textures and an .obj file of the model.

- Find the .obj file in the Steam > steamapps > common > Escape from Monkey Island Program Files folder with the .m4b bundle you captured it from.

- By default, the textures will be saved as .png files in your My Documents > Xtracted > EmiMeshViewer > Frame_000430 > Images folder that GLXtractor created.




Fixing the textures in Metasequoia (or another 3D modelling program of your choice)

- This model extraction tutorial could be finished now, but I figured I'd also explain how to reassign the textures to model because there are some things that are useful to know doing this.

- Open the .obj file in your favorite 3D modelling program. I like to use Metasequoia because it works so well with Pepakura Designer that I will use to unfold the edited 3D Guybrush into a papercraft model, but you can use many other programs if you like those better.

- When opening the .obj file in Metasequoia, uncheck the Flip right and left and the Invert V of mapping options. (if you forget this, you can always manually mirror the 3D model from left to right and the .png files vertically afterwards to get the model and textures to look correct though).

- You will see that Guybrush is untextured right now and in the Material Panel (press CTRL+M in Metasequoia if you can't see it) there is only one material available for the model. GLXtractor extracted 7 .png textures though. For Guybrush, you will also need 3 extra materials: his teeth and ponytail bow need a solid white color (1), his chin and hands need a solid skintone color (2) and his boots a solid black color (3). I find it easiest to just create three new small image files with the appriate colors (I sampled the skintone from Guybrush's face so that it will match).



- Clone the first material in Metasequoia so that you have enough materials for each of the 10 textures you now have. Assign each of them to one of the different materials by double-clicking the materials and then under Mapping, click the Ref button next to the Texture box to browse to the .png texture files. You can also give the materials a more recognizable Name, which will make the next step much easier. 😉


- Now select one of the objects in the model in the Object Panel (press CTRL+Q in Metasequoia if you can't see it) so that it is highlighted.

- Then in the Edit commands, click the Sel Obj button (select the Modeling mode from the big pulldown menu in the top left if you can't see it). This will select the polygons (Metaseqioia calls them "faces") of the model that belong to the selected object.

- With the "faces" of the object selected, select the appropriate material/texture and assign it to those polygons by clicking Selected > Set material to faces. So for example if you see that object 2 is the object for Guybrush's sleeve cuffs and collar of his boots, you can select the polygons of object 2, select the material that has the .png texture file for Guybrush's sleeve cuffs and boots collar (if you gave the materials recognizable names you will be able to find them much easier!) and then set that material to those faces.

- Do this for each of the objects and materials/textures. Make sure to deselect the selected faces before moving on to the next object by pressing CTRL+D or you will assign the textures to the wrong objects!

- Object 1 is actually a combination of the objects with solid colors, so instead of using the Sel Obj option, click the Select command (or just press S), choose the Joined face option on the context menu and then you can click on Guybrush's boots for example to select all the Faces that are connected together and then set the black material to the selected faces.

- Once you've set the appropriate materials to all the separate objects, Guybrush will finally look alright again. 😃



- And there you have it: a 3D Guybrush to use as a reference for a new papercraft model! Guybrush's armpits are a bit messed up (I know, that's not so strange for a LucasArts adventure game character; but I mean on the 3D model 😉) but that's something I'll fix when I'll be working on making the 3D model suitable for papercraft. Stay tuned!


Tools used:
- Benjamin Haisch EMI Model Viewer 0.5beta: https://quickandeasysoftware.net/software/emi-model-viewer

- Alexander Kaspar's GLXtractor V0.9.9:
https://web.archive.org/web/20111115194033/http://members.chello.at/alexan/

- Metasequoia 4: http://metaseq.net/en/

If you liked this tutorial and want to save it, you can download the combined steps as this single image:


No comments:

Post a Comment