Object System

From SWGANH Wiki
Revision as of 00:20, 21 March 2007 by Snow (Talk | contribs) (Example)

Jump to: navigation, search

Description

SWG uses an Object System to store, manipulate and create game data and events.

The packets used are as follows:

SceneCreateObjectByCrc - Create an Instance of an Object.

BaselinesMessage - Initialize the Data.

SceneEndBaselines - Finish Initialization.

DeltasMessage - Update Data Members of the Object.

SceneDestroyObject - Destroy the Object.

ObjControllerMessage - Manipulate the Object.

Baselines

Baselines are used to initialize an Object with data.

For Objects not in control by the client, Baselines 3 and 6 are used.

Other baselines contain data specifically for that client and should not go to other clients.

Deltas

Deltas are updates to specific members of an Object. They have similar headers to baselines but the body contains a variable that references which member to update. This goes in order with the members of that baseline counting from 0 up.

So to change the first member use 0, for the 2nd member use 1, etc.

Some changes also have subtypes such as add and remove, they are noted in the structs.

Object Types

By referencing the /object/ folder on the Client, one can see templates for all game objects.

There are also base templates that are inherited into other objects. This can be seen inside the members

of an object.

Example

Resource Containers inherit Tangible Objects, and in the baseline, they are identical until the end where Resource Container specific members appear after the Tangible Members.

This is true for the entire inheritance system.

Here are a list of Object Base Types:

PACKET_TYPE *.iff Filepath
TANGIBLE object/building/base/shared_base_building.iff
INTANGIBLE object/cell/base/shared_base_cell.iff
CREATURE object/creature/base/shared_base_creature.iff
?? object/draft_schematic/base/shared_base_draft_schematic.iff
TANGIBLE object/factory/base/shared_base_factory.iff
GROUP object/group/base/shared_base_group.iff
GUILD object/guild/base/shared_base_guild.iff
INSTALLATION object/installation/base/shared_installation_base.iff
INTANGIBLE object/intangible/base/shared_base_intangible.iff
MANUFACTURE_SCHEMATIC object/manufacture_schematic/base/shared_base_manufacture_schematic.iff
MISSION object/mission/base/shared_base_mission.iff
?? object/object/base/shared_base_object.iff
TANGIBLE object/path_waypoint/base/shared_path_waypoint_base.iff
PLAYER object/player/base/shared_base_player.iff
RESOURCE_CONTAINER object/resource_container/base/shared_base_resource_container.iff
SHIP object/ship/base/shared_ship_base.iff
?? object/soundobject/base/shared_soundobject_base.iff
STATIC object/static/base/shared_static_base.iff
TANGIBLE object/tangible/base/shared_tangible_base.iff
WAYPOINT object/waypoint/base/shared_base_waypoint.iff
TANGIBLE object/weapon/base/shared_base_weapon.iff
*these seem to be deprecated.. as they would not create through packets*
??	object/construction_contract/base/shared_base_construction_contract.iff
??	object/counting/base/shared_base_counting.iff
??	object/universe/base/shared_base_universe.iff
??	object/token/base/shared_base_token.iff

Object Inheritance

As you can see, some types share the same packet structures. That is because while they inherit that object, they do not define more members. Following the same table of objects, these are the following inheritance maps for the currently used object types. OBJECT_TYPE PACKET_INHERITANCE POST_INHERITANCE BASE_OBJECT OBJECT inherited into all other objects.. pretty much SOUNDOBJECT OBJECT->SOUNDOBJECT ?? STATIC OBJECT->STATIC static,non-interactive game objects UNIVERSE OBJECT->UNIVERSE inherited into systems that universally track data GROUP OBJECT->UNIVERSE->GROUP groups.. lol GUILD OBJECT->UNIVERSE->GUILD the guild list INTANGIBLE OBJECT->INTANGIBLE inherited in cells, datapads, and other intangible objects TOKEN OBJECT->INTANGIBLE->TOKEN unknown.. WAYPOINT OBJECT->INTANGIBLE->WAYPOINT waypoints DRAFT_SCHEMATIC OBJECT->INTANGIBLE->DRAFT_SCHEMATIC all draft schematics for crafting MANUFACTURE_SCHEMATIC OBJECT->INTANGIBLE->MANUFACTURE_SCHEMATIC used in the crafting process MISSION OBJECT->INTANGIBLE->MISSION used to store missions in terminals and datapad PLAYER OBJECT->INTANGIBLE->PLAYER stores player specific data CELL OBJECT->INTANGIBLE->CELL All Internal Room Cells CONSTRUCTION_CONTRACT OBJECT->INTANGIBLE->CONSTRUCTION_CONTRACT unknown.. TANGIBLE OBJECT->TANGIBLE all game items, also gets inherited into other objects BUILDING OBJECT->TANGIBLE->BUILDING Cities,Player Houses,Bases, All Buildings CREATURE OBJECT->TANGIBLE->CREATURE mobile, vehicles, NPCs, players, mobs FACTORY_CRATE OBJECT->TANGIBLE->FACTORY_CRATE factory crates and manufactured goods INSTALLATION OBJECT->TANGIBLE->INSTALLATION harvestors and factory structures PATH_WAYPOINT OBJECT->TANGIBLE->PATH_WAYPOINT used to do path markers RESOURCE_CONTAINER OBJECT->TANGIBLE->RESOURCE_CONTAINER resources SHIP OBJECT->TANGIBLE->SHIP ships WEAPON OBJECT->TANGIBLE->WEAPON all game weapon items COUNTING OBJECT->TANGIBLE->COUNTING unknown.. Object Packet Members ¶

Here is a table and links to individual Packet Structures for Objects that the server can send.

Notice: Objects that define no new members are not listed. Only specifically variating structs are listed. Parsing Types (Actual STRUCT Variation) ¶ CREATURE 01 03 04 06 GROUP 01? 03? 06? GUILD 01 03 06 INSTALLATION 01? 03? 06? 07? INTANGIBLE 01? 03? 06? MANUFACTURE_SCHEMATIC 01? 03? 06? 07? MISSION 01? 03? 06? PLAYER 01 03 06? 08? 09? RESOURCE_CONTAINER 01? 03? 06? SHIP 01? 03? 04? 06? STATIC 01? 03? 06? TANGIBLE 01? 03? 06? 07? WAYPOINT 01? 03? 06?