Editing Entity

Jump to: navigation, search

Warning: You are not logged in.

Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
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.
  
== Game entity ==
+
There is 3 types of game entities, depends on what programs they exists:
  
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).
+
* Game entity
 +
** Server entity (actual game entity, get saved to savegames)
 +
** 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)
 +
* Network entity - legacy engine-based networking (not using client-side progs)
 +
* Render entity - a Network/Client entity that is sent to render.
  
Entity fields can be one of 5 types:
+
=== Game entity structure ===
* 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.
+
Each game entity have:
 
+
* entity number (index in global entity storage)
When game is saved engine writes all entity keys except ones prefixed with ''_''. This fields are meant to be runtime-only.
+
* entity class (code-driven behavior)
 +
* fields (or keys) - entity properties.
  
 
Example of entity fields:
 
Example of entity fields:
origin - position or entity in the world space
+
  health - health of entity
  health - health of monster/trigger
+
  classname - entity class name
  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
 
  _ls - q3map2 field, sets scale of lightmaps to be generated for entity surfaces
  
== Other entities ==
+
In QuakeC, all entities shares the same fieldset. But on different entity classes, same fields can have different functionality.
Game entity represents server entity - entity spawned and processed on server programs. There are more entitity types created and processed in other programs:
+
 
 +
==== Fields classification ====
  
* Client entity (networked game entity on a client)
+
* Common field - field of entity that can be set in level editor (such as '''origin''')
* Menu entity (exists only in menu program which is a separated from a client because client program get unloaded when level changes)
+
* Gamecode field - this one is being set by gamecode, not acessible in level editor
* Render entity - entity that is sent to render.
+
* Non-Saved field - not saved to a savegame filed, this fields always prefixed by _.
 +
* Compiler-only field - this field dont exist in the game logic and only used by Q3map2 to guide compilation of map.
  
 
[[Category:Glossary]]
 
[[Category:Glossary]]

Please note that all contributions to Blood Wiki are considered to be released under the Creative Commons Attribution Share Alike (see BloodWiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox