-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Settings can be defined as meta data similar to the one for label but at the game mode itself. Also it has to define some environment settings and the default value. It would look like this:
mode GameMode {
with bool optBool = false;
with int{0, 5} intOptRanged = 1; // only int values between 0 and 5 (both inclusive) are allowed
with int intOptUnlimited = 0; // all uint 64 values are allowed
with string{"regex pattern", "pattern2"} optString= "default"; // string value which must match all regex pattern
with string optString2 = "default"; // string value with no limits
with option{Opt1, Opt2} enumLikeOpt = option Opt1; // One option from a predefined set.
}
We allow the same types as for labels but with some changes:
- All meta values do need a default value (this is not the case for labels) that are used when the instance of the game mode is created. They are no maybe types (might be tricky to visualize them).
- Types can define restrictions which are checked when the user changes a setting. Those restrictions are also streamed to the UI to make editing easier. It is not allowed to start a game with an invalid configuration.
- A new type
optionis introduced. It is handled similar like an enum in such a way that valid variants are listed first. The options are the same options that are also used for votings. - The
charactertype is handled a different way. It cannot have a default value and it is the only one that is a maybe type. In the UI the user can select a player and when the game is started it is replaced by the respective character.
They are no additional checks or handler for changed values planed. You can only define what settings exists and some conditions and that's it. This is done to have this as simple as possible and make it easier to use. The user should be allowed to enable or disable certain features and shouldn't read a 50 page documentation on how to set everything up.
They are also no hidden settings planed. If you need such things, you can just use a label and assign it to the game. Such are never displayed to the user.