Account Character Tree
This page goes into details about Character Node Structure. For a higher level overview, see Structure of an Account.
A player in a Clean Engine game is represented by a 3-level node tree:
- At the root of this tree is the account node, of class _PlayerAccount
- The middle level of the hierarchy holds the character nodes, of class _PlayerCharacter that are associated to the account
- Each character then has one or more _characterAppearance nodes associated to it.
The account node is derived from the _playerAccount class. This node is used to store information that is useful to the account as a whole, or that pertains to the user of the account, like number of customer service warnings that have been issued to the player.
As the fundamental identifier for a user, this node's ID is also the most likely piece of information to be given to an external function when C++ code needs to be executed for a particular user. For example, the external function for messaging a player takes the account node's ID to identify who should receive the message, and remote calls from the server to the client take the account node's ID for the same reason. By default, Clean Engine has very few fields on this node, which will be discussed in more detail below.
The character node is derived from the _playerCharacter class. This node is used to store game data for a particular character on an account, like stats and health.
This is the node from which game systems should associate their own root nodes. For example, rather than associating all of a character's inventory directly to the character, it is better to create an Inventory node that dangles from the character using a uniquely identifiable association. Inventory items themselves would then be associated directly to that node, or to other branch nodes (containers) that you have created to organize the inventory.
This node is derived from the _characterAppearance class, and stores visualization data about the character, like the specification used to determine its animation data, FaceGen data, skeletal morph data, etc.
Characters can have multiple appearance nodes associated to them; however, only one of these nodes can have its
draw_character field set to TRUE. That field tells the server which of the appearance nodes to use when sending visualization data to the client. The
draw_character field has the special behavior that when it is set to TRUE, all other appearance nodes associated to the character have their
draw_character fields set to FALSE.
Required fields in the structure
Each node in the character structure has one or more fields that are expected by HeroEngine. Note that the fields may be different depending on whether looking at the client-side or server-side class.
|_charList||server||List of String||stores a list of characters on the account for use by the clean HeroEngine character selection GUI. Specifically, the list is ordered based on the order of last being logged on.|
|_clickTarget||server||ID||Set by the HSL Input System when something is clicked or double-clicked on in character mode. The functionality that sets this fields (or fails to in some circumstances) can be overridden for game-specific purposes, for example, to allow developers to write tools that select things when not in character mode.|
|_cssLastSelected||server||string||The character which you last logged in as|
|_cssLoadInCleanTest||server||boolean||Flag indicating whether or not you have checked the "Load into Clean Test Area" button|
|_currentCamera||server||string||The current camera that the client is using|
|_replicationGroupRef||server||noderef||Noderef pointing to the replication group node for the account|
|_SAS_ProxyEntities||server||list of noderef||Inherited field, used to implement spatial awareness behaviors|
|account_name||server||string||The account name of the user. This field is set by C++ every time an account logs in because it should never be modified by the game.|
|_ACCControllerRef||client||noderef of class _ACCController||Advanced Customizable Character Controller system, references the node implementing the Controller|
|_characterAppearanceRef||client||noderef||Points to the active _characterAppearance node|
|_characterRef||client||noderef of class _playerCharacter||Points to the _playerCharacter node for the account|
|_ACCControllerRef||both||noderef of class _ACCController||References the node implementing the Advanced Customizeable Character Controller|
|_acccSpatialAwareness||server||noderef of class _SpatialAwarenessSystem||Points to the Spatial Awareness node that the Character Controller is using to determine its awareness|
|_characterAppearanceRef||both||noderef||References the active _characterAppearance node|
|changed||server||boolean||Set to TRUE by systems when they want to raise an event. It is set via the setChanged() method on the character node|
|_currentArea||server||ID||When an account logs in for a new session, it always logs into the character selection area. This field is used by HeroEngine's travel mechanics to store a character's last known area, so that it can be moved there when it is selected.|
|_currentAreaInstance||server||ID||When an account logs in for a new session, it always logs into the character selection area. This field is used by HeroEngine's travel mechanics to store a character's last known area instance number, either so that it can be moved there when it is selected, or moved to a new instance if the old one is no longer running.|
|_accountRef||client||noderef of class _playerAccount||points to the _playerAccount node|
|name||server||string||Although not strictly necessary because of the external function GetCharacterName(), this field stores a character's name for ease of use.|
|script||server||scriptref||no longer used|
|subscript||server||list of scriptref||no longer used|
|geometry_list||server||list of class geometry_pair||List of parts and slots used by HeroEngine's default character system|
|texture_list||server||list of class texture_pair||List of layers and pieces (along with colors and shininess) used by HeroEngine's default character system|
|_characterSpecification||both||string||Defines the model's specification; in other words this field defines what .dat file to look at for determining how the character is put together, what animations it can play, etc.|
|_characterSpecificationChange||client||boolean||Tracks whether or not the client has applied changes to the characterSpecification|
|facegen_spec_body_raw||both||list of rawdata||Used to compress the amount of data sent to the client. The raw fields are compressed versions of the non-raw fields.|
|facegen_spec_raw||both||list of rawdata||Used to compress the amount of data sent to the client.|
|_geometry_list_raw||both||list of rawdata||Used to compress the amount of data sent to the client.|
|_texture_list_raw||both||list of rawdata||Used to compress the amount of data sent to the client.|
|facegen_spec_body_raw||server||list of rawdata||Used to compress the amount of data sent to the client.|
|_characterAppearChange||client||boolean||Tracks whether or not the client has applied changes to the character's appearance. Set to TRUE when nearly anything in the character's appearance has changed.|
|_characterAppearTimer||client||timer||Used for two different purposes: (1) The primary replicated node has not become a character node; (2) Used to attempt to apply pending changes.|
|_characterHBNode||client||ID||Represents the node for the actual visualization of the character|
|character_rotation||server||vector3||Holds the character's spatial rotation with the current area|
|draw_character||server||boolean||When TRUE, indicates that the node is being rendered. This is a special field that has the unique behavior of setting the draw_character flag on all other _characterAppearance nodes associated to the character to FALSE, when any one of them is set to TRUE.|
|facegen_spec||server||string||Stores standard facegen data|
|facegen_spec_body||server||string||Stores customized facegen data for HeroEngine default characters' bodies|
|facegen_spec_hjhead||server||string||Stores customized facegen data for HeroEngine default characters' heads|
|name||both||string||Stores the displayed name of the character that floats over its head|
|SkeletonBlendCollection||both||lookuplist indexed by string of float||Stores the percentage weights for blending the skeletons of different races|