Search Unity

[RELEASED] SECTR STREAM: Seamless Scene Streaming

Discussion in 'Assets and Asset Store' started by MakeCodeNow, Feb 21, 2014.

  1. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    How does the lightmap ref work, i have made a test scene with 3 chunks that area streamed, and i cant find it on anything after i hit play and load a few chunks wit the region loader.
     
  2. Uli_Okm

    Uli_Okm

    Joined:
    Jul 10, 2012
    Posts:
    95
    Hi, is it possible to make custom terrain material/shaders work after splitting the terrain?
     
  3. passerbycmc

    passerbycmc

    Joined:
    Feb 12, 2015
    Posts:
    1,741
    Are you planning on changing sectr stream to use the Application.UnloadScene in the future, or sticking with just destroying the chunk gameobject?
     
  4. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    My main scene is 12mb. After exporting chunks, if I then import those chunks, it grows to 75mb and is very slow and crashy. So I'm having to make a backup, then trash the exported/imported scene and all those folders and switch to the backup. Each time. Am I doing something wrong?
     
  5. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Also: SECTR Stream was working quite nicely for me until yesterday. I don't know what happened, but now it massively slows down the scene at runtime and at chunk boundaries. See screenshots, though once I'm moving around in the scene, often when I cross a portal or chunk boundary, the Editor hangs for 10-20 seconds, though often there's no spikes in the profiler. On iPad Air, it used to work quite smoothly, with just a brief pause when loading chunks, but now it's slow and then crashes the app after a little while. Memory usage on both Editor and device are what they should be (about 220mb on iPad and 500mb in the Editor), so it's not a memory issue. I tried running a scene with all chunks in the scene, not exported, and it runs fine in the Edtior, so it seems that SECTR is messed up, but I sure can't figure out how.

    I have tried removing all changes I made since Monday, to no avail. Any idea what I could look for to resolve the problem? It's driving me crazy (and sucking up hours of time).

    EDIT: I finally figured this out. I had added about 16 unity quad primitives into the various sectors, to extend them so the bounds overlapped, and somehow those drove the SECTR streaming code crazy at runtime. That also seems to have caused the scene size inflation when reimporting the chunks. I fixed the problem by swapping in actual meshes from the project in for all those quads, and the problem was solved! Weird.
     

    Attached Files:

    Last edited: Aug 28, 2015
  6. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    SECTR 1.2.1 is now live on the asset store. Includes mutli-scene lightmap baking and streaming in Unity 5.2 (plus a number of bug fixes).
     
  7. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Sorry for the very slow reply. For some reason I stopped getting notifications about posts to this thread.

    Are you using Unity 4 or Unity 5? In Unity 4 it basically manages the references between the sub-scenes and the master lightmap array. In Unity 5 it's vestigial because they changed all of that logic after the Enlighten integration.
     
  8. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Technically, yes. After splitting, you just have multiple terrain objects rather than one and you can apply whatever you want to them. If you mean "can the splitting preserve custom terrain materials/shaders" the answer is no, as plugins are free to do all sorts of non-standard things.
     
  9. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yes. I actually just made that change in SECTR 1.2.1 in order to properly support lightmap streaming in Unity 5.2.
     
  10. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Great! Can you quickly explain what is new with lightnaps and what was happening before this?
    -Does it just mean ot supports baking all levels at once? Or is it streaming related?
    - Is this about realtime lightmapping or baked? Ive been baking my light maps a level at a time, and setting auto lighting. On export it seems to bake the chunks..was that not working?
    Or are my questions not relevant until unity 5.2?

    Thanks
     
  11. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Basically Unity broke lightmap streaming when they switched to enlighten in 5. In 5.2 they added some new features that unbreak it, at least for products like SECTR. There latest version of SECTR takes advantage of those new features, so if you don't have 5.2 yet it won't matter to you.

    The new baking api allows for multiple scenes to be baked as if they were one and, once baked this way, can support lightmap streaming. SECTR exposes this by adding a new button to the stream window that lets you bake all subscenes together or one at a time.
     
  12. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Great, thanks for the info! I assume you are using a beta of 5.2? the latest patch is 5.1.3.
    Anyway, sounds great and thanks again.
     
  13. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yes. The beta is actually very nearly over. I wanted to get this update out so that it was ready for devs as soon as 5.2 was released.
     
  14. DrewMedina

    DrewMedina

    Joined:
    Apr 1, 2013
    Posts:
    418
    Excellent! Thank you so much for that, looking forward to it!
     
  15. ron-bohn

    ron-bohn

    Joined:
    Oct 5, 2015
    Posts:
    305
    I have a city scene(s) with over 1,000 NPC pedestrians walking around. With my current testing scene, I can have about 50 npc's walking around and stay above 60 fps at maximum quality settings. Basically, I don't want the city buildings and other lower poly game objects to load or unload because I need the buildings visable from a distance. I was wondering if I could use Sectr Stream to load and unload my animated humanoid NPC game objects (ie pedestrians walking around), but keep the whole city buildings and other non humanoid game objects intact. I'm considering starting fresh based with your complete bundle.
     
  16. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    SECTR can be made to work that way, yes. But you might want to try what most open world games do, namely spawn NPCs within a bubble around the player and despawn them when they get outside the bubble.

    Also, as far as the distant buildings go, SECTR support a proxy feature where you can have a low resolution version of a sector that's always in memory but only visible when the sector us unloaded. That way you can have a city that appears always there even when the detailed versions are mostly unloaded.
     
    julianr likes this.
  17. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    hi,looks promising,I would like to know if it is viable solution for racing game tracks? We are building racing game for android and iOS where race tracks are not round i.e., start and end points do not meet so its very large tracks
     
  18. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yeah. It should work great for that kind of game. You'll just need to design your tracks and sightlines with streaming in mind, but that shouldn't be hard for this kind of reaching game.
     
    idurvesh likes this.
  19. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Thanks for replay.Currently I do not have need for streaming assets, though I now know where to look if ever we need it .
     
  20. bome99

    bome99

    Joined:
    Sep 14, 2009
    Posts:
    119
    Hi

    I'm using the streaming tool to stream chunks of terrain. 4 by 4 the chunks are 250x250.
    I'm using unity pro 5 1.2.f1. Evertime a new chunk loads I get a frame drop to about 4 fps from 40-50 fps. This happens in editor and in build.
    Is there a way to check if the system is using async loading?
    How does the async work do I need to setup something in build settings?
    Would it help to cut the terrain into smaller chunks?

    Cheers
    Bo
     
  21. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Hmmm. What version of SECTR are you using? There was a bug in an older version where non-Pro 5.x users wouldn't get async loading.

    Also, do you instantiate a lot of your own objects in these terrain chunks? If you have scripts that execute a lot of code in Start/Awake/OnEnable then that all happens on the main thread at once and there is nothing SECTR can do about it.

    If none of this rings a bell, please post a screenshot of the profile with a slow frame selected.
     
  22. bome99

    bome99

    Joined:
    Sep 14, 2009
    Posts:
    119
    Thanks for the answer I'm using SECTR Complete 1.2.1a.
    No I only have art assets and terrain chunks in the sectors.
    Hmm ok, I think I'm gonner try using sectors for art assest only and not terrain instead.
     
  23. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Hi, we started working with stream.The one thing I noticed that when sectr trigger getting triggered it was causing 1000+ ms....After deep profiling come to realize that "Build Report Tool" asset too calling its Report Genrated script at same time...so to run Stream we have to uninstall build and vice varsa ...Now scene is causing 50+ ms....any suggestions on how to reduce more ms?
     
  24. odival

    odival

    Joined:
    Jun 11, 2014
    Posts:
    57
    I know that SECTR Stream couldn't recenter the world originally, to avoid precision floating bugs if player walks too far away from the origin. Has this changed in latest versions? If not, is there any plans to do so someday?
     
    Visual_Lies likes this.
  25. SpectralEdge

    SpectralEdge

    Joined:
    Sep 17, 2012
    Posts:
    33
    Having an issue after upgrading to the most recent version of unity, it seems to be forcing the scenes to unload every time sectr loads one. Do you have any plans to fix it / what can I do?
     
  26. UltraTM

    UltraTM

    Joined:
    Dec 8, 2013
    Posts:
    221
    Have a problem after cutting the 3000x3000x600 Terrain the splits doesnt fit exactly together.

    see here:

    Also tested and saw that its working the streaming. But have almost the same FPS level on an streamed terrain oder the full terrain. What did i wrong? 1/3 of the terrain is loaded on the test position instead of 100% but still the same performance. Does the streamer itself uses much performance?
     
    Last edited: Jan 6, 2016
  27. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Sorry for the very late reply. If you still want to try to load terrain chunks in SECTR, please feel free to send a screenshot of the profiler with a slow frame selected.
     
  28. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Are you talking about 50ms of total frame time or 50ms when a new chunk loads in? In general, make sure you profile in a standalone build as the performance is much better there than in editor.
     
  29. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Hi. That is still a limitation and there are no plans to add that feature. The problem is that world recentering incurs a major performance hit due to the way Unity manages static collisions. Until they address that (which doesn't seem to be likely any time soon) SECTR will not support recentering.
     
    odival likes this.
  30. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    I don't see this issue with my demos, so can you supply some more information? Are you talking about scenes being unloaded in the editor or in the game? Are you doing your own scene management in addition to SECTR? Also, I just released a new version of SECTR that uses the new scene management APIs in 5.3. Theoretically this should have no impact on anything but maybe it'll fix your issue?
     
  31. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    What version of SECTR are you using? There were some seam issues in older versions but AFAIK they have been fixed for a while.

    Regarding performance, you'd need to look at the profiler. SECTR STREAM is meant primarily to save memory, though it often is faster to simply not load large chunks of the world. If having big chunks of the world isn't helping your framerate, then most likely the bottleneck is somewhere else. You'd need to use the profiler to figure out where.
     
  32. UltraTM

    UltraTM

    Joined:
    Dec 8, 2013
    Posts:
    221
    Hi im using the newest SECTR Complete pack and have that tiling issue
     
  33. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Hmm. I'm not sure that's something I'll be able to fix. What I would recommend is that rather than splitting a big terrain into smaller ones using SECTR, use Terrain Composer to make a grid of terrains. SECTR is terrain composer aware, so you can use the Terrain Tool to create the Sectors from the Terrain Composer grid, but you get all of Terrain Composer's powerful features for creating the base terrain itself.
     
  34. nickfourtimes

    nickfourtimes

    Joined:
    Oct 13, 2010
    Posts:
    219
    How has the upgrade to Unity 5.3 affected Streaming? I feel like the new SceneManager class affects the way scenes are loaded/deleted, so is there the need and/or a plan to update SECTR Streaming accordingly?
     
  35. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    The latest SECTR supports the new API, but nothing changes functionally.
     
    nickfourtimes likes this.
  36. Sorry, I don't want to spite you, but are you sure about that? Have you measured this lately?
    I'm asking this because I've read two different sources that moving the static colliders are not a big overhead anymore.
    Here: http://blogs.unity3d.com/2014/11/19/porting-to-unity-5-the-untold-rust-journey/
    Here: http://blogs.unity3d.com/2014/07/08/high-performance-physics-in-unity-5/

    On the other hand, if you build a really big world (I mean really big: 10000+units), you will experience some issues with the physics engine (float imprecision).
     
  37. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Thanks for the info. I didn't realize unity had addressed those issues. Still not sure if/when SECTR will get recentering. It's a pretty big add, and requires very careful integration with the game scripts that usually also need to know when the whole world shifts.
     
  38. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Good afternoon. I use Stream. I can not find documentation for how to bake the map with your Asset . Throw a link to it . If not her , then write procedures for baking card with all the nuances . Chunks I go along with pieces of card.
     
  39. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Another question. There Pixel Error function . It is very positive impact on game performance when exposed to 30 or higher. But when I did the exhibition formed gap between the parts of the map . They disappear when the player comes very close to him . How can I do to use this function and do not have these gaps . ? so for example , they disappear when the player is away from the edge of the map
     

    Attached Files:

  40. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    I have a problem. After fixing the red squares . I'm with the sectors that something strange is happening . I wrote to you in the mail, but the answer and there is still no - ( ( .Mne had to restore a backup copy of all project fixed a hierarchy , but now I have come chunks cards that previously never nebylo now spawn when the player with the . . . handler Region Loader, the pieces of the map are not loaded and displayed in the hierarchy . How to fix this? error in the console no . and also in a profile displaying strong jumps !
     

    Attached Files:

  41. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    All of the docs are in SECTR/Docs, including a quick start and a manual for Stream. There is also a video version of the quick start on sectr.co/stream.
     
  42. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    How did you split your terrain? Did you do it using the SECTR Terrain window or something else? If you split it yourself or changed the Pixel Error value after splitting, all of the terrains need to have the same pixel value, otherwise you can get gaps like this.
     
  43. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Hi. It's not clear from your email and those screenshots what went wrong. There are no SECTR errors in either screen shot. The only thing that I notice is that in the first screen shot there are a bunch of unloaded levels from the MSE, which shouldn't ever happen. Did you use the revert feature from 1.2.2? If so, there is a fix in 1.2.2a.

    In general, I recommend that you take it slow when applying SECTR for the first time to a large project. Also, take advantage of the option to save a backup when you export for streaming. This ensures no data is lost even if something goes wrong.
     
  44. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    You have not answered what to do right now . How to solve this problem. You can go on Skype chvecherom tomorrow , I will show through the display of the desktop . I like that it is necessary for life to return . )
     
  45. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    If you want direct support please email support@makecodenow.com and include a copy of your invoice. We'll go from there.
     
  46. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    Hello!
    I have been playing around with Sector Complete, and have been testing it on a large terrain.
    I am currently using the Region Loader to load in the terrain chunks, however, when Sector loads in a chunk with a good bit of terrain, trees, and grass on it, I get a lag spike.

    Is there something I can do to prevent these lag spikes from happening?
     
  47. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    I tried a build of the project, and there are no lag spikes.
     
    hopeful and BackwoodsGaming like this.
  48. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yes. That's common. Unity streaming is not fully optimized in the editor.
     
    BackwoodsGaming likes this.
  49. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Hi! I have a couple of questions.

    Does the terrain need to be cut into equal squares to use Sectr Stream? Is this only required for using chunks (regions)? I would like to use irregular pieces of terrain, such as thin areas a player would walk through to arrive at a larger area. If I do this, can I cut up the terrain myself making sure seams are correct?

    If I have sections of a city that are not square, can I still use Sectr with the non-square sections? In this case, I imagine they would work more like the rooms you show in the example.
     
  50. TonanBora

    TonanBora

    Joined:
    Feb 4, 2013
    Posts:
    493
    I have another issue though.
    Some times, the player will fall through the terrain when the level first loads due to the terrain not being fully loaded.
    Is there a way for me to check that the chunk the player occupies has been fully loaded into the scene?
    I could use raycasts, but I would prefer to limit the number of raycasts that I use.
     
    hopeful likes this.