Skip to content
ThisALV edited this page Jan 23, 2021 · 1 revision

RpgBookOnline - User's manual

This page explains the basics about any RPG made with this game and about modding. The Rbo project is still WIP, so technical details (like Lua API or game.json and scenes.lua structures) will not be treated as it may change in the future. Also some of these details would became irrelevant when RPG editor would be released as I take care of avoiding the end-user to manipulate technical stuff.

Gameplay

Game proceedings

The server hosts a lobby that players join, so they become lobby members. Once every member is ready, a countdown is started and when it's over, the server asks the room master (member with the lowest ID) for game configuration.

When game configuration is done, a session is started by the lobby and then the game begins.

Stats

Each player and each enemy has its own stats that might be blocked with min and max values, but there are also stats which are shared among all players, known as global stats.

Inventories

Each player also has its own inventories. An inventory, identified by its name, might be capped with a limited count of items, this limit is the capacity of the inventory. An inventory has a list of items name which represents the names of each item that can belong to the inventory. Every item in the inventory is associated with a quantity, the item's count.

Death and game's end conditions

An RPG may define some conditions that will make a player die or make the game stop. The two categories of conditions are separated into game.json.

An exemple of a player death condition would be HP =< 0 and an exemple of game's end condition would be "Victory points" >= 30.

Enemies and groups

An enemy is created by using its character sheet defined in game.json. It has an unique name (or contextual name), a generic name which is the name of its character sheet and two stats, hp ans skill.

Enemies can only be manipulated by using enemies groups. These groups themselves can only be created using enemies group sheet loaded from game.json. An enemies group is basically a queue of enemies designed to switch current target from one enemy to the next in purpose to make easier a round-by-round battle system.

Events

To modify player characteristics (inventories or stats), the end-user way is to call an event defined and named in game.json which describe the modifications of items quantity and stats value.

RPG creation

The server provides a Lua API used by the functions defined in the Rbo Lua table in the instructions/ directory. Each file in this directory is executed so each function is loaded.

Each of these functions is called an instruction. This is what the end-user uses to make RPGs. An instruction might have a return value, in which case it will be used as an ID of the next scene to go, or might not have any return value, in which case the server continue to the next instruction. If the end of the scene (or page) is reached and none of the instructions in it returned any values, then the game is stopped.

Soon, an editor will allow the end-user to create RPGs without having to edit by hand game.json and scenes.lua. Until that point, you can see an exemple of game.json, scenes.lua and an exemple of an instruction implemented with a mod (Custom.lua) in the sample game provided by this GitHub repository. (more details about the game data files)

Load any RPG

Here is how game data is stored inside directories :

  • game/
    • game.json // Basic data like enemies, events, stats, inventories, etc.
    • scenes.lua // Script of the RPG, contains all the scenes
    • chkpts.json // Contains every checkpoint saved
  • instructions/
    • Base.lua // Contains basic game instructions, called by the scenes script
    • ... // Might contains other .lua files

If your game need additional instructions, it's preferred to create new .lua files into instructions/ so you can share these files when sharing your game easily. This is how you can mod your game.

You also need to give game.json and scenes.lua if you want to share your RPG.