Search Unity

[RELEASED] SECTR STREAM: Seamless Scene Streaming

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

  1. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    I have a racing game with big map. Can this work on racing games. I will have to make all the chunks which has car activated so is this possible with this??
     
  2. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    I see. Portal Determined matters most for games with interiors. The default behavior is that a Member is in whatever Sector(s) it overlaps. Portal Determined means that your Sector memberships only change when you walk through a portal.
     
    helgarddebarros likes this.
  3. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    Hi,

    how would I load a sectr from script, can you paste example code?
     
  4. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Code (CSharp):
    1. someSector.GetComponent<SECTR_Chunk>().AddReference()
    You can look at any one of the Loader subclasses for more detailed examples.
     
  5. Wikzo-DK

    Wikzo-DK

    Joined:
    Sep 6, 2012
    Posts:
    83
    Adding to the above question:

    We have a big hub world with various sectors chunks (using loading doors). I would like to make a button to teleport to the main hub.

    To do this, we need to unload ALL sectors, then teleport the player (using a fixed Transform/position) and then load the hub sector.

    What way would be the easiest to do this? Is there a way to unload all sectors? RemoveReference() only removes a single reference, but how can I make sure all are removed?
     
  6. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    You basically want to disable all of the loaders. They will in turn release their chunk references correctly, which should zero out the reference count on the chunks and unload things.
     
  7. Wikzo-DK

    Wikzo-DK

    Joined:
    Sep 6, 2012
    Posts:
    83
    Thanks!

    I have a new question about the hibernators:

    Is it possible to have objects with hibernators+sectr_member that are part of a chunk and NOT global? E.g., we have an object that is part of a chunk, but it is possible to take this object and move it out of the chunk and place it in a different chunk. If this chunk is unloaded, we want the object to hibernate.

    As far as I can see in the NeighborStream example, your Wanderer NPC is always global. If I place it inside a chunk and then load this chunk, the hibernator does not work.
     
  8. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    I believe you can move an object from one chunk to another if you unparent the object and then call SceneManager.MoveGameObjectToScene().

    Hibernating is orthogonal to this. If the GameObject exists, it'll hibernate if it's in an inactive part of the map and be active otherwise.
     
  9. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Loving SECTR Stream right now - it has certainly improved the performance on my open world game - thanks for your continued development of this asset + CORE.
     
    Flurgle likes this.
  10. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    My pleasure!

    BTW - I saw that you posted a few issues on this thread but removed them. I assume everything is going ok?
     
  11. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Yes, I resolved them thanks. I had an issue with the Neighbor loader on my character falling through the terrain when I placed it on the parent, it worked when I placed it as a child object. The other issue was my stupidity late at night .. I preloaded the scenes from a script, didn't realise that I had the chunk preloaded also, so the radius loader didn't work on a build, when it did in the editor lol
     
  12. davidjefferies

    davidjefferies

    Joined:
    Nov 27, 2012
    Posts:
    16
    I've got an issue with SECTR Stream that is causing my game to crash intermittently. I subscribe to the LoadingComplete delegate and which is intended to be called after the chunk has loaded and before Update is called on its children. LoadingComplete is called from FixedUpdate and the problem is that FixedUpdate is not guaranteed to run each frame - it only runs if the time since the last frame is more than the Fixed Timestep. I have a situation where it sometimes doesn't run the frame after a chunk is loaded because it has run several times the frame before to make up for the time lost while Unity integrates all the new objects into the scene. This causes the Update to run before the LoadingComplete delegate fires which causes my game to crash.
     
  13. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Hmm, that is a flaw in the system for sure. Have you tried changing that from FixedUpdate to Update or LateUpdate? Either of those should work. I was using FixedUpdate just to try to ensure it ran before all of the regular script logic.
     
  14. davidjefferies

    davidjefferies

    Joined:
    Nov 27, 2012
    Posts:
    16
    We can move it to one of our custom update functions that runs before the regular updates so that's OK for us. It's just annoying that Unity doesn't have a way of doing that for the general case.
     
  15. Wikzo-DK

    Wikzo-DK

    Joined:
    Sep 6, 2012
    Posts:
    83
    I am having problems with the Hibernator. I have an object with a rigidbody which should enable/disable itself when a sector chunk is loaded. The sector is a bit heavy, which makes it take a little while to load (using trigger loading door). It seems like the hibernator enables itself BEFORE the sector is fully loaded, which makes the object fall down (due to the rigidbody) and fall out of the sector bounds. The object should enable itself before the whole chunk has been loaded.

    Looking at the code, it seems like the hibernator doesn't take into consideration if the sector is loaded or not.

    Isn't there an event to look for whenever a chunk has been FULLY loaded?

    Code (CSharp):
    1.  
    2. SECTR_Hibernator.cs
    3. void _ChunkChanged(SECTR_Chunk source, bool loaded)
    4.     {
    5.         if(loaded)
    6.         {
    7.             ++numLoadedSectors;
    8.             Debug.Log("Chunk loaded: " + source + source.IsLoaded());
    9.  
    10.         }
    11.         else
    12.         {
    13.             --numLoadedSectors;
    14.             Debug.Log("Chunk unloaded: " + source + !source.IsLoaded());
    15.  
    16.         }
    17.  
    18.         _HibernationChanged();
    19.     }
    Line 7 ++numLoadedSectors is called even when source.IsLoaded() prints out FALSE. Shouldn't it wait and only activate WHEN the sector has been fully loaded?

    Update: I am not sure if this is a good idea, but I added the following callback event in SECTR_Chunk (see lines 17+15 and 50+51):

    Code (CSharp):
    1.  
    2. SECTR_Chunk.cs
    3. public event LoadCallback ChunkFullyLoaded;
    4.  
    5. public void RemoveReference()
    6.     {
    7.         if (ReferenceChange != null)
    8.         {
    9.             ReferenceChange(this, false);
    10.         }
    11.         --refCount;
    12.         if (refCount <= 0)
    13.         {
    14.             if (Changed != null)
    15.             {
    16.                 Changed(this, false);
    17.             }
    18.  
    19.             if (ChunkFullyLoaded != null)
    20.                 ChunkFullyLoaded(this, false);
    21.  
    22.             _Unload();
    23.             // Guard against underflows.
    24.             refCount = 0;
    25.         }
    26.     }
    27.  
    28.  
    29. void FixedUpdate()
    30.     {
    31.         switch (loadState)
    32.         {
    33.             case LoadState.Loading:
    34.                 _TrySceneActivation();
    35.                 if (asyncLoadOp == null || asyncLoadOp.isDone)
    36.                 {
    37.                     if (asyncLoadOp != null)
    38.                     {
    39.                         chunkActivating = null;
    40.                         activationQueue.RemoveFirst();
    41.                         asyncLoadOp = null;
    42.                     }
    43.                     loadState = LoadState.Loaded;
    44.                     // Run update again to try to parent the chunk right away.
    45.                     FixedUpdate();
    46.                 }
    47.                 break;
    48.             case LoadState.Loaded:
    49.                 // Unity takes a frame to create the objects, so fix them up here.
    50.                 _SetupChunk();
    51.  
    52.                 if (ChunkFullyLoaded != null)
    53.                     ChunkFullyLoaded(this, true);
    54.                 break;
    55.             case LoadState.Active:
    56.                 // Do nothing.
    57.                 break;
    58.             case LoadState.Unloading:
    59.                 _TrySceneActivation();
    60.                 _FindChunkRoot();
    61.                 if (chunkRoot)
    62.                 {
    63.                     _DestoryChunk(true, false);
    64.                 }
    65.                 break;
    66.         }
    67.     }
    Additionally, to make sure that the rigidbody doesn't move, I set it to kinematic in SECTR_Hibernator (see lines 10+15):

    Code (CSharp):
    1.  
    2. SECTR_Hibernator.cs
    3. if (HibernateRigidBodies)
    4.         {
    5.             Rigidbody[] bodies = HibernateChildren ? hibernatedObject.GetComponentsInChildren<Rigidbody>() : hibernatedObject.GetComponents<Rigidbody>();
    6.             int numBodies = bodies.Length;
    7.             for (int bodyIndex = 0; bodyIndex < numBodies; ++bodyIndex)
    8.             {
    9.                 Rigidbody body = bodies[bodyIndex];
    10.                 if (hibernating)
    11.                 {
    12.                     body.isKinematic = true;
    13.                     body.Sleep();
    14.                 }
    15.                 else
    16.                 {
    17.                     body.isKinematic = false;
    18.                     body.WakeUp();
    19.                 }
    20.             }
    21.         }
    I would prefer not to change the original code, so if there is a better solution than this "hack", please tell me :)
     
    Last edited: Nov 27, 2017
  16. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Thanks for all the detail. I'm pretty sure this is a legit bug and will try to investigate more tonight.
     
  17. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Ok. I have an official fix. Email support@makecodenow.com and I'll send you the new code.
     
    hopeful likes this.
  18. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I have this issue also, where I tested it on non ProBuilder gameObjects it works like a charm, but with ProBuilder created objects, such as buildings with interiors it doesn't export properly. Now that ProBuilder is free - you may find this being a common issue with Unity projects, - maybe a solution to filter out these scripts or disable them on export, then enable?

    For now I'll create a new gameObject with the sectr stream component on it only. I have a lot of buildings :)
     
    Last edited: Feb 16, 2018
  19. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I didn't have much luck with creating a parent gameobject and adding the Stream/Chunk scripts, so I then stripped out all ProBuilder scripts from the scene. At the moment I'm testing it on one object that has child meshes. It goes to export, but doesn't export it and opens up the asset scene with nothing in it and stays there. I've added a standard cube to the scene with the same scripts and it exports that fine. So it cannot be a script issue. I'll keep trying...

    stream1.jpg
     
  20. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Do you think merging all the meshes on each of the gameobjects would help?

    edit: yep, merging the meshes did the trick, it exported it fine. After I did that.
     
    Last edited: Feb 16, 2018
    hopeful likes this.
  21. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Ok, all issues solved - After further testing I don't think I need to remove the probuilder scripts. I have multiple scenes in my game, which divides each zone. Now the problem was when I exported a building from scene6, it would try and export to the first scene in the hierarchy, when it did, nothing was shown there and would then place some random objects that I did not select to be exported, neither did they have any sectr/chunk scripts. At the moment I'm not sure if I can make scene6 the active scene and try to see if it exports to scene6_chunk_name ( I will test that later). But if I placed that building in the first scene on the hierarchy and exported it, it did it without any issues.

    I also did not need to merge the meshes on the ProBuilder child objects within that building.

    edit: nope. It didn't work if I exported a building from another scene, by making that scene active. Looks like you can only export from the first primary scene in the hierarchy?

    So does that mean Sectr Stream does not support multiple scenes? Maybe it does and I'm doing something wrong. If so I'll place everything in one scene.

    Hope all that was clear ? :)
     
    Last edited: Feb 17, 2018
  22. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Thanks for all of the comments here. In short, SECTR is designed to work with a single master scene and then automatically create and manage the sub-scenes. If you are trying to do your own high level scene management then that may not play nicely with SECTR.

    Regarding ProBuilder now being free, I will look into making that officially supported and compatible with SECTR, but can't promise a specific timeline as both ProBuilder and SECTR are pretty complex :)
     
  23. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Thanks for the clarification. I'll just move everything into one primary scene - they are all under parent game objects anyway, so it's no problem. Prior to moving to 2017.x, 5.6 Unity still had 32 bit processes on a 64 bit build - so when you had a large amount of gameObjects in one scene it would cause memory and screen glitches on a build. But that is all resolved in 2017.x I believe, but using SECTR Stream would resolve the memory issues anyway :)

    For me I don't think the ProBuilder thing is an issue after testing it with the scripts on, under one scene.. but I've not tested it on a full build yet. Just in the editor. It was more down to using multiple scenes.

    Looking forward to using the full capabilities of SECTR
     
    Last edited: Feb 17, 2018
  24. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Hey there,
    This caught my eye a few weeks ago when I decided I wanted to go bigger with my maps when I implemented a mount/riding system. My current plan was to try and have little to no blocked areas or loading if it was possible as I am not exactly sure where I would put them. I guess one area to another could contain a terrain choke point with a gate of some sort, but at the same time, I have been considering adding flying to my game as well, which would kind of negate using that method. I am wanting to add caves / underground areas, as well as places perhaps floating in the sky you can get to using the mounts. Is Sectr something that would be able to help with this type of game, or would I be better off for something that is more suited for this type of setup?

    How well (or at all) does this work with multiplayer? I am making an RPG which was originally just going to be single player, but have been considering adding co-op play for 3-4 people at a time. Would this be able to handle people who were in different areas at different times?

    On a side note, in your experience, what is the best way to go about making large worlds when it comes to management and performance in the editor itself? I would imagine Sectr doesn't actually come into play until the game is actually running, so what is a good way to try and make things easier to deal with when trying to build a large world?

    I am definitely interested if this would be able to handle my scenario, I have yet to actually make a massive map because I didnt want to put a bunch of time into it only to find out I have to go about building it a different way based on what it would take to make it function properly in the end, so I am excited to obtain a solution that will allow me to get building.

    Thanks!
     
  25. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    yes all possible, i use a region loader so it will only stream in what is in a specific range from the player. So going underground will then load that area up if you create an entrance, but you can do this a number of way with door portals. To get under the terrain you could use Microsplat with the alpha paint add-on (which is about $5-10) and add a trigger to drop the player through the terrain.

    In theory, it should work fine as all you are doing is streaming in what you see on single player, the multiplayer side is recording where projectiles are, player position and AI position. The problem is when you have AI on a terrain that you are streaming in, essentially it could fall through the terrain when the terrain is removed from view. So you'd probably need to use the hibernate option on SECTR so once the terrain is streamed in, your AI would then continue (I've yet to try this). Or you could just remove AI from a terrain that is not in use, and respawn them - however if you want to record the AI's position and movements as if they were still walking on the terrain then you'd need to either predict their movements to respawn them in the new location or leave the terrain there and use low poly versions of buildings behind so they avoid them, or can hide out of view. Levels of detail and culling on AI would also be advised.

    Currently the way I'm doing is is that I have large buildings covering parts of the game where smaller buildings are behind, to avoid using LOD as its time consuming, however over time I'll either add in a few layers of detail or I could use the Proxy function of SECTR so when out of the loaders range it will replace the building with a mesh that is low poly. For terrains you could use a multi tile terrain creation program, or use a terrain stitcher.
     
    Last edited: Feb 18, 2018
  26. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Loving SECTR Stream with the Proxy Mesh right now, its making my frame rates increase from 3fps to 50 fps so far in the Unity editor (no doubt 60-70 fps in a build) using my GTX 970 as a mid-range card.. still about 30 or so buildings to work on (out of over 100 in close proximity and many have interiors). What I do is create a Proxy mesh using the Proxy tool, then I run that mesh through a mesh decimator to reduce the poly count further without loss, but some of my buildings are quite large and ideally I'd want to remove these Proxy Meshes over a set duration away from the player like the Region Loader does, is there a way to create a Proxy Loader?

    This way I can stream in the Proxy Meshes when moving into a new map, and then Stream in the assets further as the Region Loader on the player hits one of the buildings, then as the player moves out of the the buildings reach, the Proxy Mesh takes over as it does until moving into another map zone, when the Proxy Loader attached to the player is then out of range it unloads the Proxy Meshes. Alternatively a gameObject with bounds that can cover the entire area, so when the player goes out of these bounds all of the proxy meshes are unloaded, but to me that would probably be costly (all in one go) so unloading of Proxy meshes as the player moves further out of the map would be better.

    I'm concerned that keeping those proxy meshes in place when out of view will only add to memory/poly count? When really they are not needed to be in the scene at that point, as I have so many buildings and structures being added all those will mount up.

    Or Cull them with SECTR Vis?
     
    Last edited: Feb 24, 2018
    hopeful likes this.
  27. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    What you are describing is doable, but will require some custom coding .

    If you just want the proxy meshes to not render when you are a certain distance away, then you could do that pretty easily with some extra code in Chunk and Region loader.

    If you want the proxy meshes to actually not be loaded, then you need to do rather more work. Either you convert the proxy meshes to Resources and manage then that way or else you make the proxies full on sectors and write loader code to load and unload them correctly.
     
  28. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Ok thanks - I'll give it a go :) and if I get stuck I'll give you a shout
     
  29. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Coming back to splitting up SECTR Stream gameObjects over multiple scenes when creating a build worked when I loaded up an additional scene, and adding it to the build list. Because I was using the Proxy Mesh it was hitting a 4 GB limit (some process still exists that is 32 bit on a 64 bit build) so would cause graphics distortions on a large project.

    Used a script that loaded up in the main scene; Note the first LoadScene (0) is commented out as this is the main scene which is loaded regardless so is not needed. This solved my build issues, maybe when you create the proxy mesh using the proxy tool you need to create it in the main scene, then move it afterwards.

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4. using UnityEngine.SceneManagement;
    5.  
    6. public class LoadScene : MonoBehaviour {
    7.  
    8.  
    9.     public void Load_New_Scene(){
    10.         //SceneManager.LoadScene (0, LoadSceneMode.Additive);
    11.         SceneManager.LoadScene (1, LoadSceneMode.Additive);
    12.  
    13.        //Further scenes can be added (as many as you want really)
    14.        //SceneManager.LoadScene (2, LoadSceneMode.Additive);
    15.  
    16.     }
    17.  
    18.     // Use this for initialization
    19.     void Start () {
    20.         Load_New_Scene ();
    21.     }
    22.  
    23.     // Update is called once per frame
    24.     void Update () {
    25.  
    26.     }
    27. }
    28.  
    29.  

    Tip: (only enable the game object with this script) when you are creating a build, else it will load up twice in the editor and your fps will be lower. Also make sure your SECTR_Chunk script in the editor (Node Name) is referencing the right scene. If you created the chunk in your main scene, you'll need to create a scene directory in your assets folder, and a sub folder called Chunks and copy over the chunk files for the items that are in that scene, else they will not be referencing the correct scene.

    Edit: also make sure the node name is also referenced correctly. For example; main2_gameObjectName.

    main2 being your scene name.
     
    Last edited: Feb 28, 2018
  30. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    So just to clarify, multiple scene streaming is possible with SECTR as long as you reference it correctly and have the chunk and proxies folders setup for each scene by creating scene folders in the assets directory (e.g main -- > Chunk, main --> Proxies / main2 --> Chunk, main2 --> Proxies). I have also placed the proxy meshes in each of the different scene folders so that it doesn't have any issues with the 4GB scene build limit.

    You also can only Export a chunk from the Main Scene, after that you can move it and reference it.
     
    Last edited: Mar 1, 2018
  31. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Yeah. I think if I was you I would put all of those proxy meshes into a Resources folder and then update the code in Chunk to load and unload the mesh from resources instead of hidinghousi showing it as happens now.
     
    julianr likes this.
  32. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Also, what you are doing now is ok, too. As you say multiple scene streaming can work if you do everything just right :)
     
    julianr likes this.
  33. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    yeah, I think it was just out of quickness. Ideally I'd like to make a modification to the export process so it does it from the scene path and place it in the scene folder. e.g main->chunk->chunk_name (any pointers for this would be appreciated) - it will save a lot of admin :)
     
  34. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    As you know, the way it does it now is load a Proxy Mesh no matter what as a starting building.. most have 2 or 3 levels of detail, when within range, go to nearest level of detail. The culling part of the LOD will never be seen as when the player is out of range it will go to Proxy before it can even see the culling part. Ideally I wan't to reduce those Proxy meshes some more as they are still quite high in poly count and may even replace them with a few boxes, as long as the building shape is there and the textures simulate the windows/building bricks/concrete etc. Then adjust the distance when streaming in chunks, group a few buildings as and when required. As I said before I'll probably tie in the removal of the Proxy Meshes when at greater distance or going through a tunnel and unload the ones that are out of view.
     
  35. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Hey there, me again. Back for some more clarification. I was using World Streamer, it is working for the most part, but I can't get a hold of anyone to help me with anything. The dev has not posted anything in the thread since December. The way I currently have things setup is I have a "game" scene and a "work" scene, as per the instructions. My map is 10240x10240 cut into 100 1024x chunks, and then turned into 100 scenes, one per chunk. WS then I am guessing just additively pushes it to the "game" scene when playing or removes it as you move around the "game" scene which contains the player, camera, Enviro, all my other stuff, etc.

    I am wanting to find out how Sectr handles this for open world. I believe originally it wasn't for open world right? I remember seeing something that said though that it now does. Is there any details on what I might have to do differently? My main "work" scene that has my map and everything in it is still all one scene, its just exported out into several small scenes after the fact leaving it as it was. What would I have to do to get my game working using this, and would it actually be able to do it fully open world without doors or anything? As of now I am able to fly around on my mount with no issues, but as I mentioned, with no support or anything, I am getting ready to chock it up to a loss if I can find something else that works well.

    Thanks!
     
  36. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    SECTR supports open world just fine. For both indoors and outdoors you create a single matter scene and in that scene you create sectors. SECTR includes a tool that lets you export reach sector to separate scenes (and import them too). Then, at runtime, SECTR will additively load and unload those subscenes as you move around.
     
    julianr likes this.
  37. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,235
    Is there any way of handling floating point issues? Once I start to get around 5-7k things start to get a bit wonky, lol. Do you happen to have any sort of demonstration or anything? I wish I could see it operate and know how it would work for my game.
     
  38. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    SECTR does not have any built in handling for world recentering, so that's probably a deal breaker if you're would is bigger than 5k units from the origin.
     
  39. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Hi! I'm having an issue with using SpeedTrees within a chunk, it makes the next chunk of buildings in front of the trees vanish when the region loader is in range. Any issue with using SpeedTrees?

    Thanks

    J

    Edit: Its ok, figured it out . it was SECTR Vis, when I enabled Simple Culling it would fix the issue where its not being seen on a 3rd person character.
     
    Last edited: Mar 5, 2018
  40. mgmhunt

    mgmhunt

    Joined:
    Apr 1, 2013
    Posts:
    62
    Possible to multi-thread the Sectorizing Terrain process? (I've got quite a few cores sitting around watching it) (and the Chunking process?!)

    Code needs updating too, stopping build in 2017.3:

    SECTR_Member.cs - line 816 - childLight.bakingOutput.isBaked

    Also feature request: If you have multiple sectors selected (ie drag with mouse), be able to click a button in the SECTR Stream window to Import Selected Sector(s) (as opposed to Import All Sectors). This would be great/much better if you don't even need the special list above, it's just computed on the scene selection (ie game objects selected with SECTR_Sector component selected, click button)... hmm just found button on Component itself which is useful, but for multiple object selection it only seems to import the first selected... so half way there I guess.

    Another Feature Request: Instead of loading a chunk in once selected, another button to open the scene the chunk is (ie transfer from main scene to just the chunk). Maybe a button underneath Import/Export (guess only enabled if no edits...)

    With multiple scenes loaded in to editor, the Export button seems to export according to which is the current Active Scene but the original sector may belong to another scene loaded in (and therefore doesn't write back to the same Scene folder, instead creating a new one). I think the default behaviour should be to write back to the original sector location but I can see that lightmapping according to the active scene may be the reason for the above. Perhaps another dialog box on Export - Write back to original scene (name) or to current active scene (name)... if multiple scenes are loaded.
     
    Last edited: Mar 9, 2018
  41. jnbbender

    jnbbender

    Joined:
    May 25, 2017
    Posts:
    487
    @MakeCodeNow I am developing a large world map for the Android and am using Text2Mesh. I don't own SECTR Stream but I'm considering it. I read a tutorial showing how a Terrain is broken up with the SECTR Terrain selection. My question is, if I break up the terrain, can I then convert it to a mesh without any issues from SECTR Stream? (or the process reversed)
     
  42. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Using SECTR Stream with Proxy Meshes and Unity Occlusion Culling - works a treat - increased frame rate considerably. I've yet to work on SECTR Vis with Culling to see if it's a better option.
     
    Last edited: Mar 12, 2018
  43. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Ok. Glad you got it sorted out.
     
  44. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    Thanks for all if the suggestions.

    Unfortunately it's not easy to thread the sectorization as most time is in unity API calls which are not thread safe.

    The baking code thing will be fixed in my next update.

    Open Chunk scene is an interesting idea . I'll consider it.

    Generally speaking the exoprt button on an already exported Chunk should overwrite the older version, not create a new one. If you can send me repro steps I'll take a look as it sounds like it could be a bug.
     
  45. mgmhunt

    mgmhunt

    Joined:
    Apr 1, 2013
    Posts:
    62
    Yep I can repro on clean project. New project (2017.3.1f1 Mac). Import SECTR (see warnings that appear, update API process also). Load OpenWorld demo scene. Export All Sectors. Run ... works as expected.

    Select first Terrain chunk (SECTR Terrain 0-0-0 Sector), Import - Terrain appears, Export -terrain disappears, as expected... all good so far.

    Create New Scene, -save it-, make it the active scene and now press Export chunk button for (SECTR Terrain 0-0-0 Sector). Creates new folder for TestScene and now saves as TestScene_SECTR Terrain 0-0-0 Sector. Original Terrain chunk has lost reference and now can't import or export.

    See screenshots attached.

    Screen Shot 2018-03-14 at 13.46.11.jpg Screen Shot 2018-03-14 at 13.26.16.jpg Screen Shot 2018-03-14 at 13.34.37.jpg Screen Shot 2018-03-14 at 13.34.45.jpg Screen Shot 2018-03-14 at 13.34.58.jpg

    (nother thing SECTR_NeighborLoader and probably other loaders should fail gracefully if there are no chunks to load.. I am swapping a simple scene with a streamed scene for testing. Get this error for no SECTRs etc "Assertion failed: Assertion failed on expression: 'j - i == terrainChunksInfo.numChunksInX * terrainChunksInfo.numChunksInY'"
     
    Last edited: Mar 14, 2018
  46. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212

    By default SECTR only supports one scene, everything needs to be in your main scene and exported first, you can then copy over the chunks and proxies and place them into your other scene folders by creating them, then in the inspector change the main scene folder to the folder name that the chunks have been placed. Then you need to go into each of the chunks and reference the folder name in there also. They will then be able to import and revert, however if you make changes to the assets inside the chunk, make sure you do it direct and not in the editor, as exporting them again will only create a new chunk in the main scene.

    Multiple scene support on SECTR when exporting will be most welcome as games are getting bigger and we still have that 4GB texture limitation on Unity within a build that gives graphics distortions. Not sure about 2018.x though, but quite a lot of people are still on 2017.x
     
    Last edited: Mar 14, 2018
  47. mgmhunt

    mgmhunt

    Joined:
    Apr 1, 2013
    Posts:
    62
    Thanks @julianr but I think this is a bug rather than a process issue. I'm not trying to split into multiple scenes as such (in fact this is the problem, SECTR is doing it by itself if I have another scene loaded additively in editor. ie I do have only one SECTR streamed scene and want to keep it as such, but using the Import/Export buttons when another scene is loaded, Exports to wrong place (think it's related to Active Scene. Would expect the SECTR scene to ignore any other scenes loaded in and/or ActiveScene and save back to original import/export scene)
     
    Last edited: Mar 14, 2018
  48. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Hmm. So everything is in one scene with SECTR chunk scripts? Should be fine if its your main scene. But if you have SECTR chunk scripts on multiple scenes then it will not work, it will always save to the first scene in the list. Well in my experience. If you moved those gameObjects from the main scene to another scene with the main scene references in the SECTR chunk script then when you export you'll get errors.
     
  49. mgmhunt

    mgmhunt

    Joined:
    Apr 1, 2013
    Posts:
    62
    @julianr see above repro steps, I'm not doing anything complicated. Just opening Demo Scene, chunking as per demo... testing it runs fine. Add a new scene additively, make it Active (that's all, no objects, nothing, empty scene) and then try to use SECTR on the Demo scene (which is still loaded). It starts splitting the chunks into the new empty scene (in the screenshot those chunks have been put there by SECTR not me). So "if you have SECTR chunk scripts on multiple scenes then it will not work" this is not the case, the other scene is new/empty, and " it will always save to the first scene in the list.", I would expect the behaviour to save back to the original scene.

    The repro steps should show you, let me know if they are not clear enough.

    Not a panic for me at the moment, I can work around and was just doing some preliminary tests. But my workflow does involve additive scene editing.
     
  50. MakeCodeNow

    MakeCodeNow

    Joined:
    Feb 14, 2014
    Posts:
    1,246
    julianr is right that what you are doing is problematic for SECTR as it's written assuming that it has full control over the multi scene editor and that you aren't changing things, too. Once you start adding scenes, changing the active scene, etc. then there are an incredible number of states that the editor could be in and it's very hard for me to "do the right thing" in all of them.

    My recommendation is that if you want to do additive scene loading with SECTR active, just make everything a Sector. Ultimately, SECTR STREAM is just a very fancy wrapper around additive scene loading and the overhead of using it rather than using the MSE directly is very minimal.