Entity

From Blood Wiki
(Difference between revisions)
Jump to: navigation, search
m
 
(11 intermediate revisions by one user not shown)
Line 1: Line 1:
 
'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.
 
'''Entity''' (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.
  
In Blood Omnicide, each entity have entity number (index in global entity storage), entity class (a string storing entity class name) and fields that store all other entity properties.
+
== Game entity ==
  
In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.
+
Each game entity have unique number (a position in entities array) and set of fields. Set of fields are shared between all entities, but their usage is based on entity class and subclass functions. It means if "health" field is defined, any entity can access it, but based on entity class, it can have different meaning. There is system fields used by engine routines (spawnflags, movetype).
  
There is 3 types of entities in the game code, depends on what programs they exists:
+
Entity fields can be one of 5 types:
 +
* float - 32bit float value
 +
* vector - 3-dimensional vector (3 floats)
 +
* entity - pointer to another entity (really integer number)
 +
* string - pointer to a string (strings are stored in special memory zones - constant strings, temp strings, zoned strings).
 +
* function - funtion pointer
  
* Game entity (exists on server)
+
Depending of engine build, strings could be from 1024(game build) to 16384 (developer build) characters long. Max entities is also 2048 in game build and 128k in development build.
* Client entity (exists on a client)
+
* Menu entity (exists in menu program which is a separated from a client because client program get unloaded when level changes)
+
  
Theres is also special entity types managed by Darkplaces Engine:
+
When game is saved engine writes all entity keys except ones prefixed with ''_''. This fields are meant to be runtime-only.
  
* Network Entity - legacy networking (not using client side progs)
+
Example of entity fields:
* Render Entity - a Network/Client entity that is sent to render.
+
origin - position or entity in the world space
 +
health - health of monster/trigger
 +
classname - entity class name (a function called after entity get spawned)
 +
th_die - internal game field, a game function to call when monster dies
 +
_next - system field used by entity chain routines
 +
_ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces
  
[[Category: General Editing Terminology]]
+
== Other entities ==
 +
Game entity represents server entity - entity spawned and processed on server programs. There are more entitity types created and processed in other programs:
 +
 
 +
* Client entity (networked game entity on a client)
 +
* Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
 +
* Render entity - entity that is sent to render.
 +
 
 +
[[Category:Glossary]]

Latest revision as of 15:39, 25 September 2012

Entity (edict, object) - any object in game world. Players, Monsters, Items etc. are entities.

[edit] Game entity

Each game entity have unique number (a position in entities array) and set of fields. Set of fields are shared between all entities, but their usage is based on entity class and subclass functions. It means if "health" field is defined, any entity can access it, but based on entity class, it can have different meaning. There is system fields used by engine routines (spawnflags, movetype).

Entity fields can be one of 5 types:

  • float - 32bit float value
  • vector - 3-dimensional vector (3 floats)
  • entity - pointer to another entity (really integer number)
  • string - pointer to a string (strings are stored in special memory zones - constant strings, temp strings, zoned strings).
  • function - funtion pointer

Depending of engine build, strings could be from 1024(game build) to 16384 (developer build) characters long. Max entities is also 2048 in game build and 128k in development build.

When game is saved engine writes all entity keys except ones prefixed with _. This fields are meant to be runtime-only.

Example of entity fields:

origin - position or entity in the world space
health - health of monster/trigger
classname - entity class name (a function called after entity get spawned)
th_die - internal game field, a game function to call when monster dies
_next - system field used by entity chain routines
_ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces

[edit] Other entities

Game entity represents server entity - entity spawned and processed on server programs. There are more entitity types created and processed in other programs:

  • Client entity (networked game entity on a client)
  • Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
  • Render entity - entity that is sent to render.
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox