scores and statistics broken on Mutant Crops

Game development with Board Game Arena Studio
Post Reply
User avatar
hymnal
Posts: 10
Joined: 31 January 2023, 12:17

scores and statistics broken on Mutant Crops

Post by hymnal »

I'm close to completing development of Mutant Crops:
https://studio.boardgamearena.com/studi ... utantcrops

There are two issues I can't work out, which are possibly related.

1) After a game, the "Game results" tab just says "Recording game results + computing statistics in progress..." forever.

2) Scores don't get displayed (on the player panel next to the star) on setup. I can increment it with scoreCtrl, but refreshing resets it again. I thought that was supposed to be automatic? (I could make a workaround, but it would be better to get it working normally.) In the database, player_score is working correctly, and the correct player wins at the end of the game.

I took over from another developer, so there may be something he has done that I don't understand. Is there anything obvious that I'm doing wrong here?
Thank you.
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: scores and statistics broken on Mutant Crops

Post by Tisaac »

hymnal wrote: 13 August 2023, 20:43 I'm close to completing development of Mutant Crops:
https://studio.boardgamearena.com/studi ... utantcrops

There are two issues I can't work out, which are possibly related.

1) After a game, the "Game results" tab just says "Recording game results + computing statistics in progress..." forever.

2) Scores don't get displayed (on the player panel next to the star) on setup. I can increment it with scoreCtrl, but refreshing resets it again. I thought that was supposed to be automatic? (I could make a workaround, but it would be better to get it working normally.) In the database, player_score is working correctly, and the correct player wins at the end of the game.

I took over from another developer, so there may be something he has done that I don't understand. Is there anything obvious that I'm doing wrong here?
Thank you.
2) you need to make sure player_score is sent to UI in getAllDatas in the players field.
1) weird
Glad to see someone finishing my old past work. I hope it wasnt too big of a mess
User avatar
hymnal
Posts: 10
Joined: 31 January 2023, 12:17

Re: scores and statistics broken on Mutant Crops

Post by hymnal »

That's solved problem (2), thank you!

Not a mess at all, it was very helpful to have your framework to build on.
User avatar
hymnal
Posts: 10
Joined: 31 January 2023, 12:17

Re: scores and statistics broken on Mutant Crops

Post by hymnal »

In case anyone is interested, I've solved the problem with results and statistics not showing. We had an empty function stGameEnd() which was presumably overriding the normal behaviour. Removing it resolves the problem.
User avatar
Kayvon
Posts: 1059
Joined: 17 October 2011, 01:39

Re: scores and statistics broken on Mutant Crops

Post by Kayvon »

Glad you worked out the problem! Thanks for posting it here for others to benefit from.
tomgo
Posts: 1
Joined: 11 February 2022, 17:18

Re: scores and statistics broken on Mutant Crops

Post by tomgo »

Hi,

I'm encountering the same issue now with score gets reset after refresh - after using scoreCtrl correctly.
About your answer - "you need to make sure player_score is sent to UI in getAllDatas in the players field"

can you clarify what exactly needs to be done? i'm sending the score, do I need to do something specific in other files ? .js / view?

Thank you!
User avatar
LeSteffen
Posts: 75
Joined: 13 July 2020, 15:32

Re: scores and statistics broken on Mutant Crops

Post by LeSteffen »

In your getAllDatas() function you should have something like this:

Code: Select all

        $sql = "SELECT player_id id, player_score score, player_no, player_name name, player_color color FROM player";
        $result["players"] = self::getCollectionFromDb($sql);
The column "player_score score" needs to be there. Everything else is automatic
User avatar
FindYodaWinCash
Posts: 15
Joined: 15 June 2020, 00:41

Re: scores and statistics broken on Mutant Crops

Post by FindYodaWinCash »

Just want to say thank you as this solved my problem too. I was getting the player info from getPlayerInfo() or something like that which is a built in routine. Did not have a score property.
Post Reply

Return to “Developers”