Decimal scoring (half points)

Game development with Board Game Arena Studio
Post Reply
Angst03
Posts: 12
Joined: 01 September 2023, 19:04

Decimal scoring (half points)

Post by Angst03 »

Hi, in the game that i'm programming, some tokens scores half a point (0.5 or ½) and the "player_score" column is an Int by default. The first thing I tried is to multiply everything by 10 in the database and divide the score by 10 in my JavaScript. Works fine except in multiactive state so far but the game result page shows the database values so 10 times the actual values. I tried to modify the "player_score" column to Decimal(3, 1). The player board doesn't show the decimal value and game result page rounds the score (so a bit off, not sure if it's better than 10 times the actual values though).

Anyone knows a game with decimal or half point scoring in it or a way to better manage this than what I tried?
User avatar
ufm
Posts: 2039
Joined: 06 January 2017, 08:38

Re: Decimal scoring (half points)

Post by ufm »

Usually there are two ways:

- What you did (multiply by 10 and ignore the final screen mismatch)

- Use player_score_aux instead (this is usually used for tiebreakers)

I'd rather use the former option for simplicity.
Post Reply

Return to “Developers”