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"

How does open-world games save maps?

I know how to save variables and stuff. What I'm wondering is, how to save maps as a whole? If you try to save the whole map as variables, it goes amazingly long. Does anyone know or have experience in this?

Product Version: UE 4.19
Tags:
more ▼

asked May 15 '18 at 12:38 AM in Blueprint Scripting

avatar image

w0hoho
127 24 28 37

avatar image mightyenigma May 16 '18 at 10:50 PM

Why do you want to save the whole map? Do you mean saving all the geometry and terrain and the skysphere and literally EVERYTHING? Or do you just mean things like items, characters, etc.?

avatar image w0hoho May 16 '18 at 10:59 PM

It's open world, right? So there are a lot places. When a player solves a puzzle; for example opens lots of lights or moves things, when the player dies, I want to bring back all of those as they were. If I do it with variables, the list would be too long.

avatar image mightyenigma May 16 '18 at 11:28 PM

Hmm. I'm not sure how to approach that, but I would try to make every actor responsible for saving itself or feeding its save information into a master save manager object. Then you don't have to make a list, you just fire off an event that all savable objects implement the interface for, and then they all send their save info to the manager (or save it themselves) and you're done.

Likewise for loading, although this brings up the problem where what if the object was spawned or destroyed and that fact is what needs to be saved and restored? Not sure. Mathew Wadstein has a tutorial on saving objects and map changes that doesn't involve building lists though, I think.

avatar image w0hoho May 16 '18 at 11:33 PM

Yes that's where it all gets confusing. I'm sure there is a system to save all map as it is.

avatar image mightyenigma May 16 '18 at 11:40 PM

If there is, I don't know about it. That seems like a lot of data to save when you're only going to use some of it.

avatar image w0hoho Jun 24 '18 at 07:49 PM

Does anyone know?

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

1 answer: sort voted first

The correct way way to handle open worlds is with these techniques/systems.


World Composition Used to create a large landscape out of individual height map tiles.

https://docs.unrealengine.com/en-us/Engine/LevelStreaming/WorldBrowser

https://www.youtube.com/watch?v=FrcNClb6KUI


Level Streaming Used to load/unload components of levels as you enter/leave streaming volumes.

https://docs.unrealengine.com/en-us/Engine/LevelStreaming

https://www.youtube.com/watch?v=GkDg9GPpzXE


Instantiation Independent levels used for sections of the game where the rest of the game is no longer visible and there is no reason to have it in memory. (IE The inside of a building, typically games like Skyrim, The Witcher, MMO's, etc. do this for large buildings and dungeons because it significantly reduces the amount of unnecessary detail in the Open World.) There isn't really anything you need to know about this, just "Open Level."


There is sufficient information about all these subjects at the provided links.

more ▼

answered Jun 24 '18 at 08:52 PM

avatar image

enearle
210 4 4 6

avatar image enearle Jun 24 '18 at 09:00 PM

World composition will have a main level where persistent information between tiles will be stored, and yes you have to store all information in the game instance or save game class, you cant just expect it to store this information for you. Otherwise you would be rewriting the level every time you played the game.

avatar image w0hoho Jun 24 '18 at 09:07 PM

So, you solved a complicated puzzle and quit the game. When you re-open it, you check if the puzzle's done before and if so, bring it to solved phase in the event begin play; is this how everything is done in open world games?

avatar image enearle Jun 24 '18 at 09:42 PM

Yeah, you can look into serialization, but in most games its optimal just to remember a handful of variables. When you're in a load screen of a game this is what it's doing, it's cycling through arrays opening/closing locking/unlocking doors after it loads the default world. In procedurally generated worlds it will just load an empty world and build the surrounding area entirely in the load screen.

If your world has as many variables as something like minecraft you make arrays of arrays(chunks) so you aren't constantly checking through the entire world for information about the specific area you are in. You will need to incorporate efficient algorithmic design. Creating regional arrays. (IE: an Integer array for quests progress or door status in one area of your game.)

Just like you don't know what the weather on the opposite side of the planet is, you will likely not need to load everything about the entire world at once. That's where learning about the things I posted in my answer will help you significantly.

avatar image w0hoho Jun 24 '18 at 09:46 PM

Thank you for your detailed answer. It helps a lot.

avatar image enearle Jun 24 '18 at 09:06 PM

Short cuts you could use is have an actor/class type for quests/puzzles with a variable of its completion/progress inside the class. Then when you want to save the game or enter the level you can use foreachloop with get all actors of class and store these variables in an array associated withe the level in your game instance or save game class.

avatar image enearle Jun 24 '18 at 09:14 PM

Open worlds are large filled with millions of variables. The easiest way to do what you want to do is categorically go through things with a foreachloop + get all actors of class when you enter a level and have them cast to the game instance to update their current status manually in real time.

avatar image w0hoho Jun 24 '18 at 09:19 PM

Thank you for your answer, appreciate it.

(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