Best way to save game data

I want to make my game save the player's data, and I was searching how to do it. It seems that Godot has many ways to save and load game data, including using (or not) JSON.
My question is: Is there is a best method to save/load data?
Like, some methods may be limited, or may be inneficient.
So, I would like to know your opinions to the best one to an Android game.

Tags :


  • Erich_LErich_L Posts: 590Member

    I can't speak for android, but if you wanna keep things in easy to read for godot I suggest using a resource file. This is mine for saving a level of my tile-based game.

    class_name SaveGame
    extends Resource
    export var game_version : String
    export var floorTiles : Array

    Look how short and sweet!

    Then for using it to save:

    var savegame :=
    savegame.game_version = ProjectSettings.get_setting("application/config/version")
    for c in floorNode.get_children():
    var path = "res://Levels/Level_" + String(activeLevelNo) + ".res"
    var err =,savegame)
    if err != 0:
        print("error saving game in Level Editor, code: ", err)

    Then you can go back to eating Turkey!

  • cyberealitycybereality Posts: 3,714Moderator

    See here for a robust and recommended way to do it:

    But if you just need to save a few variables, this is easier:

  • UpsetChickenUpsetChicken Posts: 18Member

    Thanks everybody!

Sign In or Register to comment.