Around the Verse - Serialized Variables

2 posts in this topic

Posted (edited)

Chris and Erin Roberts host this week’s episode, which focuses on how serialized variables make networking a game of this size and scope possible. Plus, Los Angeles provides a studio update.

 

Highlights

Studio Update

  • EKD spent part of the month working in the Frankfurt & Wilmslow offices but is glad to be home
  • Narrative
    • Knocking out a massive amount of component descriptions needed for the 3.0 release
    • Working on NPC voice packs for 3.0: wrote and recorded roughly 2800 lines for generic NPCs
    • Created the Persistent Universe Character Tracking Sheet to recorded details of all dialogue
    • Reviewing locations and noting what's needed to make more immersive environmental storytelling
  • Cargo
    • Wrapped up developing the Cargo Grids to provide the visual element of transporting commodities
    • The number of commodities you have manifests as stacks of crates located within the ship's cargo hold
    • You can put vehicles and loose items into the cargo hold as well, but it will limit the amount of grid space
  • Engineering
    • Finished up implementing the solar system content (aka object containers) into a hierarchy
    • Provided object container editing so that content in an object container can be edited from within a normal level
    • Reworked the handling of vehicle internal damage states so they are significantly easier to setup and debug
    • The IFCS update process has been converted to batch updates as it does not need to be in lockstep with physics
    • Completed the new Quantum Drive 2.0: refactored the drive component and added new features; ready for Design, Art and UI
  • Ships
    • RSI Aurora has gone through a final art check; established 14 different skins for designers
    • Anvil Terrapin is finalising its greybox phase and moving to final art; also in Tech Design greybox
    • With the Item 2.0 conversion underway it was time to update update the ship stats page on the website
  • Tech Art & Animation
    • Reviewing the release to identify code and content fixes that would dramatically improve performance
    • Statoscope produces, manages and plots graphs from the data logged on a per frame basis
    • Improved the animations save format: scene load times reduced
    • Female transfer mesh created, male transfer mesh updated
    • Identified and fixed an issue with eyelid vertex normals being flipped
  • Characters
    • Knocking out countless costumes for Squadron 42 and Star Citizen
    • A female character in-game assets is being finished ready for texturing
    • OMC undersuits have finished in-game modelling and on their way to texturing
    • Levski specific civilians and miners are currently being textured before being rigged and implemented
    • Reworking legacy UEE and Pirate armour to bring them up to the quality of our current modular assets
    • A select group of hairstyles and eye options coming in 3.0
    • Male Marine BDU, Male Deck Crew, Female Light Armour and Female Explorer Flight Suit are all implemented

Behind the Scenes: Serialized Variables

  • Clive Johnson, Foundry 42 UK's lead network programmer was terrified at the prospect of networking Star Citizen, but soon took the impossible problem and broke it down into smaller impossible problems
  • All the thousands of elements and entities in the game that might be used thousands of times with certain behaviors or uses has to be implemented in code for both Squadron 42 and Star Citizen
  • Though there are 60 programming engineers and six networking engineers with only three dedicated to making the game work in multiplayer, all have to make sure individually that their code works in multiplayer
  • Application Programmer Interface (API) cushions the programmer from the problems they want to solve by allowing them to say exactly what it is they want to do, but without saying how to do it
  • Like with assisted driving the API can take action to prevent programmer's mistakes from causing a crash
  • APIs simplify the programmer's jobs not unlike how driverless cars simply require a destination
  • Multiplayer games from the purview of programmers are simply many tables and values that correspond to different properties of an entity
  • These tables help track variables and how their values change over time
  • Programmers write code that references multiple tables to produce what one sees in a game-play
  • Multiplayer requires the servers after making changes to these tables to copy them and send them to all of the client machines so that everyone's in sync
  • Since there are hundreds of these variables or properties that must be kept in sync over the network one can periodically send a state of all the tables out, but that can cause bandwidth related issues with higher numbers of entities
  • Alternately and what is done now is to only send out a copy if the table is changed for an entity
  • Entities are built by putting different components together
    • Problem is with exponential growth of components they also had increase in networking work needed to cover all different entity types, this is when they came up with serialized variable
  • Now programmers just need to write code as normal and item variables to their components as needed with the only extra step being marking variables they want networked in a special way
    • Serialization being the process of packing up data in a form that’s more efficient and better suits being sent over the network or serialized to a file
    • Program only needs to write the additional lines that are highlights and on the right and add them to their class definition, this tells the system which members of the structure to watch/update
  • Previously they would have needed specific functions for each class and programmers would have had to manually look at the variables they wanted to serialize and write them out into the serialization stream, this leads to extra work and possible errors  
    • Now programmers mark up which variables they want serialized and it’s handled automatically through one unified system, there is also now no need to group things into sections anymore
  • API detects when something’s been modified and let’s the netcode know, even writes the code to handle serialization for them  
  • Update messages are now about as optimized as they’re going to get
  • Serialized variables just don’t work for multiplayer and networking, instead of sending tables/values/variables between server and client they can now store them in the database or save them as a file  
  • Serialized variables is also a cornerstone of building a persistent universe, it’ll require multiple servers communicating with each other
    • This means several servers can be aware of an entity all at the same time, how they decide which one gets the final say is using tokens
    • A token can only be held by one computer at a time, this means by linking serialized variables and tokens they’ll be able to transfer authority from one server to another as quickly as flicking a switch

Courtesy of Relay

Edited by Akanoes

Share this post


Link to post
Share on other sites

Posted

I'm glad they finally took the time to explain exactly what "serialized variables" means. It was a really good explanation of a very complicated subject, I thought.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now