Deckbuilder

Game development with Board Game Arena Studio
Post Reply
User avatar
Oermelie
Posts: 4
Joined: 22 July 2022, 07:00

Deckbuilder

Post by Oermelie »

Hi everyone,
Im new to BGA and I want to create a deckbuilder.
How to accomplish that every player have his own deck?

Sorry for this perhaps easy question.

Greetings
Marco
User avatar
RicardoRix
Posts: 2109
Joined: 29 April 2012, 23:43

Re: Deckbuilder

Post by RicardoRix »

Does the player create the deck each and every game? Or is the deck to be maintained over many games?

If the player creates a new deck each game, then you just use the DB, the same any other normal game.
https://en.doc.boardgamearena.com/Game_ ... bmodel.sql

But if it's over many games, then you have some limited options:

game preferences: (probably not very well suited)
https://en.doc.boardgamearena.com/Game_ ... ns.inc.php

legacy data. (limited, and not used much?)
https://en.doc.boardgamearena.com/Main_ ... _games_API

Encoded string (probably best?)
Agricola has a different approach by giving the user a long data string. This string is encoded/decoded.
Later the user can enter the same string. I remember flash games sometimes used this approach and worked for saved game states.
This is also good for sharing decks between players in forums and such.
The downside might be that this information is public information to a degree. So you can't really cover specially attained otherwise locked cards.
User avatar
Fletcheese
Posts: 157
Joined: 21 March 2022, 03:16

Re: Deckbuilder

Post by Fletcheese »

I'd recommend using the "Deck" component utility: https://en.doc.boardgamearena.com/Deck

Default all the card locations to the deck/play area and when a player purchases/picks a card, move the card to that player by setting the location to their unique player ID. If you're new you probably should spend some time reading through the tutorials and this will start making a lot more sense.
User avatar
Oermelie
Posts: 4
Joined: 22 July 2022, 07:00

Re: Deckbuilder

Post by Oermelie »

Thanks for your answers.

The deck is created each game.

So i have to create a deck object per player?

deck_{playerid}

or a db table per player?
User avatar
SwHawk
Posts: 133
Joined: 23 August 2015, 16:45

Re: Deckbuilder

Post by SwHawk »

No the Deck component is able to manage all the cards in your game, you just specify their location.

Since you want each player to have their deck, I'd advise using "deck_$playerId" and associated "discard_$playerId" locations, keeping the location_arg field to indicate order of cards in the deck.

The locations in the Deck component are yours to create and chose, you don't have to stick to the locations given in the documentation.

EDIT: Actually the Deck component can manage any object you want. In the game I'm adapting, I'm using it for cards and tokens, and everything is fine.
Post Reply

Return to “Developers”