[Bug] During the first state, notification are ignored

Game development with Board Game Arena Studio
Post Reply
User avatar
pikiou
Posts: 389
Joined: 03 October 2011, 05:36

[Bug] During the first state, notification are ignored

Post by pikiou »

In states.inc.php I have this as the next state after gameSetup:

Code: Select all

   2 => array(
      "name" => "test",
      "description" => '',
      "descriptionmyturn" => '',
      "type" => "activeplayer", 
      "action" => "stTest",
      "possibleactions" => array("playCard"),
      "transitions" => array("playCard" => 2)
   ),
And in gamename.game.php:

Code: Select all

   function stTest() {
      self::notifyAllPlayers("testing", '', array());
   }
Well, when I start the game, self::notifyAllPlayers is called but no notification is received.
And if I play a card, which runs state 2 again, a notification is received, as expected.

Ow, and placing this.setupNotifications() in the dojo object constructor doesn't change anything.
User avatar
sourisdudesert
Administrateur
Posts: 4630
Joined: 23 January 2010, 22:02

Re: [Bug] During the first state, notification are ignored

Post by sourisdudesert »

Hello,

In fact, your notification is sent when the game is created. At this step, players are not on the game page so no one is there to receive the notification.

Cheers,
User avatar
Ralchimist
Posts: 14
Joined: 09 May 2020, 10:46

Re: [Bug] During the first state, notification are ignored

Post by Ralchimist »

Hello,

sorry to move up this old topic, but I would like to know the good way to notify players at the very beginning of the game. (before the first player turn)

In my game, I have to roll dices and notify players with the animation and the result.
Should I create a new player action to make the first player click so I can send the notification?
Or is there another way?
If it exist, i'll prefer to avoid a player action, like a condition "if all players are on table"=> send notification.

NB: my code works fine on the next turns. Only the first doesn't work.

Thanks for your help.
vincentt
Posts: 254
Joined: 01 September 2017, 17:25

Re: [Bug] During the first state, notification are ignored

Post by vincentt »

Hi,

I had the same issue on Dice Forge, and the easiest way to do it was to have the dice already rolled and the information displayed in the log.
You can take a look at the project/game if you wish.

Cheers

Vincent
User avatar
Ralchimist
Posts: 14
Joined: 09 May 2020, 10:46

Re: [Bug] During the first state, notification are ignored

Post by Ralchimist »

Hi Vincent,

thanks for your answer.
Currently that's what I've done on my project.

So do you confirm there is no solution to start animation just after players join? (I have to insist because this could really increase my game experience)
User avatar
XCID
Posts: 78
Joined: 26 March 2020, 01:45

Re: [Bug] During the first state, notification are ignored

Post by XCID »

Hi,

I am also in the process of developing my first game here, and I will also have to find a solution for this problem. Although the proposed solution is working and players can see in the log what happened during the setup process, I also wish they could see the actual animations.

In the game Solo, which was developed by Dr. Karotte, who is quite active in the forums, he implemented a "Ready" Button for all players to click, once their game is loaded. That will start the setup process. Don't know if it was for this exact reason, but that is another way to deal with the problem.
vincentt
Posts: 254
Joined: 01 September 2017, 17:25

Re: [Bug] During the first state, notification are ignored

Post by vincentt »

Hi

In term of user experience, I am not sure that a ready button is important when you are not linked to time decision. But you can still do it like this if necessary.
In DF, when we added the Draft Mode, at the end I do think that the animation of setup are rolled but I would have to check.

Vincent
User avatar
Ralchimist
Posts: 14
Joined: 09 May 2020, 10:46

Re: [Bug] During the first state, notification are ignored

Post by Ralchimist »

in the game Solo, which was developed by Dr. Karotte, who is quite active in the forums, he implemented a "Ready" Button for all players to click, once their game is loaded. That will start the setup process. Don't know if it was for this exact reason, but that is another way to deal with the problem.
In term of user experience, I am not sure that a ready button is important when you are not linked to time decision. But you can still do it like this if necessary.
I will try this solution:
create a "ghost" multiplayer state, which is automatically end in javascript for each player (auto-click on a button).
So my animation should start.

I'll let you now asap!

Thanks for your contribution!
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Re: [Bug] During the first state, notification are ignored

Post by RicardoRix »

You can have animations in your JS setup function if you like.
Post Reply

Return to “Developers”