Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Please sign up or log in to edit the wiki.

Object Container Streaming: Difference between revisions

Technology behind Star Citizen that eliminate loading screen
Content deleted Content added
Alistar Bot (talk | contribs)
m Decouple timeline from wikitable, replaced: "wikitable timeline" → "timeline"
 
(32 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{Review}}
{{Editorial Note|'''Note:''' This article is a community collected information based on RTV - Object Container Streaming<ref>[https://youtu.be/E0YYKIjEC0E Star Citizen: Reverse the Verse LIVE - Object Container Streaming] {{trx|url=reverse-the-verse-7th-september-2018}}</ref>, ATV - Performance and Optimization<ref>[https://www.youtube.com/watch?v=EU0sMZbhqoU& Star Citizen: Around the Verse - Performance and Optimization] {{trx|url=around-the-verse-performance-and-optimization}}</ref> and RTV - Performance and Optimization<ref>[https://www.youtube.com/watch?v=7YPFaVK61xM& Star Citizen: Reverse the Verse LIVE - Performance and Optimization]</ref>}}


[[File:Object Container Streaming illustration from Jump Point 06 09 September 2018.webp|thumb|]]
'''Object Container Streaming (OCS)''' is a complex system in [[Star Engine]] which organizes and manages 'objects' in the game and how they come and go and interact with one another. The specific OCS updates in [[Star Citizen Alpha 3.3.0|3.3]] relate to client-side OCS which mainly deals with loading and unloading object data, server streaming for those objects, and assets related to the object which must be loaded/unloaded from the memory (RAM) on your computer. OCS are foundational pieces of the game client and server management system which are required for further advancements coming down the pipe. They will improve client performance for both [[SQ42]] and the [[PU]], allow what may become a 300+GB game on disk to work for people who only have 16GB of RAM, and provide a core system for managing and passing around objects and containers from server to server or thread to thread when [[Server Meshing]] comes along.<ref name="ocsfaq">{{RSI|ref=no|url=spectrum/community/SC/forum/3/thread/what-to-expect-from-ocs-abs-in-3-3-faq-guide|text=What to expect from OCS/ABS in 3.3 (FAQ/Guide) by @UrsaPolaris}}</ref>
'''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 [[player]]s can move without seeing a loading screen.<ref name="jp">{{Cite Jump Point|title=Developer Feature: The Road to Object-Container-Streaming|volume=7|month=10|startpage=3|endpage=16|accessdate=2020-04-04|author1=Christopher Bolte}}</ref>


Without OCS, things such as a spaceship and its contents for example are tracked by both the player client and the server at all times, which impacts performance.
== Components ==


Client side OCS currently in place means that the ship isn't tracked by the player client but by the server, unless the player goes there in which case the ship starts getting tracked on your client side as well.
=== Object ===
Pretty much anything "in the universe" that you can see or interact with is either an object or part of an object. That includes planets and moons, space stations, ships, players, cargo, weapons, missiles, torpedoes, etc.<ref name="ocsfaq"/>


Planned server side OCS won't track the ship on the client nor server side unless the player goes there, which is the best for server performance as it positively impacts latency, stability, synchronization, and performances such as AI responsiveness.
=== Container ===
Containers are part of the object system which defines what the object is inside of (child of) and what is inside of it (its children). Some examples of containers (these are all objects too) would be a solar system, the area around each planet in a solar system, the planet and moon(s) around a planet are each a container, stations are containers which may be children of any of the above, a ship is a container which will be in one of those when spawned, and players can move among all of those. Containers provide a convenient hierarchy for servers to manage areas and hand-off information between threads by container or provide points of reference for how to find any given object in the tree. Think of it like GPS for objects.<ref name="ocsfaq"/>


The servers not having to load everything all the time is essential to allow an expanded game area with more planets, moons, stations, systems etc without loading screens.
=== Asynchronous Background Streaming (ABS) ===
Asynchronous Background Streaming (ABS) is the ability for the objects mentioned in OCS above to load on their own threads (separate CPU cores) from your main game thread, thereby improving performance for your main rendering and gameplay loop, allowing it to be smoother and less impeded when major events happen like someone spawning or landing a [[Reclaimer]] near you.<ref name="ocsfaq"/>


==Related technology==
== Implementation ==
=== 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.<ref name="pt39">[https://youtu.be/tcMtPKSe2g4 Star Citizen: Pillar Talk - Alpha 3.9]</ref> 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.<ref name="jp"/>


==== Entity Streaming Manager and StarHash ====
OCS is challenging to implement because it's all about objects, and the whole game is all about objects. Everyone one of those objects had to be updated to work in this new system, and have code changed to communicate in this new system. Development on it has actually been going on for nearly 3 years now, but for 3.3 it really became imperative to finish it off - so many devs and whole teams were redirected to ensure that happens. Without OCS/ABS, the Hurston planet and moons along with Lorville quite probably wouldn't have been possible for many game clients to handle (due to how much RAM it would take to have potentially all the moons and planets and stations and ships loaded)!<ref name="ocsfaq"/>
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.<ref name="jp"/>


=== Star Citizen Alpha 3.3.0 ===
==== 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 [[wipe]]d).<ref name="jp"/>


===== I-cache =====
OCS will be implemented in Star Citizen Alpha 3.3.0.<ref name="ocsfaq"/>
I-cache is a back-end system and service that provides and manages reliable persistence of all player and entity data.<ref name="pt39"/> 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.<ref name="mrmar19">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/17036-Star-Citizen-Monthly-Report-March-2019|text=Monthly Report - March 2019|int=Comm-Link:Monthly Report - March 2019|accessdate=2020-05-25}}</ref>


==== Server Meshing ====
* Improved memory use on the client-side as your game client will no longer need to try to keep EVERYTHING in the game universe loaded at once.
[[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]].<ref name="jp"/> The first version of this technology is static server meshing, to be followed by dynamic server meshing which will allow to dynamically mesh server nodes together and then scale the mesh [[Server meshing|dynamically]] based on demand.<ref>{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/18397-Server-Meshing-And-Persistent-Streaming-Q-A|text=Server Meshing and Persistent Streaming Q&A|accessdate=}}</ref>
* Slightly improved client-server performance as some measure of additional culling is provided by OCS.
* Less of the hiccups in your client which happen for 1-2 seconds every 10-15 seconds due to major events or spawns nearby, this is where ABS really comes in.
* Additionally, there have been some other non-OCS/ABS related server optimizations made for 3.3 which will also improve some of the server performance. Sadly these improvements will mostly be negated by the increased size of the universe and new NPCs which have been added to the game (they all take resources from the server cores). That issue along with the number of players "per server" will be addressed down the road with the Server Meshing enhancements.


== FAQ ==
=== 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.<ref name="jp"/>


Network Bind Culling was first mentioned in November 2016 as entity bind culling.<ref name="mrnov16"/>
'''One of the devs said in RTV that the OCS made performance "truly amazing", will that be the case?'''


==== Entity Component Update Scheduler ====
Probably... not. There are definitely performance gains, but they will be offset by a much heavier load on the servers as more than double the NPCs have been added from 3.2 to 3.3 and they consume a lot of overhead. We may see some slight server framerate gains, but it's not likely to move the needle to where everyone wants concerning 60fps. Remember that when devs test the game, they are doing so in small controlled instances with only 1 to 4 players on them, which means only 1-4 clients connected putting demand on the servers and only 1-4 ships needing the physics engine, etc. Putting 50 players doing crazy things on a server is a radically different environment than the one devs test in. So when a dev on a dev instance says "truly amazing" performance improvements, remember they are not playing on the public servers! Plus the stuttering issues in the last few patches have been very painful, so those being fixed by OCS is going to feel "really good" even if framerate improvements are only marginal.<ref name="ocsfaq"/>
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.<ref name="jp"/>


It was first mentioned in April 2018 as being refactored and nearly finished.<ref name="mrapr18">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/16551-Monthly-Studio-Report-April-2018|text=Monthly Report - April 2018|int=Comm-Link:Monthly Report - April 2018|accessdate=2020-05-25}}</ref>


==== Entity Ownership Hierarchy and Entity Aggregates ====
'''What is the difference between OCS and Bind Culling? Will OCS be providing some degree of Bind Culling?'''
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.<ref name="jp"/>


Entity Ownership Hierarchy was first mentioned in March 2017 with the development of Entity Owner Manager.<ref name="mrmar17">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15833-Monthly-Studio-Report-March-2017|text=Monthly Studio Report: March 2017|int=Comm-Link:Monthly Report - March 2017|accessdate=2020-05-25}}</ref>
n some senses, yes, OCS brings in a little of what we call [[Bind Culling]] by its very nature. But the two are different in the sense that Bind Culling is in itself a system of ferreting out which objects do not currently matter to a given game client (player) and removes communication about that object in the network stack. The reason they are different is that OCS (on the server side anyway) will stop communicating to a client about objects in another container that the client (player) is not currently in or near to. A good example is let's say you and another player are flying around Yela - you start right next to each other, but move away from each other for a long time. Because you are both still in the same celestial container of Yela, OCS is not removing knowledge of one another, but once you get to some distance let's say 500km apart as an example, Bind Culling may kick-in and stop sending updates about each other. If you're both next to each other and then one of you warps to Cellin, OCS is doing the culling because the one who warped to Cellin is moving to another whole container where Bind Culling would never kick-in. Think of Bind Culling as a small/local scale system and OCS as a larger scale system of managing communications between objects. Also note that server OCS improvements and optimizations will come later down the road, in 3.3 we're (mostly) getting client-side OCS.<ref name="ocsfaq"/>


==== Entity Spawn Batches and Entity Snapshots ====
== See also ==
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.<ref name="jp"/>

==== 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.<ref name="jp"/>

It was originally planned for [[Star Citizen Alpha 3.0.0|Alpha 3.0.0]], but was delayed to [[Star Citizen Alpha 3.1.0|Alpha 3.1.0]].<ref name="jp"/>

===Groundwork technology===
====Zone System====
[[File:MonthlyReport-1507-F42F3.png|thumb|300px|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.<ref name="mrjan15">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/14481-Monthly-Report-January|text=Monthly Report - January 2015|int=Comm-Link:Monthly Report - January 2015|accessdate=2020-04-04}}</ref> It is required for moving large, complex, and interactive groups of physicalized objects efficiently.<ref name="mrjul15">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/14871-Monthly-Report|text=Monthly Studio Report: July 2015|int=Comm-Link:Monthly Report - July 2015|accessdate=2020-04-04}}</ref> It replaces the old CryEngine octree spatial partitioning scheme.<ref name="mrmay15">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/14758-Monthly-Report|text=Monthly Report: May 2015|int=Comm-Link:Monthly Report - May 2015|accessdate=2020-04-04}}</ref>

It was proposed in January 2015 in a tech summit with tech engineers from the [[CIG]] studios, [[Illfonic]], [[Behaviour Interactive]], and [[Wormbyte]].<ref name="mrjan15"/> The development began in May 2015 by the Frankfurt team.<ref name="mrmay15"/> It was deployed to the ''Star Citizen'' code mainline in June 2015.<ref name="mrjun15">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/14814-Monthly-Report|text=Monthly Studio Report: June 2015|int=Comm-Link:Monthly Report - June 2015|accessdate=2020-04-04}}</ref> 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.<ref name="mrjul15"/> Navigation mesh and characters' paths began to be integrated in August 2015.<ref name="mraug15">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/14937-Monthly-Studio-Report|text=Monthly Studio Report: August 2015|int=Comm-Link:Monthly Report - August 2015|accessdate=2020-04-04}}</ref> The Frankfurt team extended the Zone System to better support multiple AI objects in October 2015.<ref name="mroct15">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15043-Monthly-Studio-Report|text=Monthly Studio Report: October 2015|int=Comm-Link:Monthly Report - October 2015|accessdate=2020-04-04}}</ref> The Frankfurt team rewrote CryEngine's AreaManager (ambient sound effects and reverbs) to integrate with the Zone System in November 2015.<ref name="mrnov15">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15105-Monthly-Studio-Report|text=Monthly Studio Report: November 2015|int=Comm-Link:Monthly Report - November 2015|accessdate=2020-04-04}}</ref> The UK team began work on getting Object Containers to work with the Zone System in January 2016.<ref name="mrjan16">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15187-Monthly-Studio-Report-January-2016|text=Monthly Studio Report: January 2016|int=Comm-Link:Monthly Report - January 2016|accessdate=2020-04-04}}</ref> Hierarchical culling support was added in March 2016.<ref name="mrmar16">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15285-Monthly-Studio-Report-March-2016|text=Monthly Studio Report: March 2016|int=Comm-Link:Monthly Report - March 2016|accessdate=2020-04-07}}</ref> Support for tags (Tag System) was moved into the Zone System in May 2016.<ref name="mrmay16">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15364-Monthly-Studio-Report-May-2016|text=Monthly Studio Report: May 2016|int=Comm-Link:Monthly Report - May 2016|accessdate=2020-04-07}}</ref> All data in Zone System are converted into AABB tree structure in June 2016.<ref name="mrjun16">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15408-Monthly-Studio-Report-June-2016|text=Monthly Studio Report: June 2016|int=Comm-Link:Monthly Report - June 2016|accessdate=2020-04-07}}</ref> The Tag System went through a major refactoring and optimization pass in July 2016.<ref name="mrjul16">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15444-Monthly-Studio-Report-July-2016|text=Monthly Studio Report: July 2016|int=Comm-Link:Monthly Report - July 2016|accessdate=2020-04-07}}</ref> The Area system was moved into the Zone System in November 2016.<ref name="mrnov16">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15637-Monthly-Studio-Report-November-2016|text=Monthly Studio Report: November 2016|int=Comm-Link:Monthly Report - November 2016|accessdate=2020-04-07}}</ref>

====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.<ref name="jp"/>

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.<ref name="mrjan16"/> It was mentioned again as a work in progress in April 2016.<ref name="mrapr16">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15325-Monthly-Studio-Report-April-2016|text=Monthly Studio Report: April 2016|int=Comm-Link:Monthly Report - April 2016|accessdate=2020-04-07}}</ref> It was mentioned as being worked on by the UK team in January 2018.<ref name="mrjan18">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/16399-Monthly-Studio-Report-January-2018|text=Monthly Studio Report: January 2018|int=Comm-Link:Monthly Report - January 2018|accessdate=2020-05-25}}</ref>

====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.<ref name="jp"/>

Basic support of entity component was implemented in the main development branch in July 2015.<ref name="mrjul15"/>

====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.<ref name="jp"/>

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.<ref name="mrjan16"/> 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.<ref name="mrfeb16">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15224-Monthly-Studio-Report-February-2016|text=Monthly Studio Report: February 2016|int=Comm-Link:Monthly Report - February 2016|accessdate=2020-04-05}}</ref> Support for LOD mesh merging and AI navigation meshes were added in August 2016.<ref name="mraug16">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15506-Monthly-Studio-Report-August-2016|text=Monthly Studio Report: August 2016|int=Comm-Link:Monthly Report - August 2016|accessdate=2020-04-07}}</ref> The old prefab system in hangars and shops were being replaced with an Object Container in February 2017.<ref name="mrfeb17">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15790-Monthly-Studio-Report-February-2017|text=Monthly Studio Report: February 2017|int=Comm-Link:Monthly Report - February 2017|accessdate=2020-05-25}}</ref>

==== 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.<ref name="jp"/> 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.<ref name="mrjun16"/>

The concept of Serialized Variables was introduced in June 2016, with the development started in the same month.<ref name="mrjun16"/>

==== 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.<ref name="atvmegamap">[https://youtu.be/0B0QUFSCUgo?t=846 Star Citizen: Around the Verse - What is Mega Map?]</ref>

The concept of Mega Map was introduced to reduce load time of switching game modes in October 2016.<ref name="mroct16">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link/transmission/15587-Monthly-Studio-Report-October-2016|text=Monthly Studio Report: October 2016|int=Comm-Link:Monthly Report - October 2016|accessdate=2020-04-07}}</ref> Support for singleplayer game maps such as hangars and single player ''[[Arena Commander]]'' was implemented in [[Star Citizen Alpha 2.6.1|Alpha 2.6.1]] in February 2017.<ref name="sca261">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link//15743-Star-Citizen-Alpha-261|text=Star Citizen Alpha 2.6.1 patch notes}}</ref> Support for multiplayer maps such as Arena Commander and ''[[Star Marine]]'' was implemented in [[Star Citizen Alpha 2.6.2|Alpha 2.6.2]] in March 2017.<ref name="sca262">{{Cite RSI|url=https://robertsspaceindustries.com/comm-link//15810-Star-Citizen-Alpha-262|text=Star Citizen Alpha 2.6.2 patch notes}}</ref>

==Development history==
{{Note|'''Note''': The following list {{em|does not}} represent the full picture of the development process. Development status are often not accessible by the public so it only contains information that are released by CI to the public.}}<!--

Only updated to 2018-04 with Monthly Report info
Feel free to add onto it
- alistair3149

-->
{| class="timeline"
|-
|2015-01
|
*Zone System and entity streaming were proposed<ref name="mrjan15"/>
|-
|2015-05
|
*Zone System was being developed, and entity streaming was being investigated<ref name="mrmay15"/>
|-
|2015-06
|
*Deployed Zone System to ''Star Citizen'' main development branch<ref name="mrjun15"/>
|-
|2015-07
|
*Started implementing Zone System in the main development branch<ref name="mrjul15"/>
*Added basic support of the entity component system in the main development branch<ref name="mrjul15"/>
|-
|2016-01
|
*Introduced the concept of Object Container<ref name="mrjan16"/>
*Started converting prefabs into containers<ref name="mrjan16"/>
*Started getting containers working with the Zone System<ref name="mrjan16"/>
*Converted Spawning logic of spaceships AI from C++ to Lua<ref name="mrjan16"/>
|-
|2016-02
|
*Added basic support to load levels with Object Container instead of as levels<ref name="mrfeb16"/>
|-
|2016-03
|
*Added Hierarchical culling support to Zone System<ref name="mrmar16"/>
|-
|2016-05
|
*Added support for tags (Tag System) into Zone System<ref name="mrmay16"/>
*Added ability to reuse entity IDs<ref name="mrmay16"/>
|-
|2016-06
|
*Started work on Serialized Variables<ref name="mrjun16"/>
*Converted data structure to AABB tree in Zone System<ref name="mrjun16"/>
|-
|2016-07
|
*Major refactor and optimization of Tag System in Zone System<ref name="mrjul16"/>
|-
|2016-08
|
*Added Object Container support for LOD mesh merging and AI navigation meshes<ref name="mraug16"/>
|-
|2016-10
|
*Mega Map was being investigated<ref name="mroct16"/>
|-
|2016-11
|
*Moved Area system was moved into the Zone System<ref name="mrnov16"/>
*Started work on Network Bind Culling<ref name="mrnov16"/>
|-
|2017-02
|
*Implemented singleplayer maps support for Mega Map in [[Star Citizen Alpha 2.6.1|Alpha 2.6.1]]<ref name="sca261"/>
*Started work on replacing old prefab system in hangars and shops with Object Containers<ref name="mrfeb17"/>
|-
|2017-03
|
*Implemented multiplayer maps (not including PU) support for Mega Map in [[Star Citizen Alpha 2.6.2|Alpha 2.6.2]]<ref name="sca262"/>
*Started work on Entity Owner Manager<ref name="mrmar17"/>
|-
|2018-04
|
* Refactored Entity Component Update Scheduler<ref name="mrapr18"/>
|}
{{Timeline styles}}

==See also==
* {{Link RSI|url=https://robertsspaceindustries.com/spectrum/community/SC/forum/3/thread/road-to-dynamic-server-meshing-tech-overview-with-|text=Unofficial Road to Dynamic Server Meshing - Tech Overview with Explanations}} by unobtanium on Spectrum
* "Developer Feature: The Road to Object-Container-Streaming". ''[[Jump Point (magazine)|Jump Point]]''. Vol. 7 no. 10. pp.&nbsp;3–16
* [https://www.youtube.com/watch?v=hqXZhnrkBdo Star Citizen's Next-Gen Tech In-Depth: World Generation, Galactic Scaling + More!] by Digital Foundry
* [https://youtu.be/tcMtPKSe2g4 Star Citizen: Pillar Talk - Alpha 3.9]
* [https://youtu.be/yEwik6g0Lwo?t=309 Star Citizen: Pillar Talk - Alpha 3.8]
* {{Link RSI|url=https://robertsspaceindustries.com/spectrum/community/SC/forum/50259/thread/how-is-server-meshing-possible/2110241|text=Clive Johnson response of how is server-meshing possible}}
* [https://www.youtube.com/watch?v=EU0sMZbhqoU& Star Citizen: Around the Verse - Performance and Optimization] {{trx|url=around-the-verse-performance-and-optimization}}
* [https://www.youtube.com/watch?v=EU0sMZbhqoU& Star Citizen: Around the Verse - Performance and Optimization] {{trx|url=around-the-verse-performance-and-optimization}}
* [https://youtu.be/E0YYKIjEC0E Star Citizen: Reverse the Verse LIVE - Object Container Streaming] {{trx|url=reverse-the-verse-7th-september-2018}}
* [https://youtu.be/E0YYKIjEC0E Star Citizen: Reverse the Verse LIVE - Object Container Streaming] {{trx|url=reverse-the-verse-7th-september-2018}}
* [https://www.youtube.com/watch?v=0B0QUFSCUgo Star Citizen: Around the Verse - What is Mega Map?] {{trx|url=around-the-verse-what-is-mega-map}}
* [https://youtu.be/0B0QUFSCUgo?t=844 Star Citizen: Around the Verse - What is Mega Map?] {{trx|url=around-the-verse-what-is-mega-map}}
* {{RSI|ref=no|url=spectrum/community/SC/forum/3/thread/what-to-expect-from-ocs-abs-in-3-3-faq-guide|text=What to expect from OCS/ABS in 3.3 (FAQ/Guide) by @UrsaPolaris}}
* {{Link RSI|url=spectrum/community/SC/forum/3/thread/what-to-expect-from-ocs-abs-in-3-3-faq-guide|text=What to expect from OCS/ABS in 3.3 (FAQ/Guide) by @UrsaPolaris}}
* [https://www.youtube.com/watch?v=DKa4j-xxy2I Star Citizen 3.3 | OBJECT CONTAINER STREAMING - Major Core Update by BoredGamer]
* [https://www.youtube.com/watch?v=DKa4j-xxy2I Star Citizen 3.3 | OBJECT CONTAINER STREAMING - Major Core Update] by BoredGamer


== References ==
==References==
<references/>
<references />


[[Category:Development]]


{{Short description|Technology behind Star Citizen that eliminate loading screen}}
{{BaseSEO}}
[[Category:Development]]

Latest revision as of 16:37, 11 October 2024

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]

Without OCS, things such as a spaceship and its contents for example are tracked by both the player client and the server at all times, which impacts performance.

Client side OCS currently in place means that the ship isn't tracked by the player client but by the server, unless the player goes there in which case the ship starts getting tracked on your client side as well.

Planned server side OCS won't track the ship on the client nor server side unless the player goes there, which is the best for server performance as it positively impacts latency, stability, synchronization, and performances such as AI responsiveness.

The servers not having to load everything all the time is essential to allow an expanded game area with more planets, moons, stations, systems etc without loading screens.

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] The first version of this technology is static server meshing, to be followed by dynamic server meshing which will allow to dynamically mesh server nodes together and then scale the mesh dynamically based on demand.[4]

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.[5]

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.[6]

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.[7]

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.0, but was delayed to Alpha 3.1.0.[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.[8] It is required for moving large, complex, and interactive groups of physicalized objects efficiently.[9] It replaces the old CryEngine octree spatial partitioning scheme.[10]

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

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.[15] It was mentioned again as a work in progress in April 2016.[20] It was mentioned as being worked on by the UK team in January 2018.[21]

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.[9]

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.[15] 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.[22] Support for LOD mesh merging and AI navigation meshes were added in August 2016.[23] The old prefab system in hangars and shops were being replaced with an Object Container in February 2017.[24]

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.[18]

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

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.[25]

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

Development history

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

See also

References

  1. Jump up to: 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, "Developer Feature: The Road to Object-Container-Streaming". Jump Point. Vol. 7 no. 10. pp.3–16. Retrieved 2020-04-04.
  2. Jump up to: 2.0 2.1 Star Citizen: Pillar Talk - Alpha 3.9
  3. Monthly Report - March 2019. Transmission - Comm-Link. Retrieved 2020-05-25
  4. Server Meshing and Persistent Streaming Q&A. Transmission - Comm-Link
  5. Jump up to: 5.0 5.1 5.2 5.3 Monthly Studio Report: November 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  6. Jump up to: 6.0 6.1 Monthly Report - April 2018. Transmission - Comm-Link. Retrieved 2020-05-25
  7. Jump up to: 7.0 7.1 Monthly Studio Report: March 2017. Transmission - Comm-Link. Retrieved 2020-05-25
  8. Jump up to: 8.0 8.1 8.2 Monthly Report - January 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  9. Jump up to: 9.0 9.1 9.2 9.3 9.4 Monthly Studio Report: July 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  10. Jump up to: 10.0 10.1 10.2 Monthly Report: May 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  11. Jump up to: 11.0 11.1 Monthly Studio Report: June 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  12. Monthly Studio Report: August 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  13. Monthly Studio Report: October 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  14. Monthly Studio Report: November 2015. Transmission - Comm-Link. Retrieved 2020-04-04
  15. Jump up to: 15.0 15.1 15.2 15.3 15.4 15.5 15.6 Monthly Studio Report: January 2016. Transmission - Comm-Link. Retrieved 2020-04-04
  16. Jump up to: 16.0 16.1 Monthly Studio Report: March 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  17. Jump up to: 17.0 17.1 17.2 Monthly Studio Report: May 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  18. Jump up to: 18.0 18.1 18.2 18.3 18.4 Monthly Studio Report: June 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  19. Jump up to: 19.0 19.1 Monthly Studio Report: July 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  20. Monthly Studio Report: April 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  21. Monthly Studio Report: January 2018. Transmission - Comm-Link. Retrieved 2020-05-25
  22. Jump up to: 22.0 22.1 Monthly Studio Report: February 2016. Transmission - Comm-Link. Retrieved 2020-04-05
  23. Jump up to: 23.0 23.1 Monthly Studio Report: August 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  24. Jump up to: 24.0 24.1 Monthly Studio Report: February 2017. Transmission - Comm-Link. Retrieved 2020-05-25
  25. Star Citizen: Around the Verse - What is Mega Map?
  26. Jump up to: 26.0 26.1 Monthly Studio Report: October 2016. Transmission - Comm-Link. Retrieved 2020-04-07
  27. Jump up to: 27.0 27.1 Star Citizen Alpha 2.6.1 patch notes. Comm-Link
  28. Jump up to: 28.0 28.1 Star Citizen Alpha 2.6.2 patch notes. Comm-Link