Binary serialization for Godot 4

FlatBuffers.
No native code.

Read, build, and verify FlatBuffers in pure GDScript — with typed accessors generated from your .fbs schema. Byte-identical output to the official implementation, running on every platform Godot exports to, including Web.

Godot 4.x Pure GDScript MIT licensed
3runtime components
0native dependencies
1:1byte parity with official flatc
export targets
Serialization without the toolchain

Schema in.
Typed GDScript out.

FlatBuffers is the right wire format for games — zero-copy reads, no parsing pass, tiny payloads — but GDScript was never a supported target. This module closes that gap without a GDExtension to compile per platform.

Point the generator at a compiled .bfbs schema and it emits typed table accessors and builders. The runtime underneath is a faithful port of the official builder: same layout, same bytes.

The whole wire format

Small surface.
Real FlatBuffers.

Everything your packets need — tables, unions, vectors, strings, defaults — verified against official output.

01

Read, build, verify

Three small classes cover the lifecycle: FlatBuffer for zero-allocation reads, FlatBufferBuilder for wire-identical writes, FlatBufferVerifier for bounds-checked untrusted input.

  • Vtable + scalar reads
  • Back-to-front builder
  • Structural verifier
02

Generated accessors

A Python tool walks the binary reflection schema (.bfbs) and emits typed GDScript wrappers — no flatc fork required.

03

Unions and envelopes

First-class support for union member tables and envelope patterns — the shapes real network protocols actually use.

04

Runs everywhere Godot does

Pure GDScript means desktop, mobile, consoles, and Web exports all work — no per-platform native builds, no export drama.

05

Proven byte-for-byte

The test suite builds golden vectors with the official JavaScript implementation and compares GDScript output byte-for-byte — scalars, strings, vectors, nested tables, defaults, and corrupt-buffer handling.

  • Golden vector tests
  • Corrupt input rejection
  • Headless CI suite

Predictable by design

A pipeline you can reason about.

Write your schema once, compile it with stock flatc to a binary reflection schema, and generate typed GDScript. At runtime the same three classes read and write the wire bytes directly — nothing hidden, nothing native.

Explore the source
  1. 01
    Schema

    Author your .fbs messages.

    flatc · unions · tables
  2. 02
    Reflect

    flatc emits the binary schema.

    -b --schema · .bfbs
  3. 03
    Generate

    Typed .gd accessors + builders.

    generate_gd.py
  4. 04
    Ship

    Read/write on the wire in-game.

    FlatBuffer · Builder · Verifier

Runs in your browser

Build a packet. Watch the bytes.

The live demo is the module itself compiled to WebGL: pick a message type, fill in fields, and build a real FlatBuffer. Inspect the hex, verify the buffer, decode it back through the generated accessors, and benchmark throughput — all in GDScript.

godot-flatbuffers.splatterfacegames.com/demo
Open full screen

Interactive Godot demo

Ready when you are.

The WebGL build is downloaded only after you start it.

Open by default

MIT licensed.
Built in the open.

Use it in personal, commercial, and open-source Godot projects. Read the implementation, adapt the generator, and contribute improvements upstream.