Binary Compressed Save System, Save Entire Dynamically Generated Worlds! ♥ Rama

Here’s the Game State interface that I implemented. I’m sure you can easily figure out where the hooks go if you’re interested :slight_smile: Provides a nice way for me to get global notifications on save events.



#pragma once

#include "CoreMinimal.h"
#include "RamaSaveGameStateInterface.generated.h"


DECLARE_DYNAMIC_MULTICAST_DELEGATE(FRamaSaveGameStateFullyLoadedSignature);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FRamaSaveGameStatePreSaveSignature);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FRamaSaveGameStatePlayerLoadedSignature, APlayerController*, PC, APawn*, Pawn, int32, PlayerIndex);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FRamaSaveGameStatePreLoadDestroySignature);


UINTERFACE(Blueprintable, MinimalAPI)
class URamaSaveGameStateInterface : public UInterface
{
    GENERATED_UINTERFACE_BODY()
};

/**
 * Add this interface to your GameState class to get global notifications for save events.
 */
class RAMASAVESYSTEM_API IRamaSaveGameStateInterface
{
    GENERATED_IINTERFACE_BODY()

public:

    // Called when all actors are fully loaded
    UFUNCTION(Category = "Rama Save System", BlueprintCallable, BlueprintNativeEvent)
    void OnRamaSaveFullyLoaded();

    // Called before actors are saved
    UFUNCTION(Category = "Rama Save System", BlueprintCallable, BlueprintNativeEvent)
    void OnRamaSavePreSave();

    // Called when the specified player is loaded
    UFUNCTION(Category = "Rama Save System", BlueprintCallable, BlueprintNativeEvent)
    void OnRamaSavePlayerLoaded(APlayerController* PC, APawn* Pawn, int32 PlayerIndex);

    // Called before actors are destroyed in preparation for a load
    UFUNCTION(Category = "Rama Save System", BlueprintCallable, BlueprintNativeEvent)
    void OnRamaSavePreLoadDestroy();
};