Generators and import
We have multiple generators and importers available through the commands.
Generators:
- Players experience per level
- Enemies experience per level
- Attributes per level
- Maps
Importers:
- Objects
- Players experience per level
- Attributes per level
- Class paths
- Maps
- Skills
Generators
Every generator reads a JSON configuration file from the path you pass, relative to the folder where you run the command, and saves its output in a generated folder:
$ npx reldens-generate players-experience-per-level ./generate-data/players-experience-per-level.json
$ npx reldens-generate monsters-experience-per-level ./generate-data/monsters-experience-per-level.json ./generate-data/players-level-sample.json
$ npx reldens-generate attributes-per-level ./generate-data/attributes-per-level.json
The enemies experience generator (monsters-experience-per-level) takes a second file: the output of the players experience generator, so the enemies rewards scale with the players levels.
The maps generator takes the map data file and the loader (generation mode) to use:
$ npx reldens-generate maps ./generate-data/map-data.json LayerElementsObjectLoader
$ npx reldens-generate maps ./generate-data/map-composite-data.json LayerElementsCompositeLoader
$ npx reldens-generate maps ./generate-data/map-composite-data-with-names.json MultipleByLoaderGenerator
$ npx reldens-generate maps ./generate-data/map-composite-data-with-associations.json MultipleWithAssociationsByLoaderGenerator
- LayerElementsObjectLoader - a single map from the elements defined in the data file.
- LayerElementsCompositeLoader - a single map from the elements of a composite map file.
- MultipleByLoaderGenerator - multiple maps from a composite map file, one for each name in the data file.
- MultipleWithAssociationsByLoaderGenerator - multiple maps plus the inner maps (like the houses of a town) linked to them, see Multiple Maps With Associations.
The generated maps are copied to the generated folder of the project root.
Importers
- Import the generated file using the import command:
$ npx reldens-import players-experience-per-level custom-game-theme-test generate-data/players-experience-per-level.json
The other importers run the same way, with the importer name, the theme name and the path to the JSON file:
$ npx reldens-import objects [your-theme] generate-data/objects.json
$ npx reldens-import class-paths [your-theme] generated/class-paths.json
$ npx reldens-import attributes-per-level [your-theme] generated/stats.json
$ npx reldens-import maps [your-theme] generate-data/maps.json
$ npx reldens-import skills [your-theme] generate-data/skills.json
- The class paths importer also imports the experience per level, so the players experience per level import is not required when you use it.
- The class paths and attributes per level files are explained step by step in Contents creation.
- The objects and skills files are explained in the Objects Importer and the Skills Importer guides.
Maps importer
The maps importer creates a room for each map in the maps property: the key is the room title and the value is the room name, which is also the map file name without the .json extension:
{
"maps": {
"Town": "reldens-town",
"Forest": "reldens-forest"
}
}
- The map files and their tileset images are read from generate-data/generated in the project root (change it with relativeGeneratedDataPath, relative to the project root, or generatedDataPath).
- Every map needs at least one tileset with an image (disable that check with "verifyTilesetImage": 0), and a room with the same name must not exist.
- The rooms are created disabled. The change points and return points come from the map layers properties, "importAssociationsForChangePoints": 1 also imports the maps linked by the change points ("importAssociationsRecursively": 1 follows the links of those maps too).
- "automaticallyExtrudeMaps": 1 extrudes the tileset images before the import.
See Commands Reference for the complete list of CLI commands.
Administration panel
The administration panel includes these tools under Wizards:
- Maps Wizard - generates and imports the maps (uses the @reldens/tile-map-generator package), with the Tileset Analyzer to prepare the tilesets and the Maps Elements Editor.
- Objects Import - the same as the objects importer command.
- Skills Import - the same as the skills importer command.
The experience, attributes and class paths generators and importers are only available as commands.
reldens