Go parser for Rockstar Games' RenderWare binary formats — DFF (3D models) and TXD (texture dictionaries) — as used in Grand Theft Auto III, Vice City, and San Andreas.
Zero external dependencies.
go get github.com/go-theft-auto/renderwarepackage main
import (
"context"
"fmt"
"os"
"github.com/go-theft-auto/renderware"
)
func main() {
// Parse a DFF model
f, _ := os.Open("infernus.dff")
defer f.Close()
clump, err := renderware.ParseDFF(context.Background(), f)
if err != nil {
panic(err)
}
fmt.Printf("Frames: %d, Geometries: %d\n", len(clump.Frames), len(clump.Geometries))
for _, geom := range clump.Geometries {
fmt.Printf(" %d vertices, %d triangles\n", geom.NumVertices, geom.NumTriangles)
}
}// Parse a TXD texture dictionary
f, _ := os.Open("infernus.txd")
defer f.Close()
dict, err := renderware.ParseTXD(context.Background(), f)
if err != nil {
panic(err)
}
for _, tex := range dict.Textures {
fmt.Printf("%s: %dx%d\n", tex.Name, tex.Width, tex.Height)
// tex.Data contains decoded RGBA8888 pixels
}| Format | Parser | Description |
|---|---|---|
| DFF | ParseDFF |
Clump, FrameList, GeometryList, Atomics, BinMesh, SkinPlugin, HAnimPlugin |
| TXD | ParseTXD |
Uncompressed (RGBA, RGB, paletted), DXT1/DXT3/DXT5 with software decompression |
All textures are decoded to RGBA8888 regardless of source format.
This project uses Devbox for a reproducible environment and Task as the build runner.
devbox shell # enter the dev environment (Go 1.25, formatters, linters)
task fmt # format code (gci + gofumpt)
task lint # run golangci-lint
task test # run tests
task build # verify compilation
task example # run the example programSee CONTRIBUTING.md for more details.