Turn based games + scoring tables

Game development with Board Game Arena Studio
Post Reply
User avatar
QuasarDuke
Posts: 18
Joined: 22 March 2020, 00:46

Turn based games + scoring tables

Post 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.
User avatar
Brainchild
Posts: 71
Joined: 31 January 2014, 19:42

Re: Turn based games + scoring tables

Post 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.
User avatar
Inaofr
Posts: 142
Joined: 26 March 2020, 22:26

Re: Turn based games + scoring tables

Post 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).
User avatar
RicardoRix
Posts: 2541
Joined: 29 April 2012, 23:43

Re: Turn based games + scoring tables

Post by RicardoRix »

sushi-go seems to have fixed this problem, it looks like a multiplayer game state.
User avatar
SteveD123
Posts: 9
Joined: 26 December 2021, 01:11

Re: Turn based games + scoring tables

Post by SteveD123 »

Is there example code of how this was done in Sushi Go? (or any other game)
User avatar
RicardoRix
Posts: 2541
Joined: 29 April 2012, 23:43

Re: Turn based games + scoring tables

Post 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
Post Reply

Return to “Developers”