---
title: "Half-Life 2's models in Godot"
description: "sourcegd, a little Godot 4.5 project that reads Half-Life 2's VPKs, lists every model inside them and shows you whichever one you pick."
url: "https://evil-engine.com/devlogs/half-life-2-models-in-godot"
published: "2025-10-16T06:40:00.000Z"
modified: "2025-10-16T06:40:00.000Z"
---

Devlogs

2025-10-15 23:40 MST

# Half-Life 2's models in Godot

sourcegd, a little Godot 4.5 project that reads Half-Life 2's VPKs, lists every model inside them and shows you whichever one you pick.

---

sourcegd is me poking at whether Godot can read Source’s files directly, with no conversion tools sitting in between. It’s about 2,300 lines of GDScript on Godot 4.5.

## What it does

Point it at a Half-Life 2 install and hit “Load All Models”:

1. It opens `hl2_textures_dir.vpk` and `hl2_misc_dir.vpk`, Valve’s own archives, and reads files straight out of them
2. It finds every `.mdl` inside and reads each one’s header, so the list shows the model’s real name
3. Pick one in the model browser and it builds the mesh from the model’s VVD vertices and VTX strips, converted from Source’s axes over to Godot’s
4. It hunts for textures in the model’s texture folders first, then each material’s `$basetexture`, then by filename as a last resort
5. VTF textures get rewrapped as DDS so Godot will load them

Then whatever you picked spins on a turntable.

![Half-Life 2’s rusty oil drum loaded in sourcegd, textured, under the VPK and model paths it came from](https://evil-engine.com/_astro/sourcegd-oil-drum.Dh6QgaUO_Z2mjCvW.webp)

## What it doesn’t do

- Models are static, so there are no bones, animation or physics
- Only DXT1, DXT3 and DXT5 textures load
- The VMT reader only cares about `$basetexture` and `$surfaceprop` and skips everything else
- When a material doesn’t resolve, texture lookup falls back to matching filenames, which is about as janky as it sounds

Newer

### [It started as a creature creator](https://evil-engine.com/devlogs/day-one-was-a-crawler)

## Details

- **Written**: 2025-10-15 23:40 MST
- **Edited**: 2025-10-15 23:40 MST

## Contents

- [What it does](https://evil-engine.com/devlogs/half-life-2-models-in-godot#what-it-does)
- [What it doesn’t do](https://evil-engine.com/devlogs/half-life-2-models-in-godot#what-it-doesnt-do)

## Stay up-to-date

- [RSS](https://evil-engine.com/rss.xml)
- Mailing list
- [Steam](https://store.steampowered.com/app/3731310/Evil_Engine)
