Page 1 of 2
More controls and cross checks on game options
Posted: 28 September 2021, 10:20
by disu
Hi,
I'm developing a self-published game with werewolf style, so a game in which every player a specific character, randomly assigned, with a specific role.
Suppose I have 4 character types and everyone can be assigned to 0-N players, depending on game selected options.
I have created 4 options (characterA_number, characterB_number, characterC_number and characterD_number) that determine how many characters of any type should be present in game.
In the options I am able to define for example that I can insert at most 2 characterA, or 3 characterB in a 4 players game.
But how can I combine them?
I am not able to check that, in a 4 players game, have not been inserted 2 characterA and 3 characterB, for a total of 5 characters in a 4 players game!
With the actual options rules I could use startcondition to check for other options selected value, but once at the time, not a combination of options. And also following this way, growing the number of characters (currently I have developed 7), I would get an exponential number of options conditions! Not very maintainable..
Re: More controls and cross checks on game options
Posted: 28 September 2021, 10:30
by Tisaac
Just throw an exception in setupNewGame and hope that players will be smart enough to understand why it's not working....
(I can't recall if error messages are displayed or not on prod for table setup).
Re: More controls and cross checks on game options
Posted: 28 September 2021, 10:38
by disu
I've already tried to throw an Exception (BgaUserException or BgaVisibleSystemException) but my message will not been shown on the alert. Instead it write, with both type of exception, the generic message:
Code: Select all
Unexpected error: Propagating error from GS 1 (method: createGame): BGA service error (1.studio.boardgamearena.com 28/09 11:33:09)
Unexpected error: Invalid player number for this game: 1
If I throw a generic Exception instead it give a more scary message for players

Re: More controls and cross checks on game options
Posted: 28 September 2021, 11:30
by Tisaac
disu wrote: ↑28 September 2021, 10:38
I've already tried to throw an Exception (BgaUserException or BgaVisibleSystemException) but my message will not been shown on the alert. Instead it write, with both type of exception, the generic message:
Code: Select all
Unexpected error: Propagating error from GS 1 (method: createGame): BGA service error (1.studio.boardgamearena.com 28/09 11:33:09)
Unexpected error: Invalid player number for this game: 1
If I throw a generic Exception instead it give a more scary message for players
I am afraid you can't do any better now

Another false solution would be to make this choice of characters at the start of the game instead of in the game creation lobby, but there are a lot of disadvantages to that.
Re: More controls and cross checks on game options
Posted: 30 September 2021, 00:17
by Victoria_La
I think best would be to trim the numbers to fit and start a game with warning such as
"The selected option combination is not possible as total number of character is greater than max, the following combination is used:
describe here how many of which
You can continue game like this or abandon game collectively and start with corrected options"
Most people will likey will just play with whatever your trimmed configuration is.
Re: More controls and cross checks on game options
Posted: 05 October 2021, 15:01
by disu
Victoria_La wrote: ↑30 September 2021, 00:17
I think best would be to trim the numbers to fit and start a game with warning such as
"The selected option combination is not possible as total number of character is greater than max, the following combination is used:
describe here how many of which
You can continue game like this or abandon game collectively and start with corrected options"
Most people will likey will just play with whatever your trimmed configuration is.
Sorry can you explain me better? You suggest to show the warning to player after the game starts?
Re: More controls and cross checks on game options
Posted: 05 October 2021, 15:10
by Tisaac
disu wrote: ↑05 October 2021, 15:01
Victoria_La wrote: ↑30 September 2021, 00:17
I think best would be to trim the numbers to fit and start a game with warning such as
"The selected option combination is not possible as total number of character is greater than max, the following combination is used:
describe here how many of which
You can continue game like this or abandon game collectively and start with corrected options"
Most people will likey will just play with whatever your trimmed configuration is.
Sorry can you explain me better? You suggest to show the warning to player after the game starts?
Exactly. Start the game anyway but use a default configuration in case the one the players choose is not valid, and display a message to explain that.
Re: More controls and cross checks on game options
Posted: 05 October 2021, 21:14
by Victoria_La
disu wrote: ↑05 October 2021, 15:01
Victoria_La wrote: ↑30 September 2021, 00:17
Most people will likey will just play with whatever your trimmed configuration is.
Sorry can you explain me better? You suggest to show the warning to player after the game starts?
You saying players choose card A - 2 and card B - 3, but only 4 it total allowed. So I was saying then make it A x2 and Bx2 and start with warning.
Re: More controls and cross checks on game options
Posted: 06 October 2021, 17:54
by disu
Thanks, good idea!
Now I have to decide the default configurations

it is not simple with 10 or more options
Re: More controls and cross checks on game options
Posted: 18 November 2021, 21:03
by disu
I try to throw a BgaUserException in the first state after gameSetup, to achieve my need on game option check, but it gives me:
Unexpected error: Propagating error from GS 1 (method: createGame): BGA service error (reference: GS1 18/11 20:59:25) (reference: GS0 18/11 20:59:25)
Unexpected error: Invalid player number for this game: 1 (reference: GS0 18/11 20:59:25)
If I put another equal exception in the next turn phase it is correctly triggered and shown.
Seems that that exception block the game start, so it is not shown and the setup has not been executed.
Is there another bga function to show an alert in a particular phase? (also not big, red and scary!)