Storing intermediate or secret values in statistics

Game development with Board Game Arena Studio
Post Reply
User avatar
salty-horse
Posts: 78
Joined: 14 June 2012, 23:08

Storing intermediate or secret values in statistics

Post by salty-horse »

I have an "average number of points" statistic that I can only set at the end of the game.
Can I use that statistics to score the sum, and only divide it at the end of the game?

Does this cause problems if the game ends prematurely (by players quitting)? Are statistics displayed in that situation?

Also, is it OK to store information in statistics that should be hidden from other players? Are the stats only observable at the end of the game?
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Storing intermediate or secret values in statistics

Post by Een »

It's better to not use statistics out of their regular scope.
I'd advise using a game state variable for this.
User avatar
salty-horse
Posts: 78
Joined: 14 June 2012, 23:08

Re: Storing intermediate or secret values in statistics

Post by salty-horse »

OK.

What about hidden information? Are the accumulated statistics hidden from players until the end of the game?
User avatar
salty-horse
Posts: 78
Joined: 14 June 2012, 23:08

Re: Storing intermediate or secret values in statistics

Post by salty-horse »

Followup question to the recommendation: What's the recommended way for using per-player game state variables?

I currently have hardcoded player1Foo, player2Foo variables, and translate from player ID to player index when I access them.

Is there a way to initialize these dynamically with the player IDs as part of the name?
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: Storing intermediate or secret values in statistics

Post by Tisaac »

salty-horse wrote: 10 October 2022, 09:40 Followup question to the recommendation: What's the recommended way for using per-player game state variables?

I currently have hardcoded player1Foo, player2Foo variables, and translate from player ID to player index when I access them.

Is there a way to initialize these dynamically with the player IDs as part of the name?
Not sure to understand the question. What are you trying to achieve ?
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Storing intermediate or secret values in statistics

Post by Een »

salty-horse wrote: 10 October 2022, 09:31 OK.

What about hidden information? Are the accumulated statistics hidden from players until the end of the game?
At the moment yes, but I don't think we can guarantee that for the future, so it would probably be better to compute these kind of statistics at the end of the game.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Storing intermediate or secret values in statistics

Post by Een »

salty-horse wrote: 10 October 2022, 09:40 Followup question to the recommendation: What's the recommended way for using per-player game state variables?
Please don't do that :) Much better/cleaner to add a field on the player table in the database (I was thinking table statistic and not player statistic when I suggested using game state variables)
User avatar
salty-horse
Posts: 78
Joined: 14 June 2012, 23:08

Re: Storing intermediate or secret values in statistics

Post by salty-horse »

Een wrote: 10 October 2022, 10:44Please don't do that :) Much better/cleaner to add a field on the player table in the database (I was thinking table statistic and not player statistic when I suggested using game state variables)
Ah, of course! Thanks!
Post Reply

Return to “Developers”