Debugging tie breakers

Game development with Board Game Arena Studio
Post Reply
User avatar
KuWizard
Posts: 337
Joined: 24 May 2018, 14:10

Debugging tie breakers

Post by KuWizard »

Hi everyone!
I had nightmares when I was implementing a tie breaker and then fixing bugs in it :(
The problem is that you cannot replay a game which is finished and my game finishes straightaway after a tie breaker (obviously). I need to create a new game, amend players scores in DB and then play one round for each player for game to be in the state when at least 2 players have a tie to check if bug is fixed. It usually takes up to 2 minutes for 1 iteration which is annoying after 10th iteration of bugfixing. Is there a way to do this faster? Is there a way to return back to the game after it was finished using saved states?
User avatar
Archduke
Posts: 128
Joined: 05 June 2011, 21:58

Re: Debugging tie breakers

Post by Archduke »

You can run PHP functions from chat on studio (https://en.doc.boardgamearena.com/Tools ... BGA_Studio), so I'd suggest making a function which gives the players resources/puts the game into a lategame state. Alternatively, you could run the end game scoring directly, and then just check score_aux after doing that.
User avatar
KuWizard
Posts: 337
Joined: 24 May 2018, 14:10

Re: Debugging tie breakers

Post by KuWizard »

Thanks, Archduke, will try to do a PHP function, I forgot about this ability :)
User avatar
cpasbanal
Posts: 35
Joined: 04 April 2020, 12:14

Re: Debugging tie breakers

Post by cpasbanal »

You can also try to dump and export a database state _just before_ game ends with the PHPMyAdmin then create a new game and import.

You can then debug the very same end game score to challenge and debug your ties.



Another way to debug end game states, is to

Code: Select all

die('end of game')
and

Code: Select all

var_dump($interesting_var)
before to see how are the scores or interesting variables. It can help challenging _without_ ending the game.
User avatar
KuWizard
Posts: 337
Joined: 24 May 2018, 14:10

Re: Debugging tie breakers

Post by KuWizard »

Thanks, cpasbanal, will try to dump the DB state!
Post Reply

Return to “Developers”