diff --git a/Design-Doc%3A-%60level%60-tool.md b/Design-Doc%3A-%60level%60-tool.md index 9e4a85c..d3943d9 100644 --- a/Design-Doc%3A-%60level%60-tool.md +++ b/Design-Doc%3A-%60level%60-tool.md @@ -6,7 +6,7 @@ Reskit `level` Tool This document details some approaches for implementing the `level` tool. ## What is `level`? -`level` is a tool for reskit that converts [Tiled Map Editor](https://www.mapeditor.org/) tilesets and maps to a binary format accessible to C or assembly language engines. It distinguishes itself from other available homebrew tools by offering support for Tiled's native tmx/tsx XML formats, and user-specified entity-component system definitions. +`level` is a tool for reskit that converts [Tiled Map Editor](https://www.mapeditor.org/) tilesets and maps to a binary format accessible to C or assembly language engines. It distinguishes itself from other available homebrew tools by offering support for Tiled's native tmx/tsx XML formats, and user-specified object definitions. ## Converting a Tiled Map Editor Module with `level` To convert a Tiled map and tileset: @@ -38,12 +38,8 @@ The boolean property `reskit-collision` set on a Tile Layer to `true` indicates If no layer is defined with `reskit-collision` you will receive a warning on the command line. Generally most maps should include collision data - it is NOT auto-generated! -## Entity-Component System -Reskit assumes a best-practice entity-component engine design and the objects defined in your .tmx file effectively serve as the entities. By adding a property `reskit-component[x]` to each object, where x is the name of the component in an array (boolean type), you can attach various components to the target object/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 name of the component and y is the property name for that component. If multiple object layers are defined, reskit will collapse all of them into a single layer. - -By default, reskit will attach one component to each entity: `position`, which is generated from the position set in Tiled Editor. This component has two 16-bit values: x and y position on the map (in pixels, 0,0 is top left of the map). The array index of this component will be one more than the last index listed by the designer. - -The entity-component system is exported in an artifact known as the .ecs file. 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. If you do not specify any object layers or objects, `level` will not output an .ecs file, leaving objects and their initial behaviour up to the programmer. +## Objects +Object layers let you define what objects are in the map. Objects may be players, items, triggers, and are identified by the `reskit-object-id` attribute, which will correlate with an id provided by you in argument `--symbol-ids`. Use `reskit-field[x]` to define the value for a given field, specified by `--fields`. ## Artifact File Formats