Repeatable database table of cards

Game development with Board Game Arena Studio
Post Reply
User avatar
RichardSPeters
Posts: 18
Joined: 27 August 2021, 23:14

Repeatable database table of cards

Post 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?
User avatar
RicardoRix
Posts: 2540
Joined: 29 April 2012, 23:43

Re: Repeatable database table of cards

Post 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.
User avatar
thoun
Posts: 1619
Joined: 10 December 2020, 22:25

Re: Repeatable database table of cards

Post by thoun »

And base your debug functions on card type, not id, as they change ;)
User avatar
RichardSPeters
Posts: 18
Joined: 27 August 2021, 23:14

Re: Repeatable database table of cards

Post 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.
Post Reply

Return to “Developers”