Minimum required contents creation

The minimum required contents are related between each other, so you need to create them in the following order:

Note: though is recommended to learn the info in the links above, you don't need to read all of them now to follow the content creation steps.

Ways to create the game contents:

  • Through the generators and imports available as commands.

  • Through the generators and imports available in the administration panel.

  • Manually creating each entity in the administration panel.

  • Directly with queries in the database using any client (not recommended).


1 - Prepare your assets

For me this is the fun part!

For the documentation we will create 2 classes: "Warrior" and "Mage".

You can create as many as you like, but at least 1 is required for the platform to work (even when later you don't show it anywhere in the game).

Each class path will require their own player spritesheets:

You need to place these files in the following folder: [your-game-folder]/theme/[your-theme]/assets/custom/sprites/

That way these will be built once you re-build your client.

Next are your map files, you can check how to create your own here: maps manual creation.

But for the documentation we will use the existent ones in the examples.

2 - Generating data through commands

Here we will use the generators available on the commands to get as much data as possible to later process with the importers.

  • Copy the generated file and rename it to class-paths.json.

  • In that file (class-paths.json), we will include our classes paths information.

  • As you can see in the example below we are also including different "labels" for the paths at different levels (50 and 100), this will represent our class paths changes (with code you could customize the behavior to make the players change classes through an NPC).

  • Additionally, in the same file we will include another parameter called "preAppendRace" = true, which will be used by the importer later.

  • Your final class-paths.json file should look like this /examples/generated/class-paths.json:

{
    "preAppendRace": true,
    "classPaths": {
        "Mage": {
            "50": "Wizard",
            "100": "Sage"
        },
        "Warrior": {
            "50": "Guardian",
            "100": "Warlord"
        }
   },
   "levelsSets": {
        "all": {
            "1": {
                "req": 10,
                "total": 10,
                "growthFactor": 2
            },
            "2": {
                "diff": 10,
                "req": 20,
                "total": 30,
                "growthFactor": 2.005
            },
            "3": {
                "diff": 20,
                "req": 40,
                "total": 70,
                "growthFactor": 2.01
            }
            // here you should put the generated levels data
        }
    }
}
{
    "stats": {
        "hp": {
            "label": "HP",
            "description": "Player life points",
            "base_value": 20,
            "customData": "{\"showBase\":true}"
        },
        "mp": {
            "label": "MP",
            "description": "Player magic points",
            "base_value": 20,
            "customData": "{\"showBase\":true}"
        },
        "atk": {
            "label": "Atk",
            "description": "Player attack points",
            "base_value": 10,
            "customData": null
        },
        "def": {
            "label": "Def",
            "description": "Player defense points",
            "base_value": 10,
            "customData": null
        }
    },
    "statsByVariation": {
        "player": {
            "1": {
                "Mage": {
                    "hp": 123,
                    "mp": 176,
                    "atk": 39,
                    "def": 39
                },
                "Warrior": {
                    "hp": 176,
                    "mp": 106,
                    "atk": 62,
                    "def": 56
                }
            }
            // all the levels 
        }
    }
}
  • Your final stats.json file should look like this /examples/generated/stats.json:

  • Here you can see we are adding custom data on the HP and MP "stats" to make these show their base value in the client. This will make the properties display like HP 23/30 (current value / base value) instead of HP 23 (current value only).

  • When running the import of this file it will generate the required "stats" and then the variations.


3 - Importing data through commands

With the generated files (class-paths.json and stats.json) we have enough data to run the imports.

  • Open a console on your game root folder.

  • Reminder, for every command replace [your-theme-name] by your game theme name, in the examples is my-game.

  • Run the two imports in the following order

$ npx reldens-import class-paths [your-theme-name] generated/class-paths.json

$ npx reldens-import attributes-per-level [your-theme-name] generated/stats.json
  • At this point, by default the class paths generator should have created your classes by all disabled.

  • Start, your server, go to the admin panel > Classes & Levels > Class Paths > edit each, set the enabled = true, and save.

[Know bug v4.0.0-beta.38.3] - Fix the records directly in the database with a query like the following:

UPDATE `skills_class_path` SET `enabled` = 1;

After running the two imports, you should be able to start your server, register a player and reach the class path selection screen:


4 - Generating and importing data through the admin panel

To get your game up and running at this point you need a RoomScene.

The main requirement to create a RoomScene is the map in JSON format, which needs to follow all the name conventions and rules in order to work properly.

At this point you could:

For the documentation we will use the Maps Wizard (maps-wizard.md), so follow the instructions in the link.

The last step here will be to change the default config to set your player initial class and map:

In the admin panel go to the configuration section and filter by the following paths:

  • players/initialState/room_id

  • players/actions/initialClassPathId

By default, these values are set as "1", but since you created two class paths, and multiple town maps here you need to set the IDs if any of those.

For example, if you like to have a mage as default class path, or if you like to start in town 4 instead of town 1.

With the maps generated you are able to get into your game already! You can move forward on the customizations section.

Last updated