Explanations of the game structure and configuration.
The roles must be defined in configuration/game_manager/roles/
.
They are defined in a JSON file.
All default roles are defined in the following order (order counts in Discord!):
DEV
: role of developers.- Should have admin rights. Should be above
BOT
role.
- Should have admin rights. Should be above
BOT
: role of the main bot.- Must have admin rights.
SINGER
(optional): role of singer bots. Must have admin rights.- Used in minigames:
ask_words
- Used in minigames:
MASTER
: role of game masters.- Should have all permissions (except admin).
CHARACTER1
(optional): role for character n°1.- Should have team permissions.
- By default, it is used in minigames:
enigmas
- By default, can see the channels:
ROOM1
CHARACTER2
(optional): role for character n°2.- Should have team permissions.
- By default, it is used in minigames:
ask_words
- By default, can see the channels:
ROOM2
ROOM2_VOICE
CHARACTER3
(optional): role for character n°3.- Should have team permissions.
- By default, it is used in minigames:
offices_game
- By default, can see the channels:
ROOM3
CHARACTER4
(optional): role for character n°4.- Should have team permissions.
- By default, it is used in minigames:
offices_game
- By default, can see the channels:
ROOM4_VOICE
TEAM1
/TEAM2
/TEAM3
(optional): roles for different teams.- Should have team permissions.
- By default, they are used in minigames:
count_everyone
find_the_recipe
attic_game
map_game
chest_game
- By default, can see all the channels in categories
TEAM1
/TEAM2
/TEAM3
VISITOR
: role of a player.- Should have the permissions:
change nickname
view channels
read message history
connect
- By default, they are used in minigames:
count_everyone
find_the_recipe
attic_game
map_game
chest_game
- By default, can see all the channels in categories
TEAM1
/TEAM2
/TEAM3
- Should have the permissions:
DEFAULT
: correspond to the role@everyone
- It is recommended to grant at least the the permission
use_voice_activation
for a better experience. - Must remain the last role in the enum!
- It is recommended to grant at least the the permission
Team permissions are the following by default:
- Recommended:
change_nickname
,view_channel
,send_messages
,connect
,speak
,use_voice_activation
,read_message_history
. - Optional (by default):
create_instant_invite
,attach_files
,mention_everyone
,add_reactions
. - Optional (not by default):
embed_links
,stream
. - Not recommended: other permissions are not recommended as they grant too much rights.
Default roles are used in administration tools and default minigames. Therefore:
- It is possible to edit default roles (permissions changes are however not recommended).
- It is not recommended to delete default roles.
- It is possible to add new roles, that must be written after the
BOT
role in order to be controllable by the bot.
The channels must be defined in configuration/game_manager/category_channels
for categories
and configuration/game_manager/channels
for text and voice channels in a JSON file.
Default categories are the following:
WELCOME
(optional): first category that should contain visible channelsDEV
: category reserved for development (rolesDEV
andBOT
)MASTER
: category reserved for game masters (rolesMASTER
andBOT
)SPECIAL
(optional): category recommended for specific channels linked to character rolesTEAM1
/TEAM2
/TEAM3
(optional): categories for teams (rolesTEAM1
/TEAM2
/TEAM3
)
Default categories structure the game. Therefore:
- It is possible to edit default categories (permissions changes are however not recommended).
- It is possible to add new categories.
Default channels are almost all used as default channel in a mini-game. Therefore:
- It is possible to edit default channels (permissions changes are however not recommended).
- It is not recommended to delete default channels, unless you remove the associated mini-game or change its default channel
- It is possible to add new channels.
- Some channels are used by administration tools and should not be removed:
WELCOME
: (for everyone) default channel for invitation linkLOG
: (forDEV
) logs returned by the logger are sent to this channel through a webhookMEMO
: (forMASTER
) default channel where tips or instructions are send to game master while a mini-game is initialized or runningCOMMANDS
: (forMASTER
) channel to send master commands.EVENTS
: (forDEV
andMASTER
) information are given by the administration tools and administration commands can be written.BOARD
: (forMASTER
) board with all minigames that can be controlled with Discord reactions
Bots and webhook have a name and an avatar that are defined in configuration/game_manager/characters/
in a JSON file.
There should be only one character of type 'bot'.
Default emojis are defined in configuration/emojis.py
in the enum Emojis
. All emojis must be different.
All versions (or translations)
are stored in a directory corresponding to a minigame and under the filename patter [NAME_OF_THE_TRANSLATION].json
.
To develop a new minigame compatible with versions, the code to write is,
assuming a translation is available in configuration/my_minigame/
:
from helpers import TranslationDict
from game_models import AbstractMiniGame
class Messages(TranslationDict):
INTRO = "Default message with a string to format: {format_your_custom_text_here}"
MESSAGES = Messages(path="configuration/my_minigame")
class MyMiniGame(AbstractMiniGame):
_default_messages = MESSAGES
def __init__(self, **kwargs):
super().__init__(**kwargs)
def access_a_translation_key(self, key, value_to_format):
return self._messages[key].format(format_your_custom_text_here=value_to_format)
print(MyMiniGame().access_a_translation_key("INTRO", "Hello!"))
The class Messages
is the default translation, used if no translation is found in configuration/my_minigame/
.
The classes attributes names are the same as the JSON keys that should be present in the translation.
If no correct translation exists, the attributes values are used,
if a correct translation is found, the translation is used.
Note that defining the Messages
class is not mandatory, but recommended for an easier game development
(separation of code and translation, easy way to know which keys to create when writing a translation, ...)
and to avoid errors in the case a translation is not formatted correctly.
The guild properties (name and avatar) are defined in configuration/game_manager/guilds/
in a JSON file.
The key used by default is STANDARD
. There is no built-in function to use other keys.
A bot with the role SINGER
is necessary for the game AskWords
and is recommended
to play ambiance songs during the game.
The bot Octave is an example of a Discord bot that can play music
In game_configuration/game_manager/minigames/
, it is possible to configure the minigames in multiple ways:
- Choose to include or not a minigame
- Add a name and a description to help game masters link the minigames to the translations
- Choose the channels, roles and members that can interact with a minigame
- Configure whether a minigame should start automatically
- Configure custom minigame options
It is not possible to configure utils to avoid incorrect configurations.
With the default roles, channels and permissions, the game play should be as follows:
IntroductionGame
inWELCOME
channel. The game master can speak to players inSUPPORT_VOICE
channel. During the "game", players take the roleVISITOR
and then choose a team and get one of theTEAM
roles. The game master should activate the first step ofIntroductionGame
with an emoji reminded inCOMMANDS
channel.- By team, in each
TEAM
category channel, the same channels and games are present.CountEveryone
inPARK
channels. When game is over, the next game is started automatically. The game master should activate this game for each channel inBOARD
channel.FindTheRecipe
inKITCHEN
channels. When game is over, the next game is started automatically.AtticGame
inATTIC
channels. Two objects have two be found. Each object starts the two following minigames.MapGame
inMAP_ROOM
channels. Uses an external enigma.ChestGame
inCHEST_ROOM
channels. Needs the completion ofMapGame
to be completed. When game is over, a role menu appears: each team player must choose aCHARACTER
role and will a specific enigma
- Depending on the role chosen at the end of
ChestGame
, players can play one of these games:EnigmasGame
inROOM1
for rolesCHARACTER1
. The game master should activate this game for the channel inBOARD
channel.AskWords
inROOM2
andROOM2_VOICE
for rolesCHARACTER2
. The game master should activate this game for the channel inBOARD
channel.OfficesGame
inROOM3
for roleCHARACTER3
. This game is a cooperation game withCHARACTER4
.OfficesGame
inROOM4_VOICE
for roleCHARACTER4
. This game is a cooperation game withCHARACTER3
.
- Each of the three minigames should deliver a clue to write in
MAIN_ROOM
whereEndGame
is running. When every clue has been sent, the game should deliver a new clue to be sent inMAIN_ROOM
again. Once this last clue has been sent, the permissions ofRESTRICTED_ROOM
are synced withWELCOME
category, so eachVISITOR
can connect and each player with a team can speak (everyone normally). The game master can use the singer bot to play a victory song. Then, it is possible to debrief the game there.
Game play scheme:
WELCOME CATEGORY
IntroductionGame (WELCOME)
| TEAM CATEGORY
└──> CountEveryone (PARK)
└──> FindTheRecipe (KITCHEN)
└──> AtticGame (ATTIC)
└──> MapGame (MAP_ROOM) ---------
└──> ChestGame (CHEST_ROOM) <-˩ code
|
| SPECIAL CATEGORY
└──> EnigmasGame (ROOM1/ROOM1_VOICE) -----│ emoji
└──> AskWordsGame (ROOM2/ROOM2_VOICE) ----│ emoji
└──> OfficesGame (ROOM3/ROOM4_VOICE) -----│ emoji
WELCOME CATEGORY |
EndGame (MAIN_ROOM/RESTRICTED_ROOM) <-------------------------˩