imac2018-3d / StoneEdge

The game's main repo.
MIT License
0 stars 1 forks source link

Prototype: World streaming #23

Closed firegreen closed 6 years ago

firegreen commented 6 years ago

Load world progressively according to the hero's location

yoanlcq commented 6 years ago

This is solved because the scripts added by the above commit have been tested in a separate Unity project and have been proven to work.

We'll need to use them when the world is finished; when that time comes, I'll be there to explain how to use stuff. But basically :

Chunks

The central class that manages the loading state of chunks. We'll want to change the ChunkID enum's variants based on the level design @firegreen and all come up with.

ChunkBridges

Components to add to invisible colliders (i.e zones) that trigger the loading of some chunks by their ID. Bridges can be either Sync (block until chunks are loaded) or Async (start loading chunk asynchronously). The best way to go is to have a smaller Sync Bridge covered by a giant Async Bridge.

ChunkEnterer

ChunkBridges only go into effect when a GameObject with a ChunkEnterer component collides with the Bridge's Collider. Typically we'll make it so that iether only the camera or either the hero has a ChunkEnterer component.