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. 

Best method to stream procedural levels?

I'm working on a game that takes place in a procedurally generated city (mostly). I have fairly detailed map chunks consisting of blocks that consist of buildings, all of which are procedural. I had some success with using blueprints to stream the levels, but there were issues with loading multiple maps at once (like, it wouldn't, only one of the two maps would actually load or become visible). So I tried using World Composition, which seems a bit easier to set up, but the load times are awful. I'm averaging between 5-10 seconds per level when transitioning, double that if multiple levels have to be loaded at once. For reference, my levels are **EDIT: 42,000* units across and consist of 4 procedurally generated city blocks with streets in between.

The geometry is not extremely detailed, but each building has an interior with some furniture. I'm using material instances for the big things (building sections, streets), but many of the props are from packs I purchased so those haven't been converted fully. Every static mesh has a maximum draw distance set (between 10k and 50k, my maps are foggy), and my entire game is made of static meshes, no actual terrain.

Is there anything I should be looking at to try figure out why I can't get a large seamless world? Failing that, is there a way to preload the game world before the game starts? I imagine that would help with level transitions. Would it be better to generate the whole map on the fly as it's uncovered, only building things the player can see?

I'm really at a loss here, especially since I want to make sure I can get the level streaming working properly before adding things like AI, items, and actual gameplay.

Product Version: UE 4.18
Tags:
more ▼

asked Dec 20 '17 at 08:43 AM in Using UE4

avatar image

Axebeard
5 7 6 10

avatar image Ego Studio Dec 20 '17 at 10:57 AM

When only one of the two become visible, did you properly add the 2 maps into a clean "Persistent Level" and make them both visible ?

avatar image Axebeard Dec 20 '17 at 11:27 AM

Yeah, what happened was I had a grid of levels set up around my persistent level. Each level had a spawning volume that was larger than it, and would load and unload the level when the player was far enough away that they couldn't see it. Because these were all squares of the same exact size, there were areas where multiple volumes overlapped. I had the trigger volumes print a message that their child level was spawned as well, so when the player walked into areas where they overlapped, it would say both levels were loaded, but only one would become visible.

avatar image Axebeard Dec 21 '17 at 12:46 AM

I'm starting to think the whole problem is that I'm generating the levels on the fly. Is there a way I could generate them ahead of time? I think that would make the transitions much smoother.

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

1 answer: sort voted first

Possible issue on your setup : verify that "Make Visible After Load" is correctly checked when loading level. Else you have the node "Should Be Visible" (Level Streaming). Also verify that you have a strong reference to each "Box Spawner" (I don't know if GetAllActorsOfClass is a good idea). Another thing is, I think when you unload level, you should load it again when you want it to be visible.

more ▼

answered Dec 20 '17 at 03:10 PM

avatar image

Ego Studio
606 4 4 5

avatar image Axebeard Dec 20 '17 at 10:22 PM

I just remade the entire Blueprint from scratch, and it does work now. It will load multiple levels at one time, it's just very slow.

avatar image Ego Studio Dec 21 '17 at 08:22 AM

I think the better way is to load everything during loading time and just play with "Should Be Visible" on runtime. Unloading maps during gameplay may not be recommended if you want it back again.

avatar image Axebeard Dec 21 '17 at 08:42 AM

I'll give that a shot. I also tried merging my maps into one big one, which gave me steadier performance, but I'm not thrilled with the framerate (35-45 FPS mostly).

avatar image Axebeard Dec 21 '17 at 09:02 AM

That didn't work at all, dropped me to 0.1 FPS. I loaded all the levels at EventBeginPlay, and then just set the visibility to be triggered by the spawning volume.

avatar image Ego Studio Dec 22 '17 at 04:59 PM

Your previous solution might be the best, 35+ FPS is fine. I even run some project without scenery (only code and cubes) at 30 FPS.

avatar image Axebeard Dec 22 '17 at 08:56 PM

That's what I'm working with for now, but I would still like to get the map larger and with no load time between them, guess it's just not really possible?

(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