Update Design Doc: `level` tool

master
Ashley N. 2023-09-09 15:06:57 +00:00
parent c466e2c3e6
commit 4eed752e54
1 changed files with 6 additions and 2 deletions

@ -90,7 +90,7 @@ This file contains the entity-component system defined by the [attributes](#enti
This file format is optimised for use on-console and as such uses sparse arrays and unions to represent most data. An index into each of these sparse arrays constitutes the ID of a given kind of data. This allows your game engine to find types, component attributes, etc without having to iterate through arrays in hot loops. This file format is optimised for use on-console and as such uses sparse arrays and unions to represent most data. An index into each of these sparse arrays constitutes the ID of a given kind of data. This allows your game engine to find types, component attributes, etc without having to iterate through arrays in hot loops.
#### Type Table #### Type Table
Holds the registry of types and which set of components is associated with each type. An index into this table is the ID of the type. If there are no components in the type, that type ID is unused. Holds the registry of types and which set of components is associated with each type. An index into this table is the ID of the type. If there are no components in the type, that type ID is unused. Maximum of 255 types per level.
``` ```
2 bytes: Number of Types (A Type is a predetermined combination of components.) 2 bytes: Number of Types (A Type is a predetermined combination of components.)
2 bytes: Type Definition Union Size 2 bytes: Type Definition Union Size
@ -107,7 +107,11 @@ Holds the list of active entities (or Objects). Normally you memcpy this into yo
* The object table is a sparse array of active entities (or Objects) you memcpy into RAM. * The object table is a sparse array of active entities (or Objects) you memcpy into RAM.
* Normally this is 512 but future versions of level may permit customisation. * Normally this is 512 but future versions of level may permit customisation.
For (Object Table Size): For (Object Table Size):
2 bytes: ID of the Type. (00 = No object active in this slot) 1 byte: ID of the Type.
* 00 = No object active in this slot
* To dereference Type:
* Multiply this ID by (Type Definition Union Size)
* Add that to address of Type Table - 4 bytes
``` ```
#### Component Attribute Table #### Component Attribute Table