game percentage ?

Game development with Board Game Arena Studio
Post Reply
Ditto11
Posts: 97
Joined: 31 March 2023, 19:14

game percentage ?

Post by Ditto11 »

Hi, got a new game in alpha, and I going through the checklist of items to look for, I see this one:

>> The game progression percentage doesn't stay stuck at zero from start to end;

Ok .. so I took a peek at ongoing games, to see what their % complete was .. and noticed something odd ... they seem to all start at 50% ?
Is this just an Alpha thing?

Or is there somewhere I can/should influence that in my game setup? (ie games start at 0% .. or 10% .. or .. whatever .. ) and at what rate do they gain % ?
User avatar
Kayvon
Posts: 470
Joined: 17 October 2011, 01:39

Re: game percentage ?

Post by Kayvon »

The PHP function getGameProgression() needs to provide the game completion percentage as an integer. The states.inc.php file determines how often that function is called.

Full details are available in the PHP docs.
Ditto11
Posts: 97
Joined: 31 March 2023, 19:14

Re: game percentage ?

Post by Ditto11 »

Kayvon wrote: 22 September 2024, 00:57 The PHP function getGameProgression() needs to provide the game completion percentage as an integer. The states.inc.php file determines how often that function is called.

Full details are available in the PHP docs.
ahhh .. perfect .. thank you !

for whatever reason, that function was coded like this:

Code: Select all

    function getGameProgression()
    {
        // Compute the progression percentage
        $sql = "SELECT sum(piece_captured) captured_count FROM piece GROUP BY player_id ORDER BY sum(piece_captured) DESC";
        $captured = self::getCollectionFromDB( $sql );
        $max_captured = array_shift( $captured );
        
        return floor( (( $max_captured['captured_count'] / $this->gameConstants[self::getGameStateValue( "game_variant" )]['MAX_PIECES'] * 100) / 2 ) + 50 );   // Note: 50 => 100
    }
which seems a bit odd to me .. so I'm going to think that math over a bit more :)

But thanks for pointing me in the right direction. Appreciate it!
Thalack
Posts: 44
Joined: 31 July 2022, 19:42

Re: game percentage ?

Post by Thalack »

Players will get a penalty when conceding a game with progression < 50%, so sometimes it might make sense to put progression at 50% sooner to not force players to play a game until 50% when it has already been decided.
Ditto11
Posts: 97
Joined: 31 March 2023, 19:14

Re: game percentage ?

Post by Ditto11 »

Thalack wrote: 22 September 2024, 12:38 Players will get a penalty when conceding a game with progression < 50%, so sometimes it might make sense to put progression at 50% sooner to not force players to play a game until 50% when it has already been decided.
Right ... figured it was something like that ... so I've come up with a neat little diminishing returns formula ... it climbs to 50% fairly quickly, then slows down (which sort of makes sense with a chess-like game ... )

but yeah, thanks for explanation :)
User avatar
nicotacotac
Posts: 72
Joined: 20 March 2020, 13:42

Re: game percentage ?

Post by nicotacotac »

Thalack wrote: 22 September 2024, 12:38 Players will get a penalty when conceding a game with progression < 50%, so sometimes it might make sense to put progression at 50% sooner to not force players to play a game until 50% when it has already been decided.
I think that is even not possible at all to concede before 50% progress
User avatar
ufm
Posts: 1609
Joined: 06 January 2017, 08:38

Re: game percentage ?

Post by ufm »

Thalack wrote: 22 September 2024, 12:38 Players will get a penalty when conceding a game with progression < 50%, so sometimes it might make sense to put progression at 50% sooner to not force players to play a game until 50% when it has already been decided.
Conceding before 50% is impossible.
If you've seen that somehow, it is either a bug in progression display or quitting rather than conceding.
Ceaseless
Posts: 402
Joined: 12 November 2022, 17:06

Re: game percentage ?

Post by Ceaseless »

Thalack is likely using concede in its conventional manner, rather than the BGA keyword, given they refer to conceding with penalty. In BGA's terms, conceding doesn't give any penalties, though BGA's keyword for conceding is hardly the standard. While obviously a BGA game should have the game progression at 50% from the start, not every game uses such common sense.
Thalack
Posts: 44
Joined: 31 July 2022, 19:42

Re: game percentage ?

Post by Thalack »

Ah I wasn't even aware of the difference lol (never conceded or quit a game), so sorry for the confusion! The main point still stands though: you cannot end / get out of a game with progression < 50% without getting a penalty while it is possible >= 50% hence the progression calculation.
Post Reply

Return to “Developers”