Skip to content
This repository was archived by the owner on Mar 25, 2020. It is now read-only.

Serialization

pointcache edited this page Jan 16, 2017 · 7 revisions

It is based on the idea that everything in the game is a prefab. By knowing the prefab id, we can represent entities as that id.

Serialization in URSA:

  • Saves entities transform info, as well as parenting (only to other entities and components, not gameobjects)
  • Saves components

All serialization (with exception of Configs) happens in SaveSystem. It is responsible for saving scene state, PersistentData state and Bluerpints

When saving we use this data structure:

  • SaveObject
    • EntityObject
    • CompRefs
    • ComponentObjects

EntityObject describes the root entity:

public class EntityObject
    {
        public string database_ID;
        public string instance_ID;
        public string blueprint_ID;
        public string parentName;
        public string gameObjectName;
        public bool parentIsComponent;
        public bool parentIsEntity;
        public string parent_entity_ID;
        public string parent_component_ID;

        public Vector3 position;
        public Vector3 rotation;
        public Vector3 scale;
    }

Since Entity is nothing but a locator, or a root object all we need to know about it is:

Clone this wiki locally