x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

What is the best way to keep data between levels?

I am working on a game where the player goes through various levels and quests to increase stats, but I can't figure out the best way to keep the data between the levels. It seems strange to me that there isn't some class that is persistent between levels that I can subclass to store data in. Currently I change levels using:

 GetWorld()->ServerTravel(MapToPlay, false, false);

From what I have read so far, the two main options are:

1) Save the entire state of the game between each level, then reload it. This is guaranteed to work but isn't trivial.

2) Someone suggested I put data in the LocalPlayer PlayerController. This seems a bit messy to me, and is it guaranteed to work in all circumstances?

Is there a better way?

Product Version: Not Selected
Tags:
more ▼

asked Jul 06 '14 at 04:22 AM in C++ Programming

avatar image

AusPaco
195 18 122 34

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Config Files

For very small amount of data you can simply save it out to config file and then load it back

https://wiki.unrealengine.com/Config_Files,_Read_%26_Write_to_Config_Files

Binary Save and Load

I have tutorial on how to save any data you want to compressed binary file and then load it back into the game!

https://wiki.unrealengine.com/Save_System,_Read_%26_Write_Any_Data_to_Compressed_Binary_Files

:)

Rama

more ▼

answered Jul 07 '14 at 03:25 AM

avatar image

Rama
10.6k 446 343 1086

avatar image AusPaco Jul 07 '14 at 07:30 AM

Thanks Rama, your tutorial is exactly what I'm using for loading/saving :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question