Thursday, November 17, 2022

Papercraft Gordon Freeman WIP 1 start: How to extract a 3D model from 1998's Half-Life to use as basis for a new papercraft model! :o)


That must mean a new papercraft from a video game series I didn't do before?

...Yes! > Half-Life! ;o)



◾ You'll need the game!

As always: to extract actual game models from a game, you need to own the actual game. I'm using the 2002 third Half-Life Generation version. This version includes:
  • The original Half-Life Game of the Year Edition (following the story of our favorite scientist, Gordon Freeman) including the separate Team Fortress Classic game as a bonus on the same CD-ROM
  • Opposing Force (the first Half-Life expansion following the story of US Marine Corporal Adrian Shephard)
  • Blue Shift (another expansion, this time following the story of Black Mesa security guard Barney Calhoun)
  • And Counter-Strike (the fanmade mod to Half-Life that was so good that Valve bought the rights and made it into a whole standalone series 😉)

The game model extraction method I used should work for all games and mods made using Valve's GoldSrc game engine, but bear in mind I only tried it for these four games!

The game data (including the game models, animations and textures) will be packed into game Packages with a .pak file extension:

- You can get the original .pak files for Opposing Force and Blue Shift directly from the CD-ROMs and for the original Half-Life you will find it in the installation directory of the game after installation.

- If you install the Blue Shift expansion, though, you will also get the option to install the High Definition Pack, which will install .pak files with more detailed (highpoly) models, so why not do so? 😉


    • Half-Life, in C:\Sierra\Half-Life\valve folder:
      • pak0.pak (original lowpoly models)
      • pak1.pak (highpoly upgraded models)
    • Opposing Force, in C:\Sierra\Half-Life\gearbox folder:
      • pak0.pak (original lowpoly models)
      • pak1.pak (no models)
      • pak2.pak (highpoly upgrade models)
    • Blue Shift, in C:\Sierra\Blue-Shift\bshift folder:
      • pak0.pak (Half-Life models)
      • pak1.pak (Blue Shift models)
      • pak2.pak (Blue Shift lowpoly or highpoly models (depending on whether you installed the High Definition Pack)
  • TIP: I always recommend to copy any game files you plan to mess around with to a separate working folder first!






◾ Unpacking and decompiling the model files (Jed's Half-Life Model Viewer)

- Now that you have the actual game files you need, download and install Jed's Half-Life Model Viewer:

- Download the StudioMDL compiler from DoD and the Command line MDL decompiler from Jed's webpage as well and unpack them somewhere you won't loose them, like the model viewer's installation folder (C:\Program Files (x86)\Jed's Half-Life Model Viewer 1.3.6)

- Open Jed's Half-Life Model Viewer and go to the Tools menu and choose Configure  Tools... to set the paths to the StudioMDL compiler and Command line MDL decompiler tools you just downloaded and unpacked.



- Then in the File menu, choose File -> Open Half-Life Package... and find the .pak file that has the game model you want to extract. Be sure to switch the file-type in the drop-down list to PAK Files (.pak) or you won't be able to see the .pak files! 😜

- I know there's a nice Gordon Freeman model in the original Opposing Force expansion, so I'm opening the Opposing Force pak0.pak file that I copied to my working folder.

- Click the "+" icon in the file-tree on the right side of the model viewer to select the .mdl model you want from the list (most of them will be under the models header of course).

  • NOTE: Once you select an .mdl from the file tree list, you can see a preview in the model window. Here are some basic controls for the preview window:
    • Right mouse button: zooms in and out
    • Left mouse button: rotates the model
    • Shift + left mouse button: moves the model up, down, left and right

- At the bottom of the screen, select the Sequence tab to preview all the animations that the model has using the Animation Sequence dropdown list.

- Once you're satisfied with the .mdl model you found, right-click its .mdl in the file tree and choose Extract File...

- Select a destination to extract the .mdl to and click OK to extract the .mdl file to the chosen destination.




- Now go to the Tools menu, choose Decompile Model... and select the .mdl file you just extracted.
Click OK and if you check the folder where you saved the .mdl file, you will see decompiling the .mdl file created:
    • Several .smd files (contains the skeleton information/animations);
    • a .qc file (script telling the game how to combine the 3D reference mesh with the textures and sequences/animations);
    • and a bunch of .bmp images (textures).



◾ Importing and converting Half-Life 3D models (Blender + Blender Source Tools)

- Download and install Blender 2.92 or later (you can even used the Portable version that you don't have to install):
        blender.org/download/

-  Next, also download Blender Source Tools 3.2.4 from The Steam Review:

- Now start Blender and go to the Edit menu and choose Preferences.

- Make sure you're on the Add-ons window and then choose the Install an add-on option at the top.

- Select the .zip file you just downloaded and click the Install Add-on button (you don't even have to unpack the .zip file. 😜

- Once the add-on is installed, make sure it is activated (there should be a checkmark in the checkbox for the Add-on)

- Save your preferences by clicking the 3-lined hamburger icon in the bottom left and choosing Save Preferences.



- Now close the Blender Preferences window and go to File -> Import -> Source Engine (.smd, .vta, .dmx, qc) and FIRST import the .qc file that Jed's Half-Life Model Viewer saved earlier (zoom out a bit to see the model).

- SECOND, go to File -> Import -> Source Engine (.smd, .vta, .dmx, qc) again and this time import one of the .smd files.

- You can use the animation slider at the bottom to choose a nice pose.

- If you don't like the animation, you can choose a different one by importing a different .smd file over the .qc.
  • NOTE: Import the .qc file FIRST and the .smd file SECOND to avoid problems with the animation.



- Once you're happy with the model and the pose, choose File -> Export -> Wavefront (.obj).

- Open the exported .obj file in your favorite 3D modelling program and assign the .bmp texture images to the correct materials to give the 3D model back its color!



Now stay tuned while I make Gordon Freeman into a papercraft model (or play around with your own extracted Half-Life model! 😉)





Tools used:

2 comments:

  1. It's amazing that someone from this community is still active. Could you make a guide for source games, for example half-life 2, counter strike source, team fortress 2?

    ReplyDelete
    Replies
    1. The Half-Life games and their spinoffs have a lot of fans creating 'mods', so I'm sure the tools are available! :o)

      However, I can't promise to make a guide like I did for the GoldSource original, because I only did that because I needed to figure it out myself too to make the papercraft. At the moment I have a lot of plans, but nor for Half-Life 2 or related games, sorry...

      When I started looking for Half-Life 1 tools, I found a lot of information on Half-Life forums and modding forums. A lot of websites were quite old of course, and I used the Wayback Machine (https://archive.org/web/) to read an archived version of them. I was able to find some working links although a lot of them were just dead after so many years as well...

      On fan forums and modding forum, people will mention a lot of tools and most of them I didn't need just for papercraft of course, but you should be able to find a lot of information on which filetypes the games use, what's inside and how you can open them (often a smart fan will have made a tool to do open and/or convert the file format) and how you can view and/or extract the 3D models (often but not always) with the animations with a (usually fan-made) model viewer.

      I'm sorry that I can't really help you better, but I haven't really looked for any Source specific tools so I can't tell you directly where to look (I simply don't know) but you should be able to find them with some searching! :o)

      If I ever do make a similar tutorial I will post it here of course, but I'm afraid it's just a hobby of mine and I can't promise anything...! :o(

      Delete