How Does Persistent Data Work
This is a quick overview to the commonly asked question of "How Does Persistent Data Work in the HeroEngine?"
The structure of objects are defined in the Data Object Model (DOM). Instantiated objects are persisted in the database and loaded into the Game Object Model (GOM, i.e. into process memory). Objects are loaded into the GOM in one of two ways, by virtue of being a "root" node (i.e. the parent of a hierarchy of instances) or being a child of a hierarchy ultimately culminated in a root node (this is done through "hard" associations).
So, when a root loads all of its children (as determined by hard associations) are loaded with it. HeroScript (HSL) can only load root nodes, it can not load individual child nodes. There are 4 major categories of roots: accounts, characters, areas and arbitrary (free form) root nodes.
Areas are represented as one type of "root" node to which all of the area geometry data is associated (trees, lights, sounds, etc) as well as any game specific data you wish to associate to the root. When an area instance spins up, it automatically loads its root node and thus all data associated to it.
Each Area Server instance (edit instance, play instance 1..N) has its own GOM (i.e. process memory) and only knows about stuff loaded into memory.
Objects can be replicated from the server to the client or other server processes using Replication, whose parameters are defined in the DOM for the class(es) making up the object.