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"

Save a whole level in Blueprints

Hey there, I am currently working on an Open World Game where you can move objects, build houses, dig holes, etc. To keep it short: How do I save the whole Level in Blueprints? I know there are a lot of tutorials out there that teach you how to save variables, but I want to save the level with everything in it. The best example for this is Minecraft. How do I save a level like you do in Minecraft? Sorry for my bad English. Thank you in advance!

Product Version: UE 4.15
Tags:
more ▼

asked May 24 '17 at 10:15 AM in Using UE4

avatar image

MatTheTat
6 1 2 2

avatar image leofucci Jul 11 '17 at 12:25 PM

Did you figure out how to do this? I just realized that I created a post with exactly the same example :( still no clue.

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

2 answers: sort voted first

Conceptually, what you need to do is save the state of all your movable actors when the player exits and restore it when you load a saved game.

I don't think it can be done in Blueprint but there is this wiki page that goes over the principles behind doing it in C++.

more ▼

answered Jul 11 '17 at 01:21 PM

avatar image

jeancf
49 2 5 7

avatar image MatTheTat Sep 19 '17 at 03:27 PM

Thank you for your answer, but if i understood the article you still have to save every single actor individually. Do you hav a idea how I could automate this?

avatar image samnater Sep 19 '17 at 04:23 PM

It may be possible in blueprints, though, I haven't tried this kind of saving in either C++ or blueprints. Jeancf is right in the sense that you have to at least save every movable actors location and a reference to what that actor is (house, player, grass block etc.). The best way to approach that is creating an array for all the movable actors, and an array for all their locations. That means you need to get references of all those actors either when they are created or using GetAllActorsOfClass.

Looking at how minecraft does it. Minecraft worlds are separted into chunks: 16 blocks wide, 16 blocks long, and 256 blocks high, which is 65,536 blocks total. Each block has a location value in that chunk and a description value that describes what kind of block it is. i.e. 1:1:1:1:1 may correspond to block at location Chunk 1, x coordinate 1, y coordinate 1, z coordinate 1, and block type Bedrock. 50:25:25:25:3 may, similarly, correspond to a block in chunk 50, x coordinate 25, y coordinate 25, z coordinate 25, and block type Redstone.

Chunks are created, loaded, saved, and unloaded depending on where the player currently is in the world. Not sure the exact render distance, but there is a built-in limit on how many Chunks away are loaded/created and how many you can see.

I would mess around with saving+loading arrays of actors and their locations.

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

I found a tutorial on how to add the location, rotation, and scale of all the actors of your class and add it to a transform array variable which can be saved to your computer. Here's the link: https://www.youtube.com/watch?v=MLqypbTyZG8

more ▼

answered Jan 30 '18 at 08:41 AM

avatar image

erki120
1

(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