Page 1 of 1

scores and statistics broken on Mutant Crops

Posted: 13 August 2023, 20:43
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.

Re: scores and statistics broken on Mutant Crops

Posted: 13 August 2023, 21:05
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

Re: scores and statistics broken on Mutant Crops

Posted: 13 August 2023, 23:27
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.

Re: scores and statistics broken on Mutant Crops

Posted: 31 August 2023, 16:16
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.

Re: scores and statistics broken on Mutant Crops

Posted: 02 September 2023, 19:50
by Kayvon
Glad you worked out the problem! Thanks for posting it here for others to benefit from.

Re: scores and statistics broken on Mutant Crops

Posted: 07 January 2024, 10:33
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!

Re: scores and statistics broken on Mutant Crops

Posted: 07 January 2024, 13:03
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

Re: scores and statistics broken on Mutant Crops

Posted: 26 June 2024, 22:13
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.