Page 1 of 1

game percentage ?

Posted: 21 September 2024, 22:43
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 % ?

Re: game percentage ?

Posted: 22 September 2024, 00:57
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.

Re: game percentage ?

Posted: 22 September 2024, 01:01
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!

Re: game percentage ?

Posted: 22 September 2024, 12:38
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.

Re: game percentage ?

Posted: 22 September 2024, 20:46
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 :)

Re: game percentage ?

Posted: 27 September 2024, 17:55
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

Re: game percentage ?

Posted: 27 September 2024, 17:59
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.

Re: game percentage ?

Posted: 28 September 2024, 04:16
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.

Re: game percentage ?

Posted: 28 September 2024, 21:01
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.