Object Container Streaming

Technology behind Star Citizen that eliminate loading screen
Revision as of 17:53, 21 May 2021 by imported>Alistar Bot (→‎References: Depreciate SEO template, replaced: {{SEO}} → {{subst:Void}})
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Object Container Streaming (OCS) is the umbrella term for all the technology in Star Engine that makes a vast seamless universe possible, by which Star Citizen (and to an extent Squadron 42) can provide an extremely large virtual world through which the players can move without seeing a loading screen.[1]

Related technology

Server-Side Object Container Streaming

Server-Side Object Container Streaming (SOCS) is a streaming technology needed to expand the scale of the universe on Star Citizen servers.[2] The basic concept is that if no player is near an object, the game can "freeze" that object's state. And instead of keeping the frozen entity in memory (incurring a cost), the game can serialize (using Serialized Variables) its state and store the serialized state in a database. While a client is moving through the virtual world, the server updates its view into the database to restore entities now in proximity as well as free and store away no-longer-needed entities.[1]

Entity Streaming Manager and StarHash

StarHash is used to store in-game entities in a way allowing efficient searches for all entities in an area of space by utilizing a data structure called a RadixTree. The Entity-StreamingManager is then the logic-driving the StarHash-RadixTree queries to trigger loading and unloading of entities on the server, based on the positions of all connected clients.[1]

Cross Session Persistence

Cross Session Persistence allows the game to store the entity in a frozen state in an in-process database that can be used by different server or machine. It is an efficient network access layer to allow the storing of the entity in a database on a different machine. Before Cross Session Persistence, the state of an entity is lost when the server crashes or is restarted (besides the state the game already persist). With Cross Session Persistence, object state will persist over server restarts and crashes (until the persistence database is wiped).[1]

I-cache

I-cache is a back-end system and service that provides and manages reliable persistence of all player and entity data.[2] First major part of I-cache was completed and tested internally in March 2019. It was introduced as a replacement of the existing pCache. It is a highly distributed and fault-tolerant storage/query engine that greatly out-performs pCache. It provides an indexing and query system that can be utilized by other services for specific and complex item queries.[3]

Server Meshing

Server Meshing is a technology that allows the game instance to utilize multiple servers. Instead of having a single server manage all the views, the game will distribute the individual views over multiple servers. Doing this will reduce the load on each participating server. When those servers are placed on different machines on Amazon Web Services (AWS), the game can easily scale with the player count.[1]

Network Bind Culling

Network Bind Culling is the process of deciding what entities to load and unload on any client. Specifically, it works on units of Entity Aggregates, using the information of the Entity Component Update Scheduler to decide what Entity Aggregates to load or unload on each client.[1]

Network Bind Culling was first mentioned in November 2016 as entity bind culling.[4]

Entity Component Update Scheduler

Entity Component Update Scheduler is a system designed to control the update of entity components, based on how they are spatially placed relative to the player. It allows the game to skip updates of individual components which are too far away. The same information is utilized by Network Bind Culling.[1]

It was first mentioned in April 2018 as being refactored and nearly finished.[5]

Entity Ownership Hierarchy and Entity Aggregates

Entity Ownership Hierarchy keeps track of entities that are related to each other. If they are related, the game treats them as one group, or Entity Aggregate. Compared to Object Containers that split the static level geometry and objects into building blocks at level design time, Entity Aggregates are consisted of dynamic entities (e.g. players, ships, etc.) that can move around in the universe.[1]

Entity Ownership Hierarchy was first mentioned in March 2017 with the development of Entity Owner Manager.[6]

Entity Spawn Batches and Entity Snapshots

Entity Spawn Batches represent a set of entities that should be spawned together and only made active when all spawned. Entity Snapshots are the values of the Serialized Variables belonging to the entity. They are also used for serializing entity state to persistence, or for Squadron 42 save games.[1]

Serialized Variable Culling

Serialized Variable Culling is a system that would only send network updates to clients if that client is in proximity of the updated Entity-Aggregate. It provides a noticeable performance improvement on the clients. Additionally, it was the first real-life test of running our client game-simulation with only partial information of the whole universe.[1]

It was originally planned for Alpha 3.0, but was delayed to Alpha 3.1.[1]

Groundwork technology

Zone System

Zone System in the Retaliator Multi-Crew setup in July 2015

Zone System is a spatial partitioning system that divides all objects in a level into smaller entities.[7] It is required for moving large, complex, and interactive groups of physicalized objects efficiently.[8] It replaces the old CryEngine octree spatial partitioning scheme.[9]

It was proposed in January 2015 in a tech summit with tech engineers from the CIG studios, Illfonic, Behaviour Interactive, and Wormbyte.[7] The development began in May 2015 by the Frankfurt team.[9] It was deployed to the Star Citizen code mainline in June 2015.[10] It began to be integrated into various game systems by the UK, Frankfurt, and Santa Monica studios in July 2015, with Retaliator (used as the multi-crew testbed) and the Cover System were the first system being integrated.[8] Navigation mesh and characters' paths began to be integrated in August 2015.[11] The Frankfurt team extended the Zone System to better support multiple AI objects in October 2015.[12] The Frankfurt team rewrote CryEngine's AreaManager (ambient sound effects and reverbs) to integrate with the Zone System in November 2015.[13] The UK team began work on getting Object Containers to work with the Zone System in January 2016.[14] Hierarchical culling support was added in March 2016.[15] Support for tags (Tag System) was moved into the Zone System in May 2016.[16] All data in Zone System are converted into AABB tree structure in June 2016.[17] The Tag System went through a major refactoring and optimization pass in July 2016.[18] The Area system was moved into the Zone System in November 2016.[4]

C++ entity logic

C++ is a multi-thread safe scripting language which is used heavily for all kinds of entity logic. It allows resource loading in parallel to the game simulation without introducing very long wait times due to required mutual exclusion, in comparison to the old Lua code which is not multi-thread safe.[1]

It is unknown when the conversion started, the first mention of the conversion was that the spawning logic of spaceships AI was converted from Lua to C++ in January 2016.[14] It was mentioned again as a work in progress in April 2016.[19] It was mentioned as being worked on by the UK team in January 2018.[20]

Entity component

Entity component represents a part of specific game behaviour. With components, the behaviour of an entity is defined by the types of components it has. Without components, all kinds of different logic tends to be interleaved in one monolithic and very complex central logic block. Since they are smaller parts, it is much simpler to make them communicate efficiently with the game simulation while we load them concurrently. Additionally, they split the monolithic game logic into more manageable parts, which played a critical role in allowing a partial roll-out of concurrent entity initialization.[1]

Basic support of entity component was implemented in the main development branch in July 2015.[8]

Object Container

Object Container is a level building block. It replaces the old game level format. Instead of developing one large level, the content creators develop a small section. The final level (or universe) is then made out of many different Object Containers. It allows the developers to split the world into many smaller building blocks when they are building a level.[1]

The concept and first prototype of Object Container was introduced in January 2016. The UK team began to convert prefabs into containers in the same month.[14] Basic support of loading levels with Object Container instead of as levels was implemented by the Frankfurt team in the development branch in February 2016.[21] Support for LOD mesh merging and AI navigation meshes were added in August 2016.[22] The old prefab system in hangars and shops were being replaced with an Object Container in February 2017.[23]

Serialized Variables

Serialized Variables is a process to store entities state so that they can be transferred on the network and restored in the same state on a different machine. It take the parts of an entity and put it into a special wrapper object, and the wrapper object provides ways to serialize the entity state. It allows game code to be written in a uniform style, regardless of the serialized data will be transferred later.[1] Compared to the old implementation in CryNetwork, the gameplay programmer only need to mark which variables they want to replicate to the server/clients. The underlying system can detect which have changed since the last time they were sent, and which haven't, and takes care of the rest in a nice and efficient manner.[17]

The concept of Serialized Variables was introduced in June 2016, with the development started in the same month.[17]

Mega Map

Mega Map is an empty map used to load and unload Object Containers. It is used to reduce the load time, and eliminate the need of load screens.[24]

The concept of Mega Map was introduced to reduce load time of switching game modes in October 2016.[25] Support for singleplayer game maps such as hangars and single player Arena Commander was implemented in Alpha 2.6.1 in February 2017.[26] Support for multiplayer maps such as Arena Commander and Star Marine was implemented in Alpha 2.6.2 in March 2017.[27]

Development history

2015-01
  • Zone System and entity streaming were proposed[7]
2015-05
  • Zone System was being developed, and entity streaming was being investigated[9]
2015-06
  • Deployed Zone System to Star Citizen main development branch[10]
2015-07
  • Started implementing Zone System in the main development branch[8]
  • Added basic support of the entity component system in the main development branch[8]
2016-01
  • Introduced the concept of Object Container[14]
  • Started converting prefabs into containers[14]
  • Started getting containers working with the Zone System[14]
  • Converted Spawning logic of spaceships AI from C++ to Lua[14]
2016-02
  • Added basic support to load levels with Object Container instead of as levels[21]
2016-03
  • Added Hierarchical culling support to Zone System[15]
2016-05
  • Added support for tags (Tag System) into Zone System[16]
  • Added ability to reuse entity IDs[16]
2016-06
  • Started work on Serialized Variables[17]
  • Converted data structure to AABB tree in Zone System[17]
2016-07
  • Major refactor and optimization of Tag System in Zone System[18]
2016-08
  • Added Object Container support for LOD mesh merging and AI navigation meshes[22]
2016-10
  • Mega Map was being investigated[25]
2016-11
  • Moved Area system was moved into the Zone System[4]
  • Started work on Network Bind Culling[4]
2017-02
  • Implemented singleplayer maps support for Mega Map in Alpha 2.6.1[26]
  • Started work on replacing old prefab system in hangars and shops with Object Containers[23]
2017-03
  • Implemented multiplayer maps (not including PU) support for Mega Map in Alpha 2.6.2[27]
  • Started work on Entity Owner Manager[6]
2018-04
  • Refactored Entity Component Update Scheduler[5]

See also

References

  1. 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 Christopher Bolte, Ben Lesnick. "Developer Feature: The Road to Object-Container-Streaming". Jump Point. Vol. 7 no. 10. pp.3–16. Retrieved 2020-04-04.
  2. 2.0 2.1 Star Citizen: Pillar Talk - Alpha 3.9
  3. Monthly Report - March 2019. Transmission - Comm-Link. Retrieved 2020-05-25
  4. 4.0 4.1 4.2 4.3 Monthly Studio Report: November 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  5. 5.0 5.1 Monthly Report - April 2018. Transmission - Comm-Link. Retrieved 2020-05-25
  6. 6.0 6.1 Monthly Studio Report: March 2017. Transmission - Comm-Link. Retrieved 2020-05-25
  7. 7.0 7.1 7.2 Monthly Report - January 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  8. 8.0 8.1 8.2 8.3 8.4 Monthly Studio Report: July 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  9. 9.0 9.1 9.2 Monthly Report: May 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  10. 10.0 10.1 Monthly Studio Report: June 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  11. Monthly Studio Report: August 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  12. Monthly Studio Report: October 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  13. Monthly Studio Report: November 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  14. 14.0 14.1 14.2 14.3 14.4 14.5 14.6 Monthly Studio Report: January 2016. Transmission - Comm-Link. Retrieved 2020-04-04
  15. 15.0 15.1 Monthly Studio Report: March 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  16. 16.0 16.1 16.2 Monthly Studio Report: May 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  17. 17.0 17.1 17.2 17.3 17.4 Monthly Studio Report: June 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  18. 18.0 18.1 Monthly Studio Report: July 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  19. Monthly Studio Report: April 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  20. Monthly Studio Report: January 2018. Transmission - Comm-Link. Retrieved 2020-05-25
  21. 21.0 21.1 Monthly Studio Report: February 2016. Transmission - Comm-Link. Retrieved 2020-04-05
  22. 22.0 22.1 Monthly Studio Report: August 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  23. 23.0 23.1 Monthly Studio Report: February 2017. Transmission - Comm-Link. Retrieved 2020-05-25
  24. Star Citizen: Around the Verse - What is Mega Map?
  25. 25.0 25.1 Monthly Studio Report: October 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  26. 26.0 26.1 Star Citizen Alpha 2.6.1 patch notes. Comm-Link
  27. 27.0 27.1 Star Citizen Alpha 2.6.2 patch notes. Comm-Link