Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Indie Blueprint Save

An asset by ninetailsrabbit
The page banner background of a mountain and forest
Indie Blueprint Save hero image

Quick Information

0 ratings
Indie Blueprint Save icon image
ninetailsrabbit
Indie Blueprint Save

This save system provides a convenient way to manage save files in your Godot project. It leverages the IndieBlueprintSavedGame resource, which can be extended for your specific game data

Supported Engine Version
4.4
Version String
1.1.0
License Version
MIT
Support Level
community
Modified Date
1 month ago
Git URL
Issue URL
Logo

Indie Blueprint Save

This save system provides a convenient way to manage save files in your Godot project. It leverages the `SavedGame` resource, which can be extended for your specific game data
· Report Bug · Request Features



📦 Installation

  1. Download Latest Release
  2. Unpack the addons/indie-blueprint-save folder into your /addons folder within the Godot project
  3. Enable this addon within the Godot settings: Project > Project Settings > Plugins

To better understand what branch to choose from for which Godot version, please refer to this table:

Godot Version indie-blueprint-save Branch indie-blueprint-save Version
README GodotEngine 4.3 1.x
README GodotEngine main 1.x

SaveManager 💾

  • Multiple Save File Support: Load and manage multiple save files stored in the user's game directory.
  • Customizable SavedGame Resource: The SavedGame resource acts as a container for your game data and can be extended with your own logic.
  • Simple Saving: Easily save game data using the write_savegame method on a newly created SavedGame resource.
  • Efficient Loading: Load previously saved games using the SaveManager's functionality.
  • File format: Use .tres format when detects that the current build is a debug build or .res if not.

There are 2 operations that the SaveManager always does.

  • Load the save files when ready
  • Write the current save game when the game is closed.

// Load saved games in _ready
func _ready() -> void:
    list_of_saved_games.merge(read_user_saved_games(), true)


//Write the current save game when close
func _notification(what: int) -> void:
    if what == NOTIFICATION_WM_CLOSE_REQUEST:
        if current_saved_game:
            current_saved_game.write_savegame()

Signals

created_savegame(saved_game: SavedGame)
loaded_savegame(saved_game: SavedGame)
removed_saved_game(saved_game: SavedGame)

error_creating_savegame(filename: String, error: Error)
error_loading_savegame(filename: String, error: Error)
error_removing_savegame(filename: String, error: Error)

Methods

// Dictionary<String, SavedGame>
@export var list_of_saved_games: Dictionary = {}
@export var current_saved_game: SavedGame


func make_current(saved_game: SavedGame) -> void

func create_new_save(filename: String, make_it_as_current: bool = false)

func load_savegame(filename: String) -> SavedGame

func remove(filename: String)

func read_user_saved_games() -> Dictionary

func saved_game_exists(saved_game: SavedGame) -> bool

func save_filename_exists(filename: String) -> bool

SavedGame Resource

This is the Resource that represents a save game in your project. Here is where you add new properties to save, the advantage of using resources is that it supports most types as well as being able to nest other resources.

It's recommended to extend this resource and set your game properties there

The dates are automatically updated in each write

class_name SavedGame extends Resource

static var default_path: String = OS.get_user_data_dir()

@export var filename: String
@export var display_name: String
@export var version_control: String = ProjectSettings.get_setting("application/config/version", "1.0.0")
@export var engine_version: String = "Godot %s" % Engine.get_version_info().string
@export var device: String = OS.get_distribution_name()
@export var platform: String = OS.get_name()
@export var last_datetime: String = ""
@export var timestamp: float

// Write or update this resource with the filename provided.
// The filename is only needed in when it is first created
func write_savegame(new_filename: String = filename) -> Error

// This remove the resource file from the system is irreversible so be sure to use confirmation prompts in your UI before performing this action.
func delete()

How to save

Here's a simplified example of saving a game:

var saved_game = SavedGame.new()
saved_game.write_savegame("my_game_save") // The filename needs to be provided only in the first creation

// Updating content
saved_game.game_settings = updated_settings
saved_game.highscore = 10000

// The write_savegame method automatically creates the save file within the user's game directory.
saved_game.write_savegame()

This save system provides a convenient way to manage save files in your Godot project. It leverages the IndieBlueprintSavedGame resource, which can be extended for your specific game data

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Indie Blueprint Save icon image
ninetailsrabbit
Indie Blueprint Save

This save system provides a convenient way to manage save files in your Godot project. It leverages the IndieBlueprintSavedGame resource, which can be extended for your specific game data

Supported Engine Version
4.4
Version String
1.1.0
License Version
MIT
Support Level
community
Modified Date
1 month ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers