Skip to content

Instantly share code, notes, and snippets.

@Jummit
Last active January 29, 2024 08:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jummit/c99335f34583294bcb3c814e83b36cab to your computer and use it in GitHub Desktop.
Save Jummit/c99335f34583294bcb3c814e83b36cab to your computer and use it in GitHub Desktop.
A list of ways to create save games in the Godot Engine

Godot Save Formats

Table of contents generated with markdown-toc

Json

Read: parse_json(str)

Write: to_json(data)

Pros

Easy to debug and use.

Cons

Large file size.

Only supports float number type.

Most data types have to be saved using var2str.

XML

Read: XMLParser or File

Write: custom

Pros

XML is widely supported.

Cons

Currently hard to write custom XML parser and serializer.

GDscript Resources

Read: load(file)

Write: ResourceSaver.save(resource)

Pros

Integrated into Godot. Loading and saving Godot data directly.

Cons

No versioning. Difficult to debug outside Godot.

Tscn

Read: load(file)

Write: PackedScene.pack(scene)

Pros

Integrated into Godot; load and save Godot game state directly.

Cons

Saves everything, can‘t select.

Binary

Read: var2bytes(var)

Write: bytes2var(bytes)

Pros

Small file size, very customizable and compact.

Cons

The most difficult and hard to debug option.

Text

Read: var2str(var)

Write: str2var(str)

Pros

Easy to read and write.

Cons

Error-prone and large file size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment