diff --git a/Design-Doc%3A-%60level%60-tool.md b/Design-Doc%3A-%60level%60-tool.md index 208e89b..3fe104b 100644 --- a/Design-Doc%3A-%60level%60-tool.md +++ b/Design-Doc%3A-%60level%60-tool.md @@ -20,7 +20,7 @@ Reskit assumes a best-practice entity-component engine design and the objects de By adding a property `reskit-component[x]`, where x is the index of the component in an array, you can attach various components to the target entity. Each component may have various properties you choose to define, which can be formatted as Tiled property `reskit-component[x].y`, where x is the index of the component and y is the property name for that component. -What your game does with this information is entirely up to you: reskit just compiles the information on which entities are where and what components are attached to them. +What your game does with this information is entirely up to you: reskit just compiles the information on which entities are where and what components are attached to them. By default, reskit will attach one component to each entity: `position`, which is generated from the position set in Tiled Editor. ## Configuration TOML This is provided on the command line via `-c, --config-file`. This argument is required. The configuration TOML primarily is a mapping of string identifiers to numeric identifiers, which are better suited for use on 8-bit and 16-bit systems. You must define numeric identifiers for each string you use as a `reskit-component[x]`. @@ -43,21 +43,25 @@ The .lvl format is output by the `level` tool. It is a binary format ideal for u ### Header * 4 bytes: Magic number, 'LEVL' in ASCII. This is useful to quickly evaluate problems with bundling assets in your build. -### Map Unit Size -* 1 byte: The unit size for each tile. On Sega Mega Drive this is 8, for 8x8 tile. - ### Map Tile Size * 1 byte: The width _in number of tiles_ of each entry in the level map. * 1 byte: The height _in number of tiles_ of each entry in the level map. +### Component Definitions +* 2 bytes: Number of component definitions + +For (number of component definitions): + * 1 byte: ID for this component + * 1 byte: Number of 16-bit properties associated with this component + * Note: Order of fields are identical to order of fields in configuration TOML. + ### Component Data -(TBD !!) +* 2 bytes: Number of component instances -### Entity Data -* 2 bytes: The number of entities. - -For (number of entities): - * 1 byte: X position of entity - * 1 byte: Y position of entity +For (number of component instances): + * 2 bytes: ID of the associated entity + * 2 bytes: Index of the component definition (from component definitions - not the ID! but the index) + For (number of 16-bit properties in the component as determined from its entry in "Component Definitions"): + * 2 bytes: Value of the associated field (order per configuration TOML as mentioned above). (TBD !!) \ No newline at end of file