Page 1 of 1

Turn based games + scoring tables

Posted: 28 June 2020, 02:43
by QuasarDuke
I received an interesting bug report: https://boardgamearena.com/bug?id=18937 that said my scoring tables were not being displayed for turn-based games. I quickly realized what was going on - my

Code: Select all

notifyAllPlayers("tableWindow" ...
code was running as part of the logic I have to end the hand and transition to the next hand / end of game. I don't currently have a dedicated state for displaying the score.

My getAllDatas() function does not trigger any scoring dialog. This means that when a turn-based player returns to the game, getAllDatas() is called which loads the current game state ... which is already after the tableWindow scoring dialog.

Is there a good way to ensure that turn-based players see the scoring table at the end of each hand, or do I need to add a multipleplayersactive state? I'd prefer not to do that, because for turn-based players that means that each player would have to "waste a turn" just clicking ok on my scoring popup. They would then need to wait for everyone else to dismiss the scoring dialog before they could proceed with the next hand.

Re: Turn based games + scoring tables

Posted: 28 June 2020, 08:22
by Brainchild
I've observed this behaviour in several games on BGA. I think it's an acceptable limitation of playing turn-based. The scoring table doesn't contain any critical game information. Forcing this table to display would be like replaying all the piece movement animations when a turn-based player comes back to the table. They can just look at the board and observe the state of the game.

If you feel that something in the scoring table is important, you could duplicate it in the game log. Russian Railroads takes this approach.

Re: Turn based games + scoring tables

Posted: 28 June 2020, 18:07
by Inaofr
If you really want to ensure the table will be displayed once for each player you may record on server side a list indicating which player has not closed the table dialog yet (all before sending the "tableWindow" notification). When a player closes the dialog, you notify it to the server side (using ajax) and you remove this player id from the list. If a getAllDatas is done, you check if the player is in the list, if yes you set a flag in the returned data to trigger the dialog display (or maybe you can just send a notifyPlayer on "tableWindow" for this player, if it works it's avoiding to have two way of triggering the dialog).

Re: Turn based games + scoring tables

Posted: 28 June 2020, 18:23
by RicardoRix
sushi-go seems to have fixed this problem, it looks like a multiplayer game state.

Re: Turn based games + scoring tables

Posted: 07 April 2022, 19:47
by SteveD123
Is there example code of how this was done in Sushi Go? (or any other game)

Re: Turn based games + scoring tables

Posted: 08 April 2022, 10:48
by RicardoRix
SteveD123 wrote: 07 April 2022, 19:47 Is there example code of how this was done in Sushi Go? (or any other game)
This might be the help you're looking for:
https://boardgamearena.com/forum/viewto ... 12&t=18322