Page 1 of 1

Repeatable database table of cards

Posted: 05 July 2026, 10:45
by RichardSPeters
Ok - first game being developed and pack of cards are stored in the database using the logic not dissimilar to the hearts tutorial. Have found that every time the game is launched the card_id in the database table is randomised – even without using the shuffle function.

In the deployed version this is great as it means each game is different.

However for development and testing would love to be able to have the same data in the database each time I launch the game. Is there a simple way to do this?

Re: Repeatable database table of cards

Posted: 05 July 2026, 12:34
by RicardoRix
you can use the save and restore state buttons at the bottom, don't restart the game.

another way could be to use a debug function to set the db how you want. you can export a query from the mysql and just use that as the restore setup.

Re: Repeatable database table of cards

Posted: 05 July 2026, 12:54
by thoun
And base your debug functions on card type, not id, as they change ;)

Re: Repeatable database table of cards

Posted: 05 July 2026, 23:18
by RichardSPeters
debug function to set the db how you want
That's perfect - thanks and coupling with the state buttons will sort all my problems.