Presentation is loading. Please wait.

Presentation is loading. Please wait.

Techniques for Improving Large World and Terrain Streaming Danie Conradie Trinigy Inc.

Similar presentations


Presentation on theme: "Techniques for Improving Large World and Terrain Streaming Danie Conradie Trinigy Inc."— Presentation transcript:

1

2 Techniques for Improving Large World and Terrain Streaming Danie Conradie Trinigy Inc.

3 Overview  Online and MMO games have very specific requirements  Large shared environments for players to interact in instead of distinct game “levels”  Introduces many new technical and design challenges

4 Challenges  Naïve approach of loading all the game resources does not scale to large worlds:  Too long loading times  Too large memory footprint  Co-operative editing required

5 Goal  Don’t load all the data  Dynamically load and unload data as needed  Maintain the minimum required data set during runtime

6 Basic Streaming

7  Keep all the object instances in memory  Instances don’t need a lot of memory (Position, rotation, scale, state, …)  Stream required resources in/out  Resource data (meshes, textures, etc.) requires significantly more

8 Basic Streaming  Load resources in the region around the character  Unload resources that are not visible anymore

9 Basic Streaming  Problems:  Need to keep all objects in memory  Little control over streaming behavior  Irregular and unpredictable streaming  Difficult to schedule without resource dependencies

10 Requirements for Streaming  How can we improve on this?  What do we need from the art tools?  What do we need from the engine run-time?  How should we prepare (bake) the data?

11 Pipeline Art ToolsEngine Setup data for streaming Stream optimized data Bake

12 Tool requirements for Streaming

13  Cooperative editing  Stream-able world data  Resource dependencies  Grouping

14 Tool requirements for Streaming  Cooperative editing  Multiple people should be able to edit the world together  Need to solve/prevent editing conflicts  Store a scene as multiple layer files  Layers can be locked and edited independently by different people  Synchronization with revision control

15 Tool requirements for Streaming  Stream-able world data  No monolithic world files  Break large files up into separate files for editing and streaming  Art tools must promote and enable the reuse of mesh instances

16 Tool requirements for Streaming  Resource dependencies  Calculate and store all the resource dependencies in the world Scene Mesh Texture Shader

17 Tool requirements for Streaming  Grouping  Gives us more control over how data is:  Edited  Baked  Streamed

18 Tool requirements for Streaming  Terrain Sectors  Automatic grouping as a 2D grid  Sectors give us manageable data chunks to edit, bake and stream

19 Tool requirements for Streaming  Terrain Sectors  Terrain data can be 100s of MB  Only keep relevant sectors in memory  Stream in, swap out as required  Lower detail approximations for distant sectors

20 Tool requirements for Streaming  Terrain Sectors  Real-time editing and painting  Supports cooperative editing  Locking is per sector  Editor automatically locks and takes care of continuities

21 Tool requirements for Streaming  Zones  Object instances can be grouped spatially into zones by level designers  Each zone generates a separate file that can be streamed in dynamically as the player approaches  Allows us to spawn/destroy groups of objects

22 Tool requirements for Streaming

23  Data processing  Procedural/raw data while editing  Baked data for the runtime Art ToolsEngine Editor dataOptimized data

24 Tool requirements for Streaming  Data processing: Terrain Sector  One file per sector containing:  Height map  Texture mixing maps  Bake n most significant textures  Vegetation probability maps  Pre-compute object instances

25 Tool requirements for Streaming  Data processing: Terrain Sector  Level of Detail  Pre-compute error metrics  World-space normal maps  Custom index lists

26 Tool requirements for Streaming  Data processing: Zones  Build a list of resources used by each zone at export time  The editor knows which resources (and dependencies) were used

27 Tool requirements for Streaming  Data processing: Zones  At runtime the resource list will be processed and loaded in order  Sort according to dependencies so loading doesn’t need to stall (e.g. a shader library is a prerequisite for loading a mesh)

28 Tool requirements for Streaming

29 Stone01.dds Stone02.dds Interior01.dds Wall01.dds Window01.dds Window02.dds Door01.dds Brick01.dds Wood01.dds Castle.mesh House01.mesh House02.mesh Tool requirements for Streaming

30 Stone01.dds Stone02.dds Interior01.dds Wall01.dds Window01.dds Window02.dds Door01.dds Brick01.dds Wood01.dds Castle.mesh House01.mesh House02.mesh Tool requirements for Streaming

31 Stone01.dds Stone02.dds Interior01.dds Wall01.dds Window01.dds Window02.dds Door01.dds Brick01.dds Wood01.dds Castle.mesh House01.mesh House02.mesh Tool requirements for Streaming

32 Stone01.dds Stone02.dds Interior01.dds Wall01.dds Window01.dds Window02.dds Door01.dds Brick01.dds Wood01.dds Castle.mesh House01.mesh House02.mesh Tool requirements for Streaming

33 Stone01.dds Stone02.dds Interior01.dds Wall01.dds Window01.dds Window02.dds Door01.dds Brick01.dds Wood01.dds Castle.mesh House01.mesh House02.mesh 1 1 2 1 3 2 1 2 1 RefCount Tool requirements for Streaming

34 Stone01.dds Stone02.dds Interior01.dds Wall01.dds Window01.dds Window02.dds Door01.dds Brick01.dds Wood01.dds Castle.mesh House01.mesh House02.mesh 1 1 2 1 3 2 1 2 1 Sort List Tool requirements for Streaming

35 Stone01.dds Stone02.dds Interior01.dds Wall01.dds Window01.dds Window02.dds Door01.dds Brick01.dds Wood01.dds Castle.mesh House01.mesh House02.mesh 1 1 2 1 3 2 1 2 1 Sort List Tool requirements for Streaming

36 Run-time requirements for Streaming

37  Resource Management System  Streaming Zones  Streaming Terrain Sectors

38 Run-time requirements for Streaming  Resource Management System  Dynamically loading/unloading  Reference counting  Memory usage information  Resource dependency information

39 Run-time requirements for Streaming  Time stamp to evaluate the last time a resource was used  Resources that have not been used for x seconds can be unloaded  Hard and soft memory limits  Distinct resource pools for textures, meshes etc.

40 Run-time requirements for Streaming 

41 Run-time requirements for Streaming: Zones  Streaming Zones  Pre-caching for all resources:  Separate thread:  Load resource data from file  Optional data conversion/generation  Main thread: Create resource

42 Run-time requirements for Streaming: Zones  Create all object instances in the zone once the resources have been loaded  This is fast since the resources have already been loaded  Optionally spread over time (i.e. start with largest/most important objects)

43 Run-time requirements for Streaming: Zones  What if the player teleports directly into a zone with pending resources?  Option A: Show replacement resources (e.g. very low res textures)  Option B: Objects pop up as soon as relevant resources are available  Option C: Pause the game and load remaining resources from the main thread

44 Run-time requirements for Streaming: Terrain  Terrain sectors  Distant sectors load and render using lower detail geometry and textures  Stream in high detail versions  Use world-space normal maps to avoid lighting artifacts/popping

45 Video

46 Questions?


Download ppt "Techniques for Improving Large World and Terrain Streaming Danie Conradie Trinigy Inc."

Similar presentations


Ads by Google