[SOLVED] Difference Studio and Private Alpha

Game development with Board Game Arena Studio
User avatar
Badguizmo
Posts: 76
Joined: 11 October 2020, 14:27

[SOLVED] Difference Studio and Private Alpha

Post by Badguizmo »

Hello everyone.

I was confident enough to ask admins to move Riftforce to private alpha (yes, not over confident to move to public yet :oops: ).

But some actions/animations that were working in studio are kind of broken in alpha.

For example, in the image https://imgur.com/a/kvZxZ5H, the yellow card is supposed to be mine.
When the opponent player is activating his "Plant 7" (the green one) it is supposed to deal 2 damages to the 6 light between the two numbers of the card (bottom for opponent and top for my cards), and move this card from under the 6 Ice to the top of the 5 Ice.

On the opponent view everything is Ok but on My view my card is moving to the opponent board with .
==> tested on Studio and the behaviour is the normal one (tested also with mimified version).

I am currently adding some logs to identify where is the problem but do you have any tips ?

FYI, in the JS for applying damages I am using this :

Code: Select all

applyDamageToCard(cardId, damageDealt, damageTotal, selfCard = false, cardOwnerId) {
var myPlayerId = this.player_id;
if (myPlayerId == cardOwnerId)
            {
                //FIXME : If this is My card, we add the class
                dojo.addClass('card_' + cardId, 'myCardHasDamage');
                verticalPostion = 0;
                bIsYoustring = 'my';
            }
            else
            {
                bIsYoustring = 'opponent';
                verticalPostion = (this.cardHeight - this.tokenHeight);
            }
...
}
and in the move card I am using this :

Code: Select all

if ((movedCardOwner == this.player_id))
            {
                fromLocation = 'myBoard' + moveFromBoard;
                tolocation = 'my' + tolocation;
                bIsYoustring = 'my';
            }
            else
            {
                //we are the active player and the moved car is not ours
                fromLocation = 'opponent' + moveFromBoard;
                tolocation = 'opponent' + tolocation;
                //htmlElement = 'jstpl_elemental_rotate';
                bIsYoustring = 'opponent';
            }
I think the problem comes from this part of the code because "bIsYoustring" is used to "SlideTo" object and to place vertically the damage tokens.
Last edited by Badguizmo on 28 June 2021, 21:21, edited 1 time in total.
Official BGA developper newb :oops:
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: Difference Studio and Private Alpha

Post by Tisaac »

Badguizmo wrote: 25 June 2021, 23:48 Hello everyone.

I was confident enough to ask admins to move Riftforce to private alpha (yes, not over confident to move to public yet :oops: ).

But some actions/animations that were working in studio are kind of broken in alpha.

For example, in the image https://imgur.com/a/kvZxZ5H, the yellow card is supposed to be mine.
When the opponent player is activating his "Plant 7" (the green one) it is supposed to deal 2 damages to the 6 light between the two numbers of the card (bottom for opponent and top for my cards), and move this card from under the 6 Ice to the top of the 5 Ice.

On the opponent view everything is Ok but on My view my card is moving to the opponent board with .
==> tested on Studio and the behaviour is the normal one (tested also with mimified version).

I am currently adding some logs to identify where is the problem but do you have any tips ?

FYI, in the JS for applying damages I am using this :

Code: Select all

applyDamageToCard(cardId, damageDealt, damageTotal, selfCard = false, cardOwnerId) {
var myPlayerId = this.player_id;
if (myPlayerId == cardOwnerId)
            {
                //FIXME : If this is My card, we add the class
                dojo.addClass('card_' + cardId, 'myCardHasDamage');
                verticalPostion = 0;
                bIsYoustring = 'my';
            }
            else
            {
                bIsYoustring = 'opponent';
                verticalPostion = (this.cardHeight - this.tokenHeight);
            }
...
}
and in the move card I am using this :

Code: Select all

if ((movedCardOwner == this.player_id))
            {
                fromLocation = 'myBoard' + moveFromBoard;
                tolocation = 'my' + tolocation;
                bIsYoustring = 'my';
            }
            else
            {
                //we are the active player and the moved car is not ours
                fromLocation = 'opponent' + moveFromBoard;
                tolocation = 'opponent' + tolocation;
                //htmlElement = 'jstpl_elemental_rotate';
                bIsYoustring = 'opponent';
            }
I think the problem comes from this part of the code because "bIsYoustring" is used to "SlideTo" object and to place vertically the damage tokens.
Sounds pretty weird. The only thing I spot is that you have an optional argument that is not the last one, so maybe that's causing the issue.
User avatar
Badguizmo
Posts: 76
Joined: 11 October 2020, 14:27

Re: Difference Studio and Private Alpha

Post by Badguizmo »

Tisaac wrote: 26 June 2021, 00:19 Sounds pretty weird.
Don't tell me ..... :?
Tisaac wrote: 26 June 2021, 00:19 The only thing I spot is that you have an optional argument that is not the last one, so maybe that's causing the issue.
I will check on that.

Bonus : is there a way to check an actual game database for an alpha table ? Maybe asking to admins ?
Official BGA developper newb :oops:
User avatar
Badguizmo
Posts: 76
Joined: 11 October 2020, 14:27

Re: Difference Studio and Private Alpha

Post by Badguizmo »

hum, ...
it seems my problem is related to php in some way (first step).

I managed to add some error logs and target the code that is not working.

This part of code is, in PHP :

Code: Select all

$playerName = $this->loadPlayersBasicInfos()[$movedCardOwner]['player_name'];
located just before the notification call.

When logging, it appears that "$playerName " is empty in Production and not in Studio :shock: :shock: :shock:

I will dig on that first.

EDIT: forgot to mention, I have an error during the notification in Prod :

Code: Select all

Invalid or missing substitution argument for log message: ${player_name} have his card ${cardValue} of "${guildName}" moved from Rift ${fromRift} to Rift ${riftIndex}
EDIT2 : ah, maybe because it is used with "self::loadPlayersBasicInfos()" :( :? :roll:
EDIT3 : nope, no difference while using self:: and $this->. Keep on looking ;)
Official BGA developper newb :oops:
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: Difference Studio and Private Alpha

Post by Victoria_La »

Alpha server may be running different php version, did you check your php logs (load logs from production via control panel)?
User avatar
Badguizmo
Posts: 76
Joined: 11 October 2020, 14:27

Re: Difference Studio and Private Alpha

Post by Badguizmo »

All the errors since 13h today :

Code: Select all

26/06 13:22:30 [error] [T182912346] [31.37.117.142] [-588653880/Visitor-588] Unexpected exception: Game not found
#0 /var/tournoi/release/tournoi-210621-0932-gs/www/view/common/game.view.php(251): APP_DbObject->masterNodeRequest()
#1 /var/tournoi/release/tournoi-210621-0932-gs/www/view/common/ebg.view.php(23): game_view->generate_content()
#2 /var/tournoi/release/tournoi-210621-0932-gs/www/include/webActionCore.inc.php(286): ebg_view->generate()
#3 /var/tournoi/release/tournoi-210621-0932-gs/www/index.php(259): launchWebAction()
#4 {main}
http://fr.boardgamearena.com/2/riftforce?table=182912346
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)['location'], self::loadPlayersBasicInfos()[movedCardOwner]['player_name']
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 55
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 8882996
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 8882996Board4
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo]
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo]
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 5
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] Shadow
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 3
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 4
26/06 13:57:27 [error] [T182916909] [31.37.117.142] [88829965/Ichawa] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)['location'], self::loadPlayersBasicInfos()[movedCardOwner]['player_name']
26/06 13:57:27 [error] [T182916909] [31.37.117.142] [88829965/Ichawa] 83
26/06 13:57:27 [error] [T182916909] [31.37.117.142] [88829965/Ichawa] 8882996
26/06 13:57:27 [error] [T182916909] [31.37.117.142] [88829965/Ichawa] 8882996Board5
26/06 13:57:27 [error] [T182916909] [31.37.117.142] [88829965/Ichawa]
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)['location'], self::loadPlayersBasicInfos()[movedCardOwner]['player_name']
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 89
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 8882996
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 8882996Board4
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo]
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo]
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 7
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] Air
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 3
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 4
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)['location'], self::loadPlayersBasicInfos()[movedCardOwner]['player_name']
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 60
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 8882996
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 8882996Board4
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo]
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo]
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 6
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] Shadow
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 3
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 4
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)[location], self::getUniqueValueFromDB(SELECT player_name FROM player WHERE player_id=movedCardOwner)
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 46
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 8882996
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 8882996Board4
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo]
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo]
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 5
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] Ice
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 3
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 4
The php code for the logs :

Code: Select all

self::error( "Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)[location], self::getUniqueValueFromDB(SELECT player_name FROM player WHERE player_id=movedCardOwner) ");
        self::error( $cardMoved );
        self::error( $movedCardOwner );
        self::error( $this->playerscards->getCard($cardMoved)['location'] );
        //self::error( self::loadPlayersBasicInfos()[$movedCardOwner]['player_name'] );
        self::error(self::getUniqueValueFromDB("SELECT player_name FROM player WHERE player_id='$movedCardOwner'"));

        if ($movedByPlantActivation)
        {
            $playerName = self::getUniqueValueFromDB("SELECT player_name FROM player WHERE player_id='$movedCardOwner'");
            //$playerName = $this->loadPlayersBasicInfos()[$movedCardOwner]['player_name'];
            self::error( "Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex" );
            self::error( $playerName );
            self::error( $cardValue );
            self::error( $guildName );
            self::error( $fromRiftIndex );
            self::error( $toRiftIndex );
            //in JS : this.moveElemental(notif.args.card_Id, notif.args.location, notif.args.nbCardsAlreadyInRift,notif.args.fromRift, notif.args.movedCardOwner);
            self::notifyAllPlayers("notifMoveElemental", clienttranslate('${player_name} have his card ${cardValue} of "${guildName}" moved from Rift ${fromRift} to Rift ${riftIndex}'), 
            array(
                'player_name' => $playerName,
                'guildName' => $guildName,
                'cardValue' => $cardValue, 
                'card_Id' => $cardMoved, 
                'location' => 'Board'.$toRiftIndex, 
                'riftIndex' => $toRiftIndex,
                'nbCardsAlreadyInRift' => $nbCardsAlreadyInRift,
                'fromRift' => $fromRiftIndex,
                'movedCardOwner' => $movedCardOwner
                )
            );
What I understand from now:
even if "$movedCardOwner" is representing a "good" player number, "getUniqueValueFromDB" nor "loadPlayersBasicInfos" retreive the player name (the empty logs).

I will check the typeof movedCardOwner to see if there could be any problem and keep you posted ;)
Official BGA developper newb :oops:
User avatar
Badguizmo
Posts: 76
Joined: 11 October 2020, 14:27

Re: Difference Studio and Private Alpha

Post by Badguizmo »

FYI here are the logs from the studio while performing the same actions in the game :

Code: Select all

26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)[location], self::getUniqueValueFromDB(SELECT player_name FROM player WHERE player_id=movedCardOwner) 2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 52
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 23376422
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] integer2
26/06 23:48:50 [info] [T283019] [31.37.117.142] [2337643/Badguizmo1] 1.244068145752 SELECT card_id id, card_type type, card_type_arg type_arg, card_location location, card_location_arg location_arg FROM playerscards WHERE card_id='5' 2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 2337642Board42
26/06 23:48:50 [info] [T283019] [31.37.117.142] [2337643/Badguizmo1] 1.2271404266357 SELECT player_name FROM player WHERE player_id='2337642'2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] Badguizmo02
26/06 23:48:50 [info] [T283019] [31.37.117.142] [2337643/Badguizmo1] 1.2319087982178 SELECT player_name FROM player WHERE player_id='2337642'2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] Badguizmo02
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 62
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] Fire2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 32
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 42
Official BGA developper newb :oops:
User avatar
Badguizmo
Posts: 76
Joined: 11 October 2020, 14:27

Re: Difference Studio and Private Alpha

Post by Badguizmo »

Hello again.

it seems that the 2 DB requests I use does not work anymore on alpha (at least for my game ...) :

self::getUniqueValueFromDB and $this->loadPlayersBasicInfos() ...

Really strange oO
Official BGA developper newb :oops:
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Difference Studio and Private Alpha

Post by Een »

Php version is indeed slightly different on the alpha server (7.4 instead of 7.2)
Looking at the line you posted, maybe 7.4 is less permissive than 7.2 and doesn't allow to chain directly the function and the array selection brackets (that's just a hunch and I didn't test it, but this kind one liner is not something that I have seen a lot and I think I remember errors/warnings doing that).
User avatar
Badguizmo
Posts: 76
Joined: 11 October 2020, 14:27

Re: Difference Studio and Private Alpha

Post by Badguizmo »

Thank you.

I will try to add one step.

Still, the

Code: Select all

self::getUniqueValueFromDB("SELECT player_name FROM player WHERE player_id='$movedCardOwner'");
does not return anything in alpha.
Official BGA developper newb :oops:
Post Reply

Return to “Developers”