grpgpack command-line tool is used to pack game data (textures, tiles, objects, items, and NPCs) into optimized binary formats for GRPG.
Installation
The data packer is built from the source code indata-packer/main.go.
Commands
tex
Packs texture files into a.grpgtex format.
Syntax:
| Flag | Short | Type | Required | Default | Description |
|---|---|---|---|---|---|
--manifest | -m | string | Yes | - | Path to the texture manifest file |
--output | -o | string | No | textures.grpgtex | Output file path |
.cfg format with [Texture] sections:
- Input images must be in PNG format
- Textures are encoded to JPEG XL format (quality 100, effort 10)
- ID 0 is reserved and cannot be used
- Each texture requires a unique internal name and ID
tile
Packs tile definitions into a.grpgtile format.
Syntax:
| Flag | Short | Type | Required | Default | Description |
|---|---|---|---|---|---|
--manifest | -m | string | Yes | - | Path to the tile manifest file |
--output | -o | string | No | tiles.grpgtile | Output file path |
--textures | -t | string | Yes | - | Path to the .grpgtex file to reference |
- Requires a pre-built
.grpgtexfile - The
tex_namefield must match a texture name from the textures file - Tiles reference textures by their internal name
obj
Packs object definitions into a.grpgobj format.
Syntax:
| Flag | Short | Type | Required | Default | Description |
|---|---|---|---|---|---|
--manifest | -m | string | Yes | - | Path to the object manifest file |
--output | -o | string | No | objs.grpgobj | Output file path |
--textures | -t | string | Yes | - | Path to the .grpgtex file to reference |
- Requires a pre-built
.grpgtexfile - Objects reference textures from the provided texture file
item
Packs item definitions into a.grpgitem format.
Syntax:
| Flag | Short | Type | Required | Default | Description |
|---|---|---|---|---|---|
--manifest | -m | string | Yes | - | Path to the item manifest file |
--output | -o | string | No | items.grpgitem | Output file path |
--textures | -t | string | Yes | - | Path to the .grpgtex file to reference |
- Requires a pre-built
.grpgtexfile - Items reference textures from the provided texture file
npc
Packs NPC definitions into a.grpgnpc format.
Syntax:
| Flag | Short | Type | Required | Default | Description |
|---|---|---|---|---|---|
--manifest | -m | string | Yes | - | Path to the NPC manifest file |
--output | -o | string | No | items.grpgitem | Output file path |
--textures | -t | string | Yes | - | Path to the .grpgtex file to reference |
- Requires a pre-built
.grpgtexfile - NPCs reference textures from the provided texture file
Build Pipeline
The typical build order for game data:-
Pack textures first (no dependencies):
-
Pack tiles, objects, items, and NPCs (all require textures):
Error Handling
All commands will return an error if:- Required flags are missing
- Manifest files cannot be read or parsed
- Referenced texture files are missing or invalid
- Output files cannot be created
Source Code
Implementation:data-packer/main.go:18-112
Command implementations:
- Textures:
data-packer/textures/cmd.go:18-56 - Tiles:
data-packer/tiles/cmd.go:13-57 - Objects:
data-packer/objs/cmd.go:13-60 - Items:
data-packer/items/cmd.go:13-56 - NPCs:
data-packer/npcs/cmd.go:13-57