Reldens - Documentation
Go to websiteCheck our demo!Source GitHub
  • Documentation
  • What is Reldens?
  • Admin Panel
  • System Configuration
  • Contents creation
  • Customize your game
  • Demo server setup - Amazon Linux (2024)
  • Generators and import
  • Installation
  • Known issues
  • How to create a new Room/Scene?
  • Maps Wizard
  • System requirements
  • assets
    • object-sprite
    • player-sprite
    • skill-sprite
  • entities
    • Class Path
    • Item
    • Level Modifiers
    • Level
    • Levels Set
    • Objects
    • Respawn Areas
    • Rooms
    • Skill Types
    • Skill
    • Stats
    • Target Options
  • general
    • Actions
    • Create and configure a player spritesheet
    • Events Manager
    • Operations
    • Plugins
    • Project structure
  • generators
    • Attributes per level generator
    • Enemies experience rewards per level
    • map-composite-file
    • maps-elements
    • Generate multiple maps by loader generator
    • Generate multiple maps with associations by loader generator
    • Generate a single map by elements composite loader
    • Generate a single map by elements object loader
    • Players experience per level generator
  • importers
    • Objects Importer
    • Skills Importer
  • packages
    • tile-map-generator
      • The "composite" approach
      • Tile Map Generator
      • The "objects" approach
Powered by GitBook
On this page
  1. generators

Players experience per level generator

PreviousGenerate a single map by elements object loaderNextimporters

Last updated 4 months ago

This generator will create a file with all the "levels" required data so you can import them in Reldens.

Require parameters:

  • "startExp": is the experience required to reach the first level.

  • "baseGrowthFactor": this is the multiplier by which the previous level experience will be multiplied, and it's going to be incremented on each level iteration by the "growthIncrease" property.

  • "baseGrowthFactorPerLevel": this is a container to specify a new "growthFactor" starting the specified level. Following the example below, this way if the initial growthFactor is 2, it will be applied until the level 5 when it changes to 1.5. It is normal to decrease this value according the required experience increase, otherwise the required experience will get too high in the latest levels.

  • "maxLevel": loop will generate data until this level inclusive.

  • "growthIncrease": as noted above this value is used to increase the "baseGrowthFactor" per level iteration.

To use the generator follow these steps:

  • Go to your game folder and create a folder called "generate-data".

  • Inside the created folder create a new file named "players-experience-per-level.json".

  • Save the following content in the file:

{
    "startExp": 10,
    "baseGrowthFactor": 2,
    "baseGrowthFactorPerLevel": {
        "5": 1.5,
        "10": 1.35,
        "15": 1.271,
        "20": 1.1,
        "40": 1
    },
    "maxLevel": 100,
    "growthIncrease": 0.005
}

This JSON contains the parameters that will be passed to the players-experience-per-level command.

  • Run the following command:

$ npx reldens-generate players-experience-per-level ./generate-data/players-experience-per-level.json
  • As result, a new folder called "generated" will be created under your "game" folder, and there you will find a file with the generated data like:

{
    "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
    }
....

Open a console for the command line in your game folder. As next, we need to generate the for those sets.

The generator code can be found here: https://github.com/damian-pastorini/game-data-generator/blob/master/lib/generator/players-experience-per-level.js
"levels"