Can you export a Save Game to use in a packaged build?

I am building a feature in-game which is using save game information that I myself am creating by playing (I am recording my own gameplay and player movements, and am giving them to AI to playback in-game).

This information is stored in arrays of vectors and floats in a Save Game – how can I either a) ship this file to players in the packaged build of the game, or b) export it to another form, and then access that in my blueprints and ship that?

Thanks!

Edit: There are two solutions! See the marked solution, and also the Runtime Data Table plugin linked below. Both should do the job.

Create an editor mode, create a new actor and place it in the scene, create a new variable in the actor, make the variable consistent with the data in the game archive, and set the variable to editable, load your game archive in the constructor, and change the actor The variables in are set to the variables of the game archive.

From this, this actor records a game save. You only need to let AI read this game save and generate its camp when running the game.

Assuming I understand you correctly, this isn’t what I am asking.

I know how to load a save game file and use its information to set variables on an actor.

My question is how can I get the information contained in those save files across to a client who is playing my game?

The save files are created within the editor on my personal computer.

If you are developing a multiplayer game, the host will generate the game actor after loading the archive. If the actor turns on replication, the actor will be created on the client.

  1. Load the game on your computer
  2. savegame spawn actor
  3. Due to network synchronization, the actor will be copied to the client

So the client can see all game content

If your save game system runs on the client, rather than only on the server (usually the save game system will be designed to only allow the server to run, but you can modify it to run on any client)

Then at this time the client runs the save game function, obtains the objects in the scene and serializes them into game archives, so the client obtains the archive data

I don’t know if my answer solves your problem. I look forward to your reply.

No this isn’t the problem.

The question is that the save game on the server itself won’t be within the game files when I distribute my game.

Players are locally hosting games, but I need to include some saved information from my personal PC inside the project files.

I’m afraid you won’t find the answer. Save game files are outside game files. You need to think of using Structures and Datatables instead and load this data within the level load or game start.
The save file is simply not the format you need. Datatables and Structures are more relevant in your case.
Again if I understand your request correctly.

BR

Let me restate your requirements, I hope I understand correctly

You released your game, but players can only create new game saves and start everything from scratch.

Now you want players to be able to open your second-hand game save (for example, you created a game save before releasing the game, built a lot of buildings in the game, and the game progress has reached 50%). You hope that after your game is released, players Load the game to get the game progress you provided instead of starting from scratch

Is my understanding correct?

If you hope that’s the case, I think it’s the same as my first reply:

  1. You need to create a new actor class
  2. Prepare a level and place the actor in the scene
  3. Create the same variable as savegameobject in the actor class and set it to editable
  4. Read the game in the constructor
  5. Set the variables in the read savegameobject to the actor

When the player opens this level, the game is not read from the player’s computer hard drive, but the actor data in the level is read and game objects (such as some already built buildings) are generated so that the player can obtain your game progress.

I am also currently developing an online game. This is the solution I once imagined (how to let players read a second-hand archive that has been played by the developer). I hope it will be helpful to you. If my understanding is still wrong, you may be able to give me an example. Examples make it easier for me to understand. For example, which currently released games meet your needs and introduce them.

Yes I believe you understand me.
My question then is, how can I record information at runtime and write it to a data table or similar when can then be shipped with the project?
The information doesn’t NEED to be in a save game; that’s just the only place I know of where I can write blueprint variables in a place where they can be kept across game instances.
Any other ideas?

Prairie I appreciate your time, but the issue is that, as far as I know, a save game cannot be distributed with a shipping project. I could use your method if I were able to simply manually type in instanced editable variables, but I am recording too much information for this to be possible. I need a place to save it at runtime within my editor, and then export that information into a format which can then be read in-game by players.

So the datatables are read only. So I would write the outputs in the log, and then transfer it to the datatables.
Or I just googled this add-on or asset that should work for you.

1 Like

Or you can write to the file and read from the file but this will require C++ coding.

It’s true that release builds can’t include archive files, but my plan doesn’t need to include archive files in release builds, it just needs to set the variables in the actor to editable, and read the game when the constructor executes, and set, this actor In the level, it has complete archive data, which can be provided to players with the release of the project

Of course, this step does require you to spend time matching the savegameobject variables with the actor variables one-to-one before you can transfer the data to the actor.

But if your data is very large, this connection process does take a long time, but once the connection is established, you can create your second-hand game progress at will.

To put it simply, you need to provide some custom data to the player. I would create a new level, place an actor in it, and fill in the actor with the data you want to pass to the player.

Not sure if SaveGame is gonna be compatible across both versions due to differences in the serialization process with and without EDITORONLY_DATA. However I would still recommend to try it for yourself with a simple test case. If they happen to be compatible, then it’s just a matter of including the savegame file in the shipping build which shouldn’t be too difficult.


There might be a simpler way though. Is there a specific reason you want a savegame ?
I understand you want to record data during PIE, and then save & ship that data.
So I assume you made a savegame object with a bunch of variables/structs, you fill it in PIE, then call SaveGameToSlot.
Replace your savegame object with an Actor class. Place the actor in the level. Record your PIE data into the actor. Once you are done, pause the simulation, select the live actor, and run the “apply instance changes to blueprint” function. This should transfer all the recorded data into the blueprint defaults :

image

Then in your shipped game you can just load that actor CDO or spawn it to access the data.

1 Like

Yes sounds like it could do the trick, thanks! Very creative solution.

– Jackson

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.