Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Godot binary resource

From ReverseEngineering.wiki
Format
Versions format version 1-6 (6 in Godot master)
Magic 52 53 52 43 ("RSRC"); compressed: 52 53 43 43 ("RSCC")
Extensions .res, .scn, .tres/.tscn converted
Endianness little endian (a header field can flag big endian)
On this wiki Facts · Code · Notes · Topics

Binary resource files of the Godot engine (.res, .scn and the binary form of .tres/.tscn): magic RSRC, or RSCC when the whole file is block-compressed, then a format version, engine version, string table, external and internal resource tables and the property data.

Overview

Godot saves resources either as text (.tres, .tscn) or in a binary form (.res, .scn); exported games convert text resources to binary. The reader is ResourceLoaderBinary in core/io/resource_format_binary.cpp of godotengine/godot (MIT). Binary resources are normally stored inside a Format:Godot PCK, often next to imported textures (Format:Godot compressed texture) and scripts (Format:GDScript binary tokens).

Header

All values are uint32 unless noted. A reader checks the first four bytes:

Offset Field Notes
0 magic RSRC for a plain file; RSCC for a compressed file, whose remaining bytes are a block-compressed stream (see below) containing the same layout starting after the magic
4 big endian flag 0 or 1; the reader switches the file to big endian when set
8 use_real64 read and ignored by the loader; the real-is-double information is in the flags
12 engine major version the reader refuses a file whose major is newer than the engine
16 engine minor version
20 format version 1 to 6; the reader refuses a newer one
24 resource type string: uint32 length including a NUL, UTF-8, padded to a multiple of 4
after import metadata offset uint64
flags bit 0 named scene IDs, bit 1 UIDs, bit 2 real_t is double, bit 3 has script class
uid uint64 (read always, valid when the UID flag is set)
script class string, only when flag bit 3 is set
11 reserved uint32

Then: uint32 string-table size and the strings (the property and node names used later), uint32 external resource count with per entry type string, path string and (UID flag) a uint64 UID, uint32 internal resource count with per entry a path string and a uint64 offset in the file. The internal resources and the main resource follow at those offsets as lists of properties whose values start with a uint32 Variant type number (nil 1, bool 2, int 3, float 4, string 5, Vector2 10 ... object 24, dictionary 26, array 30, packed arrays 31-37, int64 40, double 41, StringName 44, up to PackedVector4Array 53); this numbering differs from the in-memory Variant::Type and from Format:Godot variant binary encoding.

Format versions

From the comments of resource_format_binary.cpp: version 2 added 64-bit int and float, 3 changed the NodePath encoding, 4 introduced string IDs for external and sub-resources (breaks forward compatibility), 5 allowed storing the script class in the header, 6 added PackedVector4Array. The numeric version a Godot release writes is not listed in the file; read it from your own sample.

RSCC compression

FileAccessCompressed (core/io/file_access_compressed.cpp) writes: 4 bytes magic (RSCC), uint32 compression mode (Compression::Mode order: FastLZ 0, Deflate 1, Zstd 2, GZip 3, Brotli 4), uint32 block size, uint32 total uncompressed size, then one uint32 compressed size per block (total / block size + 1 entries), the compressed blocks back to back, and the magic again at the end. A reader must decompress block by block. Unverified: which mode and block size exported games use (check the mode field of your sample).

Code & repositories

  • https://github.com/godotengine/godot @ 81ab961f91066a63bcbf3ec340962bb1a1ada558 · license: MIT
    Godot engine source (MIT). Useful without building: core/io/file_access_pack.cpp (PCK reader), core/io/resource_format_binary.cpp (RSRC), core/io/file_access_compressed.cpp (RSCC), core/io/file_access_encrypted.cpp, scene/resources/compressed_texture.cpp (GST2/GSTL), modules/gdscript/gdscript_tokenizer_buffer.cpp (GDSC).
    Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2026-10-18; Note: the latest release ships binaries; the wiki links only the source, never the binaries

Pitfalls

  • Unverified: Godot 3.x binary resources use the same RSRC container with lower format versions and different Variant numbering details; read the version field first and compare with the matching 3.x source.
  • Object properties refer to external resources by index or by res:// path; with the UID flag the path may be stale and the UID is authoritative.