loading range is an integer value in each axis that precise virtual grid elements radius that u want hold at RAM memory at once.
loading range could be different for every axis in your world. when u click on streamer object u could see gizmo at your screen with current loading range area, look at screen above.
loading range could be different for every axis in your world. if world is looped loading range must be shorter than half your world in virtual grid elements minus 1 virtual grid element.
如果你的世界是循环的话,那么加载的范围一定要比世界的一半减1要小。
比如说你的世界是9个格子,也就是3x3,那么加载的范围最大是3-1=2。
use loading range min,checkbox it allows u to use “loading range min” we called this ring streaming. 环形流
this is our fresh system that allows u to load objects in specific range “from” - “to”. we called it ring streaming because area looks like ring.
if objects are too close they will be removed, if they will be too far they also will be removed.
loading range min, ring stream is an integer value in each axis that precise virtual grid elements radius that u want to cut out from “loading range”. streamer will load everything in the ring. if u will be close enough it will remove modes from memory or does not load them. it is useful to replace models/objects in close distance by models/objects from other layers. when u click on streamer object u could see gizmo
deloading range is an integer value that precise radius after which system will unload virtual grid elements (scene).
remember!!! virtual grid element will be unloaded after time that u set in “destroy tile delay”, so first criterion 第一评判标准 is distance then time。第一判断规则是距离,其次是时间。if world is looped deloading range must be shorter than half of your world in virtual gird elements minus 1 virtual grid element. 如果是循环世界也遵从上面的规则,格子数要是世界一半减1。
position check is the position refreshing time in seconds. streamer is loading/unloading your world saved in virtual grid elements (scenes) depending on followed object “Player/Camera” position in XYZ world.
first of all, there are few things that need to be said before u start to stream your terrain. if u want to stream unity terrain, it must be in parts. each unity terrain part generates static CPU usage and dynamic when u load next title. all of this performance eaters(性能吞食者,哈哈哈哈) could be solved or reduced.
information about how to solve/reduce this u fill find in 5.5 section. terrain in our system could be looped and replaced by low poly meshes in far distance. read carefully whole info that we give u in “5. Terrain Streaming” section, it could save u a lot of time and guarantee extremely good performance in relation to any other available solutions.
5.1 terrain preparation (unity terrain, low ploy mesh, custom solutions)
to stream(from 百度, 一个接一个的移动) your terrains u have prepare them for this process.
free tool (best from users practice)
https://github.com/dbircsak/blog/blob/master/SplitTerrain/Assets/Editor/SplitTerrain.cs
World Composer https://www.assetstore.unity3d.com/#!/content/13238?aid=1011lGkb
World Creator https://www.assetstore.unity3d.com/#!/content/55073?aid=1011lGkb
remember to leave your scene terrain untouched because u could change your mind about virtual grid element size! 就是备份好一个没有切割的地形,因为随时会改变切割的方案。
You could generate your world already in tiles by:
World Creator Professional (our close friends and we are in cooperation):
https://www.assetstore.unity3d.com/en/#!/content/55073
World Creator Standard (our close friends and we are in cooperation):
https://www.assetstore.unity3d.com/en/#!/content/54631
Terrain Composer 1/2 (we are also in cooperation with Nathaniel for very long time)
https://www.assetstore.unity3d.com/en/#!/content/65563
Gaia (we are also in cooperation)
https://www.assetstore.unity3d.com/en/#!/content/42618
developers always ask how big this terrain chunks should be? basically it is your choice we could give u a few tips, depending on way that u chose.
a) if u do not want to use ring streaming and low poly mesh at far distance instead of unity terrain, your each terrain tile should be size 110% of your camera far view. this will guarantee low static cpu usage, because u will set loading range to 1 and only 9 terrain titles will be loaded. such big titles also mean quite big memory consumption but not tragic and quite big cpu consumption from static culling (many tree objects). 加载9块,浪费内存,以及CPU的剔除计算。we advise size 110% of camera far view because probably nobody wants to see how terrains are loading (appera). this could happened from time to time. whit 110% u leave this 10% of “time” for loading process.
我讲解下,为何是10%的时间,去加载一块地形。
人物为红点,走到红线的时候,距离边界还有10%的距离,就开始加载第二个块。
b) if u ring streaming to replace far terrains by low poly mesh which is much, much better solution, your terrain chunks/parts should be 10-50% of camera far view. 10% is good if u want to have control on terrain details by in game options. 30-50% is good if you just want to leave terrains like they are. advantages of this solutions is that u have very far view and u spent only few verts/tris and 1 drawcall per each low poly mesh as terrain. u could handle many terrain tiles because many of them are simple meshes and unity terrains are small, they hold smaller amount of data and their refreshing time is short. by streamer loading range and loading range min u could adjust when your terrain will become low poly mesh. this is dynamic option so could be changed during gameplay. player chould choose the level of details.
c) if u use only low poly mesh instead of unity terrains (probably mobile games), u could use any size but remember to engage number of titles with camera far view(使用摄像机远平面能看到的块数). it is good to hold amount and size of loaded titles in relation 110% of camera far view, 最好保证加载的块数是摄像机远平面的1.1倍, only because of terrain appears/show on. u left this 10% of “time” for loading new tiles.
custom terrain solutions are always difficult because we do not test all of them so probably it will be combination of “b” and “c” point in this section.
we can move to next step when your terrains are in parts like this:
first terrain should have a starting position xyz from full rounded position like : 5000, -5000, 0,1000,500,-100 etc not like 99.98, 0.1,-0.018,地形的起始点坐标必须是整数。this kind of wrong positions, could effect in unexpected terrain offsets in virtual grid elements. remember virtual grid elements starts from 0,0,0 and unity terrain pivot is in it’s corner, this sometimes could effect in offset
between terrain and virtual grid borders. u could simply remove this offset by placing terrains on positions which are multiples of their size. for example if terrain tile size is 500x500, virtual grid element size is 500x500, then terrain objects must lie on positions like 500,0,-500,1000,-1000 and other multiples of 500. 也就是说如果地形的大小为500x500,虚拟的格子也是500x500,那么地形必须放置500的倍数的位置. this will synchronize virtual grid elements with terrains. 这样地形和虚拟网格就能保持同步。
Rename your terrain objects by adding word “Terrain_LOD0_” at their names beginning or “Terrain_LOD1_” for low poly terrain mesh. of course this could be any word, we give just an example. this word will be used during splitting/segregation process which put’s terrains in correct virtual grid elements and layers. u could use this free asset to rename your terrain objects, it is easy and fast: Ez Files Rename:https://assetstore.unity.com/packages/tools/utilities/ez-rename-31082?aid=1011lGkb&utm_source=aff
create prefabs from these terrains, this is not necessary but it gives access to them without opening the scene so it’s useful. u could create prefabs when u will be sure that terrain parts size are fit for your game. probably u will be sure of them after u will see how streaming goes.
unpack your terrains from all mother/parent folders like at this screen or use our “Object_Parent” script like in “Tutorial World Streamer - Advanced_Work_Scene_Catalogs” demo scene:
5.2 scene split and virtual grid setup
we are going to put them into correct virtual grid element automatically. now u should follow this steps:
open empty scene and save it, then u should copy your terrains here. u could call this scene as “work” scene.
open “Scene Splitter” window by clicking at world streamer => scene spliiter.