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. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    Yes, it doesn't and should not happen. Each chunk should only have a terrain. There should be one LOD manager. When splitting, you should disable all the unwanted objects including the LOD manager and you also should check if you have an empty game object prefix layer for the scene splitter, if you have, then delete that layer.
     
  2. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Hi!
    Update is almost ready:)
    upcomming Update
    "1.9"

    - System that holds or moves player to safe place during loading time. (done)
    - System which manage physics when player is far from objects (done)
    - Terrain culling camera setup changes (done)
    - Manual update
    - Small fixes (done)
    - Exception script for terrain at neighbour LOD system (done)
    - Removes warnings for 5.3+ (done)
    - Light and GI additional manager
    - Streamer should works with catalogs in hierarchy. (tommorow)
     
  3. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Great!
    Is it possible to get some technical information about how the physics solution works?
     
  4. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    It will turn on cinematic-> stop and save speed vector. Movment will be released again when player will be near enough.
     
    recon0303 likes this.
  5. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Cool, thanx for the info : )
     
  6. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    I can't load any of the tutorial maps to browse around:

    Scene 'Simple_Work_Scene_Terrains_x3_z3' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.

    Thanks for any help.
     
  7. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Yeah, I'm getting all sorts of errors. I tried to load Simple_Work_Scene and I am getting null reference pointers. I am using Unity 5.5.1xf1.

    Edit: I've updated to 5.6.0xb6, with a clean project, and I'm still hitting these walls trying to load the example maps.
     
    Last edited: Feb 7, 2017
  8. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Hi!
    Please carefuly read tutorials and watch tutorial video. At each streamer object you have to click "add to build settings" error buton. It will automatically add scenes to build settings.
    If you have any errors that are not related to this which you post here please import asset from assetstore again without removing it. Sometimes assetstore downloader miss some relations between files and it will download them and fill if you will overwrite files. This assetstore bug start to be annoying....

    Sorry for late answer. My 2nd doughter has born in saturday and my 1st is sick in the same time = armagedon in house. This also means that update will come a bit later then we suspect. (1 week later probably)
     
    recon0303 likes this.
  9. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    1. I should have read the docs first. I just assumed it would work out of the box, which for something like this was silly.
    2. Congrats! How you find time to work on this stuff with two kids is beyond me.
     
  10. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    I finally got everything working, and it's a neat tool, but I do have a question. I noticed during the setup of my own terrain, that I needed to use a third party tool to split the terrain before it could be used with this system. Do I need to do this every time I make any changes to the terrain? All in all though a nice asset, just trying to figure out the workflow, even with the guide it's a bit confusing.

    What would be the best method to handle a terrain around 100,000 units by 100,000 units? The free tool provided will only split the terrain into 4 chunks, what if I don't bother splitting the terrain? Once I've split it, do I have to generate every time I change something on the map?

    Sorry about the array of questions, I appreciate your help.
     
    Last edited: Feb 8, 2017
  11. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    No problem. I always do the same:D
    Questions is a good thing;) You are always welcome with them.
    This is free terrain split tool. Ofc many terrain generation systems already support tiled terrain data and work on tiled data. Tiles are faster and gives control over data amount. Basicaly I will advise to work on data in parts. If you split your terrain and make changes on one part of the data (height splatmap etc) you will not have to split it again. You modify data so changes will be shared and do not need to be split again.

    You could split this chunks into another 4 so you get 16. This will not take alot of your time - max 1h. How far do you want to render your terrain?
     
  12. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    I'm needing a map of a minimum of 100km x 100km
     
  13. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Ok world size isn't any limit but mostly I ask how far you will render your world (camera)
     
  14. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Oh, not that far actually, it's a third person RPG with a camera angle of around 50d locked towards the ground. Zoomed out you can see probably 50mx50m. There will be no need for LOD.
     
  15. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    ok so you don't need low poly meshes at far plane. Use 3x3 grid (loading range =1) and terrain size? It depends from your camera position. If you will be at hill or heigh place you should have some terrain in background. Hard to suggesst terrain size 100x100m ? So you will have 300x300 units at once?
     
  16. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    My problem is currently splitting the terrain into 300x300 chunks. The free tool can not cut it correctly, and I am not sure which of the other tools would solve this problem.
     
  17. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    This might be something to include in your tutorial instead of the other free Terrain splitter by Dvornik which only does quartering, this one supposedly allows you to specify the size of the chunks. I will try it out when I get home and verify it.

    https://github.com/dbircsak/blog/blob/master/SplitTerrain/Assets/Editor/SplitTerrain.cs

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using UnityEditor;
    4.  
    5. public class SplitTerrain : EditorWindow
    6. {
    7.     [MenuItem("Split/Split Terrain")]
    8.     static void Init()
    9.     {
    10.         GetWindow<SplitTerrain>();
    11.     }
    12.  
    13.     Transform transform;
    14.     int xLen = 3; // Match with TerrainManager if using
    15.     int zLen = 6;
    16.     // Must be power of two plus 1
    17.     int newHeightRes = 65; // Started with 513 in New Terrain
    18.     int newDetailRes = 256; // Started with 1024 in New Terrain
    19.     int newSplatRes = 128; // Started with 512 in New Terrain
    20.  
    21.     public void OnGUI()
    22.     {
    23.         transform = (Transform)EditorGUILayout.ObjectField("Terrain to split", transform, typeof(Transform), true);
    24.         xLen = EditorGUILayout.IntField("Split x axis count", xLen);
    25.         zLen = EditorGUILayout.IntField("Split z axis count", zLen);
    26.         newHeightRes = EditorGUILayout.IntField("New heightmap res", newHeightRes);
    27.         newDetailRes = EditorGUILayout.IntField("New detail res", newDetailRes);
    28.         newSplatRes = EditorGUILayout.IntField("New splat res", newSplatRes);
    29.  
    30.         if (GUILayout.Button("Split!"))
    31.         {
    32.             if (transform == null)
    33.             {
    34.                 Debug.LogWarning("No terrain found");
    35.                 return;
    36.             }
    37.  
    38.             Terrain origTerrain = transform.GetComponent<Terrain>();
    39.             if (origTerrain == null)
    40.             {
    41.                 Debug.LogWarning("No terrain found on transform");
    42.                 return;
    43.             }
    44.  
    45.             if (xLen < 1)
    46.                 xLen = 1;
    47.             if (zLen < 1)
    48.                 zLen = 1;
    49.             for (int x = 0; x < xLen; x++)
    50.             {
    51.                 for (int z = 0; z < zLen; z++)
    52.                 {
    53.                     EditorUtility.DisplayProgressBar("Splitting Terrain", "Copying heightmap, detail, splat, and trees", (float)((x * zLen) + z) / (xLen * zLen));
    54.                     float xMin = origTerrain.terrainData.size.x / xLen * x;
    55.                     float xMax = origTerrain.terrainData.size.x / xLen * (x + 1);
    56.                     float zMin = origTerrain.terrainData.size.z / zLen * z;
    57.                     float zMax = origTerrain.terrainData.size.z / zLen * (z + 1);
    58.                     copyTerrain(origTerrain, string.Format("{0}{1}_{2}", origTerrain.name, x, z), xMin, xMax, zMin, zMax, newHeightRes, newDetailRes, newSplatRes);
    59.                 }
    60.             }
    61.             EditorUtility.ClearProgressBar();
    62.  
    63.             for (int x = 0; x < xLen; x++)
    64.             {
    65.                 for (int z = 0; z < zLen; z++)
    66.                 {
    67.                     GameObject center = GameObject.Find(string.Format("{0}{1}_{2}", origTerrain.name, x, z));
    68.                     GameObject left = GameObject.Find(string.Format("{0}{1}_{2}", origTerrain.name, x - 1, z));
    69.                     GameObject top = GameObject.Find(string.Format("{0}{1}_{2}", origTerrain.name, x, z + 1));
    70.                     stitchTerrain(center, left, top);
    71.                 }
    72.             }
    73.         }
    74.     }
    75.  
    76.     void copyTerrain(Terrain origTerrain, string newName, float xMin, float xMax, float zMin, float zMax, int heightmapResolution, int detailResolution, int alphamapResolution)
    77.     {
    78.         if (heightmapResolution < 33 || heightmapResolution > 4097)
    79.         {
    80.             Debug.Log("Invalid heightmapResolution " + heightmapResolution);
    81.             return;
    82.         }
    83.         if (detailResolution < 0 || detailResolution > 4048)
    84.         {
    85.             Debug.Log("Invalid detailResolution " + detailResolution);
    86.             return;
    87.         }
    88.         if (alphamapResolution < 16 || alphamapResolution > 2048)
    89.         {
    90.             Debug.Log("Invalid alphamapResolution " + alphamapResolution);
    91.             return;
    92.         }
    93.  
    94.         if (xMin < 0 || xMin > xMax || xMax > origTerrain.terrainData.size.x)
    95.         {
    96.             Debug.Log("Invalid xMin or xMax");
    97.             return;
    98.         }
    99.         if (zMin < 0 || zMin > zMax || zMax > origTerrain.terrainData.size.z)
    100.         {
    101.             Debug.Log("Invalid zMin or zMax");
    102.             return;
    103.         }
    104.  
    105.         if (AssetDatabase.FindAssets(newName).Length != 0)
    106.         {
    107.             Debug.Log("Asset with name " + newName + " already exists");
    108.             return;
    109.         }
    110.  
    111.         TerrainData td = new TerrainData();
    112.         GameObject gameObject = Terrain.CreateTerrainGameObject(td);
    113.         Terrain newTerrain = gameObject.GetComponent<Terrain>();
    114.  
    115.         if (!AssetDatabase.IsValidFolder("Assets/Resources"))
    116.             AssetDatabase.CreateFolder("Assets", "Resources");
    117.         // Must do this before Splat
    118.         AssetDatabase.CreateAsset(td, "Assets/Resources/" + newName + ".asset");
    119.  
    120.         // Copy over all vars
    121.         newTerrain.bakeLightProbesForTrees = origTerrain.bakeLightProbesForTrees;
    122.         newTerrain.basemapDistance = origTerrain.basemapDistance;
    123.         newTerrain.castShadows = origTerrain.castShadows;
    124.         newTerrain.collectDetailPatches = origTerrain.collectDetailPatches;
    125.         newTerrain.detailObjectDensity = origTerrain.detailObjectDensity;
    126.         newTerrain.detailObjectDistance = origTerrain.detailObjectDistance;
    127.         newTerrain.drawHeightmap = origTerrain.drawHeightmap;
    128.         newTerrain.drawTreesAndFoliage = origTerrain.drawTreesAndFoliage;
    129.         newTerrain.editorRenderFlags = origTerrain.editorRenderFlags;
    130.         newTerrain.heightmapMaximumLOD = origTerrain.heightmapMaximumLOD;
    131.         newTerrain.heightmapPixelError = origTerrain.heightmapPixelError;
    132.         newTerrain.legacyShininess = origTerrain.legacyShininess;
    133.         newTerrain.legacySpecular = origTerrain.legacySpecular;
    134.         newTerrain.lightmapIndex = origTerrain.lightmapIndex;
    135.         newTerrain.lightmapScaleOffset = origTerrain.lightmapScaleOffset;
    136.         newTerrain.materialTemplate = origTerrain.materialTemplate;
    137.         newTerrain.materialType = origTerrain.materialType;
    138.         newTerrain.realtimeLightmapIndex = origTerrain.realtimeLightmapIndex;
    139.         newTerrain.realtimeLightmapScaleOffset = origTerrain.realtimeLightmapScaleOffset;
    140.         newTerrain.reflectionProbeUsage = origTerrain.reflectionProbeUsage;
    141.         newTerrain.treeBillboardDistance = origTerrain.treeBillboardDistance;
    142.         newTerrain.treeCrossFadeLength = origTerrain.treeCrossFadeLength;
    143.         newTerrain.treeDistance = origTerrain.treeDistance;
    144.         newTerrain.treeMaximumFullLODCount = origTerrain.treeMaximumFullLODCount;
    145.  
    146.         td.splatPrototypes = origTerrain.terrainData.splatPrototypes;
    147.         td.treePrototypes = origTerrain.terrainData.treePrototypes;
    148.         td.detailPrototypes = origTerrain.terrainData.detailPrototypes;
    149.  
    150.         // Get percent of original
    151.         float xMinNorm = xMin / origTerrain.terrainData.size.x;
    152.         float xMaxNorm = xMax / origTerrain.terrainData.size.x;
    153.         float zMinNorm = zMin / origTerrain.terrainData.size.z;
    154.         float zMaxNorm = zMax / origTerrain.terrainData.size.z;
    155.         float dimRatio1, dimRatio2;
    156.  
    157.         // Height
    158.         td.heightmapResolution = heightmapResolution;
    159.         float[,] heights = origTerrain.terrainData.GetHeights(
    160.                       Mathf.FloorToInt(xMinNorm * origTerrain.terrainData.heightmapWidth),
    161.                       Mathf.FloorToInt(zMinNorm * origTerrain.terrainData.heightmapHeight),
    162.                       Mathf.FloorToInt((xMaxNorm - xMinNorm) * origTerrain.terrainData.heightmapWidth),
    163.                       Mathf.FloorToInt((zMaxNorm - zMinNorm) * origTerrain.terrainData.heightmapHeight));
    164.         float[,] newHeights = new float[heightmapResolution, heightmapResolution];
    165.         dimRatio1 = (float)heights.GetLength(0) / heightmapResolution;
    166.         dimRatio2 = (float)heights.GetLength(1) / heightmapResolution;
    167.         for (int i = 0; i < newHeights.GetLength(0); i++)
    168.         {
    169.             for (int j = 0; j < newHeights.GetLength(1); j++)
    170.             {
    171.                 newHeights[i, j] = heights[Mathf.FloorToInt(i * dimRatio1), Mathf.FloorToInt(j * dimRatio2)];
    172.             }
    173.         }
    174.         td.SetHeightsDelayLOD(0, 0, newHeights);
    175.  
    176.         // Detail
    177.         td.SetDetailResolution(detailResolution, 8); // Default? Haven't messed with resolutionPerPatch
    178.         for (int layer = 0; layer < origTerrain.terrainData.detailPrototypes.Length; layer++)
    179.         {
    180.             int[,] detailLayer = origTerrain.terrainData.GetDetailLayer(
    181.                     Mathf.FloorToInt(xMinNorm * origTerrain.terrainData.detailWidth),
    182.                     Mathf.FloorToInt(zMinNorm * origTerrain.terrainData.detailHeight),
    183.                     Mathf.FloorToInt((xMaxNorm - xMinNorm) * origTerrain.terrainData.detailWidth),
    184.                     Mathf.FloorToInt((zMaxNorm - zMinNorm) * origTerrain.terrainData.detailHeight),
    185.                     layer);
    186.             int[,] newDetailLayer = new int[detailResolution, detailResolution];
    187.             dimRatio1 = (float)detailLayer.GetLength(0) / detailResolution;
    188.             dimRatio2 = (float)detailLayer.GetLength(1) / detailResolution;
    189.             for (int i = 0; i < newDetailLayer.GetLength(0); i++)
    190.             {
    191.                 for (int j = 0; j < newDetailLayer.GetLength(1); j++)
    192.                 {
    193.                     newDetailLayer[i, j] = detailLayer[Mathf.FloorToInt(i * dimRatio1), Mathf.FloorToInt(j * dimRatio2)];
    194.                 }
    195.             }
    196.             td.SetDetailLayer(0, 0, layer, newDetailLayer);
    197.         }
    198.  
    199.         // Splat
    200.         td.alphamapResolution = alphamapResolution;
    201.         float[,,] alphamaps = origTerrain.terrainData.GetAlphamaps(
    202.             Mathf.FloorToInt(xMinNorm * origTerrain.terrainData.alphamapWidth),
    203.             Mathf.FloorToInt(zMinNorm * origTerrain.terrainData.alphamapHeight),
    204.             Mathf.FloorToInt((xMaxNorm - xMinNorm) * origTerrain.terrainData.alphamapWidth),
    205.             Mathf.FloorToInt((zMaxNorm - zMinNorm) * origTerrain.terrainData.alphamapHeight));
    206.         // Last dim is always origTerrain.terrainData.splatPrototypes.Length so don't ratio
    207.         float[,,] newAlphamaps = new float[alphamapResolution, alphamapResolution, alphamaps.GetLength(2)];
    208.         dimRatio1 = (float)alphamaps.GetLength(0) / alphamapResolution;
    209.         dimRatio2 = (float)alphamaps.GetLength(1) / alphamapResolution;
    210.         for (int i = 0; i < newAlphamaps.GetLength(0); i++)
    211.         {
    212.             for (int j = 0; j < newAlphamaps.GetLength(1); j++)
    213.             {
    214.                 for (int k = 0; k < newAlphamaps.GetLength(2); k++)
    215.                 {
    216.                     newAlphamaps[i, j, k] = alphamaps[Mathf.FloorToInt(i * dimRatio1), Mathf.FloorToInt(j * dimRatio2), k];
    217.                 }
    218.             }
    219.         }
    220.         td.SetAlphamaps(0, 0, newAlphamaps);
    221.  
    222.         // Tree
    223.         for (int i = 0; i < origTerrain.terrainData.treeInstanceCount; i++)
    224.         {
    225.             TreeInstance ti = origTerrain.terrainData.treeInstances[i];
    226.             if (ti.position.x < xMinNorm || ti.position.x >= xMaxNorm)
    227.                 continue;
    228.             if (ti.position.z < zMinNorm || ti.position.z >= zMaxNorm)
    229.                 continue;
    230.             ti.position = new Vector3(((ti.position.x * origTerrain.terrainData.size.x) - xMin) / (xMax - xMin), ti.position.y, ((ti.position.z * origTerrain.terrainData.size.z) - zMin) / (zMax - zMin));
    231.             newTerrain.AddTreeInstance(ti);
    232.         }
    233.  
    234.         gameObject.transform.position = new Vector3(origTerrain.transform.position.x + xMin, origTerrain.transform.position.y, origTerrain.transform.position.z + zMin);
    235.         gameObject.name = newName;
    236.  
    237.         // Must happen after setting heightmapResolution
    238.         td.size = new Vector3(xMax - xMin, origTerrain.terrainData.size.y, zMax - zMin);
    239.  
    240.         AssetDatabase.SaveAssets();
    241.     }
    242.  
    243.     void stitchTerrain(GameObject center, GameObject left, GameObject top)
    244.     {
    245.         if (center == null)
    246.             return;
    247.         Terrain centerTerrain = center.GetComponent<Terrain>();
    248.         float[,] centerHeights = centerTerrain.terrainData.GetHeights(0, 0, centerTerrain.terrainData.heightmapWidth, centerTerrain.terrainData.heightmapHeight);
    249.         if (top != null)
    250.         {
    251.             Terrain topTerrain = top.GetComponent<Terrain>();
    252.             float[,] topHeights = topTerrain.terrainData.GetHeights(0, 0, topTerrain.terrainData.heightmapWidth, topTerrain.terrainData.heightmapHeight);
    253.             if (topHeights.GetLength(0) != centerHeights.GetLength(0))
    254.             {
    255.                 Debug.Log("Terrain sizes must be equal");
    256.                 return;
    257.             }
    258.             for (int i = 0; i < centerHeights.GetLength(1); i++)
    259.             {
    260.                 centerHeights[centerHeights.GetLength(0) - 1, i] = topHeights[0, i];
    261.             }
    262.         }
    263.         if (left != null)
    264.         {
    265.             Terrain leftTerrain = left.GetComponent<Terrain>();
    266.             float[,] leftHeights = leftTerrain.terrainData.GetHeights(0, 0, leftTerrain.terrainData.heightmapWidth, leftTerrain.terrainData.heightmapHeight);
    267.             if (leftHeights.GetLength(0) != centerHeights.GetLength(0))
    268.             {
    269.                 Debug.Log("Terrain sizes must be equal");
    270.                 return;
    271.             }
    272.             for (int i = 0; i < centerHeights.GetLength(0); i++)
    273.             {
    274.                 centerHeights[i, 0] = leftHeights[i, leftHeights.GetLength(1) - 1];
    275.             }
    276.         }
    277.         centerTerrain.terrainData.SetHeights(0, 0, centerHeights);
    278.     }
    279. }
    280.  
     
    recon0303 likes this.
  18. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Hmmmmm this seams to be cool. I will test that:) If this will work yeah that would be awsome;)




    Almost every aspect is ready:

    Update "1.9"
    Probable upload 20.02.2017
    - System that holds or moves player to safe place during loading time. (done)
    - System which manage physics when player is far from objects (done)
    - Terrain culling camera setup changes (done)
    - Manual update
    - Small fixes (done)
    - Exception script for terrain at neighbour LOD system (done)
    - Removes warnings for 5.3+ (done)
    - Light and GI additional manager ( probable but not for sure moved to 1.9.1)
    - Streamer should works with catalogs in hierarchy.(done)
     
    Last edited: Feb 10, 2017
  19. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    I can confirm that this works 100%, and is way better than most other solutions for splitting. I recommend contacting the author and seeing if you can include it with your asset. I just about gave up on this asset until I ran into this free tool. Don't get me wrong, your asset is awesome and does an amazing job, but without a proper terrain splitter, it was worthless to me. I was going for a refund until I ran into this.

    I tested it out, and I am quite happy with the way everything works now.
     
  20. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Is there a way to see chunk borders in game built in?
     
  21. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Only editor gizmo. If you want gizmos in build we could add it in 1.9. Update haven't been closed yet, probably I will upload it this week.
     
  22. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    That would be pretty dope. Thanks for the help.
     
  23. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    We will add this in 1.9.1 After discussion it's not so easy. Unity do not show gizmo in builds so we have to do by other way.

    Version 1.9 will be uploaded probably tommorow, we add also some fixes to our systems:)
    Version 1.9.1 will be shortly after 1.9
     
  24. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Version 1.9 is online!:)
     
    imDanOush likes this.
  25. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    Good! When would the 1.9.1 with the "Light and GI additional manager" goes online? I want to use SEGI and I have Unity 5.5. (So I am not using the new GI system or the current one that Unity has) So would the next update affects my project anyway? What other things the next update do? tnx.
     
    Last edited: Feb 19, 2017
  26. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    We will upload 1.9.1 ASAP probably 1-2 weeks.
    BTW we had issue in 1.9 with scene generation. If you have error during this proces simply replace this file. Hot fix will be uploaded right now but it will wait for acceptation.
    https://www.dropbox.com/s/pqovxp7xv9n143x/SceneSplitterEditor.cs?dl=0
     
    Last edited: Mar 15, 2017
  27. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    We just made it. Now tests :).
    You could stream in many layers, Check out video tutorials, terrain, meshes and other objects are in many layers like: small object, medium objects, big objects, terrain, far view terrain etc..Local area updater give you ability to refresh world without working on big scene.
     
    imDanOush likes this.
  28. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hello I'm starting to use your asset and I'm having a problem.

    I follow his videotutorial, I create a terrain with Terrain Composer2 of 10x10 tiles. But when I try to generate the grids by pressing the "Split scene into virtual grid" button, these are not generated ...

    I leave a photo to see the configuration I make. I think it's fine, but I do not know why the problem occurs. Could you tell me what I do wrong?

    worldStreamer.jpg

    regards
     
  29. keifyb

    keifyb

    Joined:
    Feb 12, 2016
    Posts:
    62
    im still waiting for a ufps multiplayer tutorial, anyone able to make an ace vid to help?
     
  30. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Because your terrain are in parent and system is not able to find terrains inside it.
    A) you should unpack them from this parent and then split OR
    B) Use 1.9.0.5 new functions to use catalogs/parents and then system will find files inside this parent.
    Please carefully read manual and watch video tutorials. There is info about this:)
    In version 1.9.0.5 there is also demo scene with parent catalogs and assets inside.
     
  31. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    OK thanks. I will download the new version and try it out.
    regards
     
  32. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Version 1.9.1 will be uploaded tommorow:)
     
  33. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    I noticed that I could get the local_pos instead of world_pos of an object relative to its terrain, and not the world. How are the terrains indexed? In other words, let's say I wanted to store a database of creatures, and I wanted to serialize their positions when you leave a terrain, and then load them back up when you enter. What is the best identifier for that terrain? The string name of the scene its in? The terrain ID?
     
  34. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Yes virtual grid name/ scene name contain information about position and range of scene/virtual grid. For example 0 means 0-xxx where xxx is size of the terrain. 1 means xxx-yyy where yyy is terrain size x2. Hmmmm try to modify our physic manager. Just replace our code which freeze object by your code and functions.
     
  35. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    I am dropping the save and load chunk serializers into the world streamer, I just need to know the best way to setup a unique identifier for each terrain in the save database. I didn't know if you had something already setup like tagging the terrain objects with an id, or if I need to do it by string ordinals.
     
  36. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    I just give advice that this script could help you but it depends what you need :) but from this what i hear my idea was wrong. Unique identifer is in scene name. Anyway scene name is unique and contains info about position of the object in the world.
     
  37. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Alright. Thanks. I guess the string name of the scene is the best route as a unique id.
     
  38. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Hi NatureManufacture,

    I am still getting large framerate drops whenever tiles are loaded/unloaded. I think I've narrowed it down to essentially "garbage collection". Whenever a terrain tile is loaded, the GC causes a noticeable framerate drop (at least I think it's the GC). Is there anyway to avoid this? Or maybe I'm doing something wrong?

    My terrain tiles are 2k X 2k in size. If I were to shrink my terrain tile size would it lower the GC lag spikes? What do you think is better, loading smaller terrain tiles (but more often), or loading larger terrain tiles (but less often)?

    Here are two pictures of my profiler data showing the GC spikes:



     
  39. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    This is build or editor? Check gc on build because at editor memory acces is really slow. Btw at manual is info from where GC spike came in unity and how to fix it. Anyway I would be glad to help you;)
     
    Last edited: Mar 1, 2017
  40. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    From my experimentation, 2kmx2km is FAR too large. That's like loading an entire level. The point is you are splitting a large terrain into bite-sized chunks. We load 250mx250m at a time, and even then that's pushing it. Ideally I want to have 100mx100m chunks, but we just can't do that since our terrain is 100kmx100km, literally not enough memory to split that into 100mx100m chunks. So we settled with 250mx250m.

    Since we had to settle with such large chunks, we have to be sparing with how we put down meshes and objects.
     
  41. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Just take a look at this video:

    It have few km view. At short distance we load heavy detailed terrain, at far distance we keep only terrain which is converted to low poly mesh.
     
  42. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    To be fair when I say heavy, we probably have 20-30 speedtree trees, hundreds of meshes, and dozens of characters alone on each 250m chunk.
     
  43. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437

    Yes, I have the read the manual in full. And I see many places where you mention about loading models separately, which makes sense. But these terrain tiles I'm loading have no models on them at all. It's just the terrain tile with textures.

    In a build I actually have not tested it with the profiler itself yet, however just in casually playing the game during a build, I can definitely notice the framerate drop when a terrain tile is loaded/unloaded. Especially when moving the camera around, the game definitely freezes for a second, and it's noticeable. Like I said above, these terrain tiles I'm loading have absolutely nothing on them. They are flat, bare pieces of tile with no trees or meshes or anything on them (just textures on a flat terrain).

    It's going to be a lot of work, but maybe I'll try using smaller terrain tiles to see if that works or not. At any rate, I'll take this to your support so that we don't have to discuss all of the fine details here. Thank you :)

    P.S. What is the best way to contact you for support? Thank you.
     
    Last edited: Mar 1, 2017
  44. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    I see. That is interesting. Maybe I am using way too big of terrain size. But I think the video NatureManufacture posted shows that he is somehow getting it to work, even with really large terrain sizes.......so that makes me wonder if maybe I'm doing something else wrong, and the terrain tile size isn't the issue. But I'm not sure.
     
  45. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    Hmmm did you tested it with scene streamer and camera only which moves? I really use it with huge amount of data and it takes 3-6ms. . ms depends on number of objects at the scene and if there is leaking script at the scene it could be problem. Try to test it on clean scene with camera moving and terrain streamer. What platform pc or mobile? If mobile this could be unity grass. Pc shouldnt have problem with grass as i use it and test many times.
     
  46. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    It's for PC. I'll try and see what happens (test it). It might be in a day or two though, so it might be awhile, just so you know. Do you have a support email? Or should I keep posting here? Thank you.
     
  47. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    At each page of manual you have contact to me;) Skype and e-mail:) GC means to many objects at the scene while searching or scripts with memory leaks. I saw also it was from grass at mobiles so people should use custom grass like infinity grass, unature whole unity grass is boken at mobiles. For pc as you saw at movie works smooth hmmm but yeah I could take a look on this but first you have to make this test.
     
  48. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    I haven't watched all the tutorial videos yet but does one of them cover streaming colliders for interiors? None of the titles mention them. I read a post that there would be one and the only example video you posted about colliders has been marked private(I assume because of age/1.5 era).
     
  49. NatureManufacture

    NatureManufacture

    Joined:
    May 20, 2014
    Posts:
    2,026
    I didn't make collider streaming tutorial yet but it is extremelly easy in use:) I will make such video but hmmm atm I have huge amount of work and im a bit overloaded.
     
    recon0303 likes this.
  50. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    I am looking at the manual right now, but I don't see any e-mail or Skype at all. :( Which manual are you referring too? I am looking at the one that came with the asset, in the "Manual" folder.

    Yes, I will try to test it when I have time, and then I'll let you know. Thank you.