log order change on refresh

Game development with Board Game Arena Studio
Post Reply
User avatar
Ralchimist
Posts: 14
Joined: 09 May 2020, 10:46

log order change on refresh

Post by Ralchimist »

Hi!

I have an "issue" with log notification.
Here is my code: (with 3 notifications)

Code: Select all

 self::notifyAllPlayers( "noClaimer", clienttranslate( 'Nobody claims ${TileId}.' ), array(
                'TileId' => $tiletoclaim['id'], 
                'tile_type' => $tiletoclaim['type'],
                'tile_value' => $tiletoclaim['type_arg'],
            ) );
            self::notifyAllPlayers('pickTile', clienttranslate( '${player_name} pick a tile from the Great Wall.' ), array (
                    'deck_from'=> 'greatwall', 
                    'player_id' => $player_id,
                    'player_name' => self::getActivePlayerName(),
                    'tile' => $newTile ));
                self::notifyPlayer( $player_id, 'blank', clienttranslate('${You} pick ${TileId}'), array(
                    "You" => "You",
                    "TileId" => $newTile['id'],
                ) );
In the log, I can see them in the right order and everything works fine:
first: Nobody claims ${TileId}
second: ${player_name} pick a tile from the Great Wall
third: ${You} pick ${TileId}

But when I refresh the page, the order of logs is modified:
first: ${You} pick ${TileId}
second: Nobody claims ${TileId}
third: ${player_name} pick a tile from the Great Wall

The self::notifyPlayer displays before the self::notifyAllPlayers...

maybe I've done something wrong.
Thanks for your help!
User avatar
Ralchimist
Posts: 14
Joined: 09 May 2020, 10:46

Re: log order change on refresh

Post by Ralchimist »

up! I still have the issue.
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: log order change on refresh

Post by Victoria_La »

Does t really matter? When you refresh they probably become different type of notifications, i.e history which only used to show log text
User avatar
Ralchimist
Posts: 14
Joined: 09 May 2020, 10:46

Re: log order change on refresh

Post by Ralchimist »

I come back to this problem.
If there's notifyPlayer log and notifyAll log at the same timing(minute ranged), on refresh the notifyPlayer log appears first...

Why logs do not appear in precise (milliseconds or seconds?) chronological order?
User avatar
LaszloK
Posts: 36
Joined: 05 January 2018, 19:00

Re: log order change on refresh

Post by LaszloK »

It's probably something to do with how log entries are stored in the DB. The same thing happens in a lot of games. Look at a Hanabi replay log - things look pretty odd there, too.

Ideally this should be fixed site-wide, but as it is just a minor inconvenience in most games (if that) I wouldn't hold my breath. If you can present a compelling case as to why it's a major problem for you, that might change things, of course.
User avatar
ShaPhi7
Posts: 37
Joined: 22 April 2020, 20:44

Re: log order change on refresh

Post by ShaPhi7 »

Bumping this up to check to see if anyone has any good ideas for solutions on this, as it's still an issue.

I'm working on a premium game, where the turn based game is currently close to unplayable because of notifications showing as in the correct order.

I've only been able to come up with rubbish workarounds such as numbering notifications (which will look pretty awful to the user and adds complication to the code).

I'd be really keen to here ideas on how to address this.
User avatar
ShaPhi7
Posts: 37
Joined: 22 April 2020, 20:44

Re: log order change on refresh

Post by ShaPhi7 »

I think the easiest way for me to solve this is by grouping notifications together, rather than firing multiple notifications off in a short space of time. Hopefully this doesn't impact the gameplay too much.

I would still be keen to hear potential ideas/solutions from the community here.
Post Reply

Return to “Developers”