World Streamer学习1

1、首先找到插件包,可以淘宝买个便宜的。

2、导入到unity项目:World Streamer v1.9.6.unitypackage

3、文件夹:
在这里插入图片描述

4、读World Streamer Manual.pdf

world steamer is a memory async streaming system. by using it you are able to stream your whole game from a disc in any axis and space. you can create endless space games, 2D platformers, 3rd person, open worlds, mobile apps, architectural presentations(建筑展示), single, multiplayer, or any kind of game you want without loading screens during player movement. u are able to create endless looped worlds or planet imitation (行星模拟).

all scene assets will be stored on the disk as scene files (所以的场景资源都被储存在硬盘上的场景文件中)and the will be loaded only when they are close enough or when they meet the required conditions. this solution reduces CPU, RAM, GPU usage, and performance in your game will be much ,much better and your application will load much faster. with streaming you will reduce the object count in your scene and you can create very detailed and large scenes without the performance drop. world streamer gives you the ability to create your scenes, as big as you want, without any limits.

“floating point fix systems” removes restrictions end errors caused by huge coordinates in the engine. with “local area updater” you can work on a small, local area without loading the entire world. easily add these changes to the world by clicking just 2 buttons. this means you will not have unity editor slow down, because of loading entire world into the editor scene.

u can also separate your world into layers such as lighting, AI, Geometry far in the distance, Geometry Near, Trees, etc. ring streaming gives you the ability to replace objects in the distance with lower level of detail models. you are able to replace detailed terrain with lower poly mesh when it is far in the distance. collider streaming gives you the ability to load buildings, rooms, caves, interiors, etc, when you are close enough to them and when you enter/hit the collider or portal which triggers them.

world streamer is a perfect solution for teams that work on the same project at the same time, even in the same area. team members are able to work on separate areas of the world and then save their changes into the world when ready using local area updater. team members can work in the same area at the same time as well, by working different layers.

===========================================================================

chapter 1——idea of streaming —— very important

the idea is pretty simple. your huge world will be split into smaller parts by our tools. These parts are elements on a virtual grid. World Streamer will load these virtual grid elements when an “object” (player or other object) is close enough to the grid element. You can also load grid elements when the player hits a collider (collider streaming).

In most cases, we recommend to use the player as this “object”, not the camera. For RTS games or 2D platform games, setting the camera as the followed object is a better solution. Because we save everything as a scene, you can still use lightmaps, navmesh, GI, batching, baked colliders and everything that you can save in a scene. You could use a custom culling solution or cull objects by removing them from memory and the scene, when they are far enough away or behind wall. For an example of objects culled by streaming, you could load small stones only when you are really close to them or use collider streaming to load building interior only when you are on the correct floor or close to the entrance.

with world streamer you are able to replace grid elements with grid elements from another layer depending on distance. you can use this as a LOD solution for objects that unity’s LOD system does not support or for objects where LOD0 is really heavy——like unity terrain objects. you can replace your unity terrain with a simple mesh when it is at a far distance, this will greatly reduce culling and refresh operations (CPU) and memory usage. unity terrains can be very heavy so this can save hundreds MB of RAM. more info about working with unity terrains, objects, etc are found further in this manual.

World Streamer contains has the ability to stream in layers, which means that you can put different objects on different layers. For example, you could have a layer for terrain, one for trees, one for rocks, and one for sounds effects. Each layer will load objects independently.

A good way to use layers is to group objects together by size and load only small objects near the player, but have larger objects loaded in the distance. For example, buildings which need to be seen in the distance can be on their own layer, medium sized details like boxes and lanterns could be added to a ‘Medium’ distance layer, while smaller details like papers, dirt, and small stones are added to their own layer as well. For the terrain, a layer containing a detailed terrain can be used when the player is near and when the player is far away from the terrain, a separate layer with a low poly mesh of the terrain can be shown.

The basic idea is to split your world into many virtual grid elements in many different layers and then load them asynchronously without any CPU impact to save a lot of performance in CPU, GPU, RAM, VRAM.

===========================================================================
chapter 2——world system project requirement

You must add the following tags to the project: SceneStreamer, WorldMover, ColliderStreamerManager.

SceneStreamer
The SceneStreamer tag must be assigned to any GameObject that uses a Streamer.cs script.
The _Streamer_Major and _Streamer_Minor prefabs must have the SceneStreamer tag.

WorldMover
The WorldMover tag must be assigned to any GameObject that uses a WorldMover.cs Script.
The _World_Mover prefab must have the WorldMover tag.

ColliderStreamerManager
The ColliderStreamerManager tag must be assigned to any GameObject that uses a ColliderStreamerManager.cs script.
The _Collider_Streamer_Manager prefab must have the ColliderStreamerManager tag.

在这里插入图片描述

these streamer system prefabs must all have tags! if you do not add them, world streamer can not load anything at build or even in the editor. you will get many errors if you have not added the required tags. always check tags in new project.

准备一个工作场景,它是你要进行分割的原始场景
to start you need work scene where you hold all models that will be streamed from the disc. this scene or scenes will be able to split your world into virtual grid elements, multiple layers. if you have unity 5.3+, this scene could be used once because whole work could be continued on split scenes. of course u could recreate work scene again from split scenes by local scene updater tool.

all models and objects in work scene should be unpacked from catalogues in hierarchy. All info about how streamer holds, recognizes your models/objects, terrains you will find in manual in proper section. Don’t worry there will be no mess after virtual grid creation.

To stream you need “Gameplay” scene where you hold: player, direction light, camera, your UI, everything else (world) could be loaded from the disc. You will put streamer prefabs there and they will load everything that you want. Please prepare it before you start. You will fill streamer prefabs when your world will be split in many parts.

===========================================================================
chapter 3——quick start ——Test Scene

  1. You must configure the proper Tags to use the demo scenes please check “2 World Streamer project requirements.” section.
    2 Open any Gameplay world streamer demo scene. “WorldStreamer” catalog→"Tutorial Work and Game Scenes"→Choose Game scene.
    Advanced scenes use ring streaming (terrains), collider streaming and looped unity terrains, they are more spectacular. In our example we will show Advanced Scene.

在这里插入图片描述

3 Click on each streamer object in your hierarchy and click “add to build settings” button. We must have all grid elements (scenes) in our build settings. Without this we could not load them.

在这里插入图片描述

4 If you have opened simple scene instead of advanced you can skip this step.
As we also stream models by collider streaming in our Advanced Game scene, we have to add our scene with building interior to build settings so:“WorldStreamer” catalog → “SplitScenes” → “ColliderScenes” → “Prefabs” →Medium_Collider_Streaming_Floor_0_stream
Then you have to click add to build settings button. Do the same operations for “Floor_1”, “Floor_2”.
在这里插入图片描述

Of course there is easier, more automatic and faster way to do this but now we want to show some basic information about how system works.

5 Hit play and run around, take a look how everything is streamed.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值