Search Unity

[RELEASED] World Streamer ! Forget about your game memory usage and create big world!

Discussion in 'Assets and Asset Store' started by NatureManufacture, May 13, 2015.

  1. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    But why you want to use realtime generate at all? Its slow.
     
  2. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    Oh, I am testing out a bunch of different solutions for improved performance over Unity's default terrain tree/grass system. It seems to be very difficult to find good documentation on performance (i.e. real numbers that show hardware used and frame rates and other data) of various vegetation systems in Unity, so I am left with the option of experimenting with different systems myself and relying on suggestions from others.

    I know the World Streamer documentation mentions Critias Tree System, but I do not think it is available in the store any longer. I have not yet looked at Advance Foliage Shaders v.5. I am also planning to evaluate another asset that would allow GPU Instancing for grass and other objects in large numbers.

    I would love to hear whatever your recommendation is for handling trees, grass and other terrain-placed objects, because no one knows what will work best with streaming better than you.

    Best regards,
    Tony
     
    Last edited: May 16, 2018
  3. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    As I co-op with Lennart I will say vegetation studio because we could always discuss problems on 24/7 chats.
     
  4. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    Okay, that is great because it is a huge plus when there is better integration and cooperation with the components I am using to build the system. I only started working with Vegetation Studio in the last week, so I am still learning how to best use it in my World Streamer project.

    Since the World Streamer docs do not mention how to use Vegetation Studio with ring streaming, I came here looking for the right way to set it up so that the vegetation shows up on LOD0 scenes and LOD1 ring scenes.

    Best regards,
    Tony
     
  5. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Chiming in here to agree with @sharkapps : Any tips or, even better, documentation on how to use ring streaming with Vegetation Studio would be enormously helpful. I've been trying to figure it out, and I presume many other people are also trying to do the same thing, but it's surprisingly hard to find a good guide anywhere.
     
    jeromeWork and MarkusGod like this.
  6. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    Hi World Streamer Team,

    I want to know that is there any way available to load different LODs. Like, i want to load L9 floor near the camera which are the high detail floor. While I want to display(ever present) the L7 floor. I found that layers are load and unload completely, I can't every present the L7 details. Additionally, i want to unload L7 only when i am displaying L9. Do this feature available in world streamer?
     
  7. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    I still do not understand your system with the balls. They also fall under your card if you disconnect the prefab player, and then move it to another location! for example, if a player runs away (the pieces of the terrane are unloaded), the player dies, then his position goes to a new point (respawn), then any physical objects fall before loading these terranes over which the physical objects are located. The kinectic is turned off before loading the map. This will happen in the event that this item will be located immediately next to the player !!!! The player will initially be in the trigger of a physical object! I checked the same on your demo scene. Do you have a solution to this problem? I wrote about this before.
     
  8. Ultramattt

    Ultramattt

    Joined:
    Jan 13, 2015
    Posts:
    22
    Perhaps someone here can help me. When my chunk loads my Dynamic Destructible objects load with it as it should. But when I kill and destroy my destructible objects and the Chunk unloads, the Destructible objects return when it Re-Loads the Chunk. Is there a way to make it so that when things are destroyed they do not come back when the Chunk Re-Loads?
     
  9. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    I find the way to load unload L8 and L9 using your new feature of "Use loading Range Min" (I guess you called it ring streaming) but it has a problem that sometime i get empty space neither l8 or l9 load. How can i control it.? I have tried to use "Destroy Tile Delay" by increasing its value but it unable to solve the problem and i am also getting mesh flickring problem as l8 and l9 sometime become visible together.
     
  10. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Yes, ring streaming could do this but to be honest it's rather for unity terrain. Ofc big things like floors or rooms you could stream by this.
    Physcial balls on our demo simply become frozen when player is too far. We block physics and position with saving their speed vector. Maybe we should an additional info about spawn and loading. I think we didnt take into account
    spawning, just unloading. Spawn is very characteristic because player is in close range and data around it is not loaded.
    Anyway good idea is to replace spawned player by temporary object for streamer until new data will be loaded. This time will player spent at save place. This will not turn on physics on rest objects because there will be no player until full world will be loaded. It's just an idea to solve this without any changes,
    Yes because you saved data at scenes. Scenes don't save anything at runtime so we would advice to write small script with small database or list which will hold object "state". Object after load will read own state from data. We made such thing in MMO Game where castle was destructable. When player was close we load castle data and it get rpc from server about their curent state (upgrade, hp, damage state).
    The thing is that is pretty suitable for terrains because 1 terrain could be 10 cm lower and it will be enought. For room you could: Move l7 a bit 10 cm lower and into left or right so it will not flicker and player will not see any replace. Z fight will be killed.


    Sorry for long respond ofc unity didnt show me any messages here.
    Please use @NatureManufacture so it will mark me and give information about question. Unfortunly unity don't show post even on your own thread in any message ;/
     
  11. ParadoxSolutions

    ParadoxSolutions

    Joined:
    Jul 27, 2015
    Posts:
    325
    @NatureManufacture

    Hello,
    I've been using World Streamer for a while now and it is geared very much toward static worlds and having parts of a game that are very much procedural I'd like to share some changes I've made to WS that have been very helpful toward development for the procedural portions of the game.

    I also think some changes are good to have in general and would like to see them added to the asset so everyone can utilize them; and so I don't have to remember to backup the scripts before I import a new version of WS :p

    Changes to WorldMover.cs:
    -Loop count tracking.
    This allows users to track how many times the world has looped over an axis in any direction.
    (I only implemented this for the X and Z axis but the same concept applies for the Y axis)

    Code:

    Code (CSharp):
    1. //Global Variables:
    2. public int timesLoopedX;
    3. public int timesLoopedZ;
    4.  
    5. //At the top of the MoveWorld() method:
    6.  
    7. if (streamerMajor.player.transform.position.x < 0 && playerPositionMovedLooped.x > 0)//Loop over -x axis
    8.         {
    9.             timesLoopedX--;
    10.         }
    11.         else if (streamerMajor.player.transform.position.x > 0 && playerPositionMovedLooped.x > 0) //Loop over x axis
    12.         {
    13.             timesLoopedX++;
    14.         }
    15.         else if (streamerMajor.player.transform.position.z < 0 && playerPositionMovedLooped.z > 0) //Loop over -z axis
    16.         {
    17.             timesLoopedZ--;
    18.         }
    19.         else if (streamerMajor.player.transform.position.z > 0 && playerPositionMovedLooped.z > 0) //Loop over z axis
    20.         {
    21.             timesLoopedZ++;
    22.         }
    -OnWorldMoved Event.
    This allows the user to invoke a UnityEvent after MoveWorld() executes, useful if you want to generate/update something after the world was moved, also good for syncing multiplayer data.

    Code:
    Code (CSharp):
    1. //Imports:
    2. using UnityEngine.Events;
    3.  
    4. //Global Variables:
    5. public UnityEvent onWorldMoved;
    6.  
    7. //At the bottom of the MoveWorld() method:
    8. onWorldMove.Invoke();
    Changes to Streamer.cs:
    -OnSceneLoaded UnityEvent.
    -OnSceneUnloaded UnityEvent.
    These are great for saving data for AI agents that were in the procedural world or generating/updating world objects after the streamer has loaded a scene, and potentially pooling procedural objects, however I have yet to try that.

    Code:
    Code (CSharp):
    1. //Imports:
    2. using UnityEngine.Events;
    3.  
    4. //Global Variables:
    5. public UnityEvent onSceneLoaded;
    6. public UnityEvent onSceneUnloaded;
    7.  
    8. //At the bottom of the respective sceneLoading() and sceneUnloading() methods.
    9. onSceneLoaded.Invoke(); //or onSceneUnloaded.Invoke()
    On a side note It would also be pretty cool to see a version of the world mover/ floating point fixer that is independent of steamers for some instances where I could reuse the same terrain instead of loading a new scene or some kind of terrain pool. (some of my scenes use the same terrain in locations, props are procedural of coarse).

    Cheers.
     
  12. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    @NatureManufacture
    Do you mean, i cannot use it with my objects or floor which i have bring from 3ds max? It is only feasible for unity terrain object? Right?
     
  13. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    @NatureManufacture

    When switching between ring string sometime no object load at all and an empty scene appear but it get fill after some second delay. It very unpleasing to watch empty spaces, How can I control it?
     
  14. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Unloading delay should be adjusted to higher. This also happend in build?
    You could use it ofc! but you have to you know make a trick which I mention:)
     
  15. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @NatureManufacture Just wondering if you have added Streamed Occlusion Culling - so rather streamed from distance only you get streamed Occlusion culling of everything your camera doesn't see.

    Also has anyone tested WS on Voxeland? I still haven't been able to yet, I've got a bit of work ahead of me before I can try it.
     
  16. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    Unet uses a single concurrent scene for all clients - is there a way to use world streamer to load prefabs rather than scenes? Or is there some other solution for networked unet games...
     
  17. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    Do you have tips or a guideline in your documentation on how to optimize it for a topdown view shooter for mobiles ? I won’t use low end devices, targeting first all iOS running metal ( iPad Air 2 , iPhone 6+ etc)
     
  18. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Nope because scenes are loaded async and can contain navmesh lightmap etc. Basically scene contain scene data + references to models.

    Keep loaded about 2 player screens? You dont need more data probably.
    Navmesh could be baked on work scene and moved manualy to game scene so AI will handle situation.
     
    f1chris likes this.
  19. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Its not possible as operation is async, when player will move camera dynamicly engine will not handle to load everything in such short time.
     
    Ascensi likes this.
  20. JazZRocK

    JazZRocK

    Joined:
    Dec 17, 2015
    Posts:
    32
    Hello :)

    It is possible de stream an extremely big amount of trees ?
    This is the setup i have in mind:

    1.I have 256 terrains tiles (size: 500x500 each) as LOD0 with only ground and grass textures datas ready to be streamed in layer 1 for exemple.
    (I have the same terrains but only with trees,bushes placed, etc to use with Terrain To Mesh).

    2.I use Terrain To Mesh to create low poly version of the terrains as LOD1 layer 2 and LOD2 layer 3 with basemap.

    3.I use Terrain To Mesh again but only to bake trees with originals positions resulting in many many many gameobject in scene and ready for streaming in layer 4.

    The grid size for the trees layer is set to 500x500 like terrains but it represents more than 10 000 tree prefabs x 256 to be streamed.

    I have 120 fps with the same configuration except that the trees stays in terrains datas normally.
    But i don't want to have my trees in terrains.

    I know that it is a performance killer to have many gameobject in scene and that's why World Streamer :p
    But the streamer system in gameplay scene can load fastly a async scene with 10 000+ gameobject ?

    I must to know before trees baking manipulation (256).

    120fps is very good for the moment but i want to save the max of perf and if world streamer don't care about object count per elements grids within the gameplay scene so im happy ! :D

    Thanks in advance :)
     
  21. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    I tested such thing long time ago and result was poor, thats why I keep trees only at terrains.
    I even test fake terrain for tree data but also I was not happy.

    I would suggest to:
    Take last lod from trees (cross/billboards) and bake each sector into 1 mesh :D So
    You will have:
    Terrain: lod0 - with unity trees and unity terrain
    lod1- baked low poly terrain mesh and with baked cross/billboard trees into 1 very cheap mesh
    You could merge this sector of trees by any free batching tool. I saw unity in their demo made similar thing, they bake whole grass sector into 1 batch. Such sectors take only 1 drawcall and was super fast. With my idea it will be more tricky I mean you will gain alot more because you will move whole background trees into few batches with max 1000-5000 tri/verts amount.
    Also unity batching should handle this it self but you have to uncheck dynamic batching (dynamic batch will batch them one by one so it will be slow)
    It pretty late and im tired but i think this is road which you could try with very good result.
     
  22. JazZRocK

    JazZRocK

    Joined:
    Dec 17, 2015
    Posts:
    32
    Wow !
    Thanks you for the tips !
    now, i know what to do :)

    Good night and thx again ^^
     
  23. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    Hi @NatureManufacture!

    I have performance problem, my scenes are loading very slow and FPS is around 20 (sometime is good like 35.40 and some time is 8 or 9). Actually I have a fly camera, when i fly in my environment and fly from one position to another position, the surrounding scenes are loading very slow. It take almost 4 to 5 (or more) seconds to load related scenes. How can i improve it?

    Currently I have two kind of streamers :
    1. Object streamers (4 streamers- as there are four projects objects at different places in scene)
    2. Building streamers (4 streamers- as there are four projects building at different places in scene))

    I am not streaming my floor, i am just using LODs for it as its streaming is not good. And I have set max parallel scene loading to 2 and position check time is 0.1111.
     
  24. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    At build or editor?
    Did you checked prebake colission meshes?
    What unity function slowdown so much? (please screen from buildc with profiler)
    This 8-9 fps is probably during GC.
     
  25. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    I have told you about the build (Windows build).Actually build is much batter than the editor.

    I didn't checked prebake collision meshes in player settings.

    I checked the Profiler and mostly Rendering have problem (Camera.Render -> CullResults.CreateSharedRedererScene, Drawing Update depth texture etc.). while there are some spikes in script and the method name is Loading.UpdatePreloading -> update preloading -> Application.Itegrate Assets in Background.

    No 8-9 fps is coming when i am loading the heavy scene.
     
    Alex3333 likes this.
  26. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @NatureManufacture Is vegetation studio compatible with WS? My terrains are Voxel/mesh based and compatibility for mesh terrains is coming soon.

    Also thanks for letting me know about the issue with Streamed Occlusion Culling
    "Its not possible as operation is async, when player will move camera dynamicly engine will not handle to load everything in such short time."

    I don't know if you tried it but the Asset InstantOC has camera hide delay/preload option which turns on/off the rendering in advance before the camera will see the targets. I think at least everything directly behind the player could be unloaded until the the player starts to turn 20-30 degrees left or right? No need to reply if you've already tested this and it simply doesn't work.
     
  27. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Yes it works with vs. You have to bake vegetation for each terrain tile or streamed tile or for every few tiles.
    But objects behind camera are not rendered, they could if they are batched in blocks so we see part of the block = whole block is turned on.
    No not unloaded - turned off. Engine will not have enought power to render it in proper time.
    The idea is if you instance objects like vs did you simply turn off instance. This objects are not removed from memory but they are turned off. What about shadows when objects behind you cast on your current screen?

    Check this colissions so build will load much less data and much much faster.
    Do you use static batching?
     
  28. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    Yes i have used static batching in some scene and my floor objects(which are not streaming) are also static? is this a problem? additionally static batching check is also enable in build.
    Let me try your given solution (checked the prebake collision meshes)
     
  29. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    @NatureManufacture
    I have check prebake collision meshes but this didn't effect the performace. Still scene take some time to load and things are popping up and fps is also low. Do i need to change static batching as well?
     
    Alex3333 likes this.
  30. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Send me screen what you got at the scene and what is streamed:D

    Ahhh I love this... as this asset is about performance only performance problems comes:D but hmm yeah it's specific to adjust amount of data.
    This could be terrain grass or shader, anything.
     
  31. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    @NatureManufacture
    Which screenshot you require? As i said you before that i am not streaming the Floor. Floor is working on LODs. For the same reason that scene loading taking time, i didn't stream the floor.
     
  32. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    You got alot of grass and trees there?
    Because culling could come from that place. it dont have to but it can.

    Culling comes from refreshing whole data info - what should be rendered. It could be trees and grass.

    Just screen what you got there and how it looks.
     
  33. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    @NatureManufacture

    Here is on of the image of floor please see. There are textures only for grass or for sand etc etc. Remember there is no tree on floor, tree are separate which i am loading(streaming) with objects.
     
    Last edited: Jun 4, 2018
  34. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    @NatureManufacture Did you find any hint? I also find that you cannot static batch your object in streaming scenes. I tried to use Static batching but each time it generate scene its remove static check from the object.
     
    Last edited: Jun 4, 2018
  35. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    "separate which i am loading(streaming) with objects. "

    As separated objects not in batched blocks? So you got your culling now. Try to stream without trees.
    Check layer by layer because culling comes from update: what should be rendered or not after every load.
     
  36. MFKJ

    MFKJ

    Joined:
    May 13, 2015
    Posts:
    264
    I didn't get your point, you mean that i stream my objects without tree? Well it will require much time. (I will do that if this is the case, please let me know). I also want let you know that streaming trees are also with working LOD group.


    What do you mean by separated objects not in batched blocks? I guess you are saying that tree are not in the floor and floor is static. Yes, Floor is static and there is no tree in it as i share the picture with you. But remember trees are also streaming along with objects. I didn't create any separate layer for trees, it is generally inside object layer. I have created two kinds of layers object layer and building layer and there are total 8 layers.
     
  37. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    I mean that if you have many separated objects like trees you will get cullinmg isssues thats why foliage is usualy connected with terrain or other foliage blocks. Just try without trees or check layer by layer what generate this spikes. I had bad exp with trees streamed as objects.
     
  38. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    So you are saying use a persistent :game: scene and just keep the entities and nav mesh in the first scene and load the geometry and lighting via streaming to each client in the asynch scenes??
     
  39. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Yeap:)
     
  40. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Based on world streamer, river auto material and few other our assets are inside.

     
    Last edited: Jun 7, 2018
    sharkapps likes this.
  41. sharkapps

    sharkapps

    Joined:
    Apr 4, 2016
    Posts:
    145
    Top-notch. Your foliage looks great, of course! I am impressed with the density and it seems performance is decent, but I am curious about resolution and FPS numbers. I will have to dig to find more info about this project -- it looks really great. Thank you for posting about it.

    -Tony
     
  42. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Trees etc are from other store pack. Our is only few foliage models. Mostly rocks and river etc. Anyway game looks really cool.
     
  43. SonGoku10c

    SonGoku10c

    Joined:
    Dec 9, 2017
    Posts:
    77
    I hope, that this question was not already asked and answered, but is there already a relese date for World Streamer 2?
     
  44. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Nope, we was smashed by lw and hd srp tech and hmmm..... this will take us some time to convert assets.
     
  45. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Good afternoon. I still can not solve the performance problem. In the build I have already removed everything that I can !!!! REMAINED only terrain. When loading or unloading, there are big peaks !! screenshot attached. how to get rid of them ?? card size of 500 * 500. (there is no grass either !!) there is nothing in the relief.
     

    Attached Files:

  46. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    You use rtp?you got spikes from gc - you got huge amount of non streamed objects at the scene or... Terrain shader system allocate memory in huge amount. Gc is not related woth streaming itself but memory release in engine. What happend? Engine check what should be removed from memory so it check one by one every gameobject and script which is currently loaded. This list check could take huge amount of time of there is many game objects ( mark dependencies)
     
    Last edited: Jun 11, 2018
  47. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    rtp I also removed. in the main scene I have objects but not so many. but as I suppose they should not in fact influence. How to get rid of this check ?? These peaks appear only when I move on the map.
     
  48. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Check this with out anything.... in the scene besides your terrain...
    Then add some cubes and crap to test objects... If everything is fine, then toss in those objects...and see if you have any issues.

    Also how large is your map, and what is your tile sizes, how many tiles are loaded at a one time?
     
  49. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Just run ws without any other objects just camera, streamer with terrain and test if you will get spikes. Yes you got spikes when unity unload and search data to unload it.
     
  50. Jakubkr

    Jakubkr

    Joined:
    Jun 5, 2018
    Posts:
    2
    Hello, I have question about streaming levels with Baked GI. I built GI in my work scene and everything looks good and every part of terrrain has got its own lightmap. But when I switch to game scene and hit play there are no lightmaps at all. So the question is how to transfer them?