TCG style card list brainstorming


Hello, just doing some brainstorming on a TCG style game and figured I’d get some input from the community and start a discussion. So heres my though process so far.

As with most TCG games, Im working on one that is going to have multiple card types. In this case characters, equipment, items, spells, etc. Each with their own data sets that need to go with them. Now, what I am trying to figure out how I want to do is handling propagating these cards to the game. There is two obvious ways I can do this, each with their own pitfalls.
1: Build all the cards manually and save as a prefab.
2: Store all the information from these cards into a database (im thinking XML for now) and then building them at runtime.

Problems I see with both.

Building all the cards and storing as prefabs will obviously take a long time to do, and adding future cards will be more tedious then method 2. Even with this method, im still going to have to use some soft of base class and use polymorphism to build up to the actual card type.

Method two, which im probably going to go with, I deal with the issue of reading through a database, and building the cards based on type.

The next issue im running into in my thought process is dealing with all these different card types in a deck. The complications of this are better seen when you think of it in difference between normal playing cards. With normal playing cards you would simply have a deck with all the same card types, and their data types would be identical between all cards, just different values. So you can have a list of type card, and all the cards would be the same base class. Now, with a TCG game, the cards have many types, and those types have different data values and functions, and lists must be of the same class. So do you create one class that encompasses all the methods of every type of card, build all your cards into that with the data fields mostly empty because they are used for other types, or do you have a base card class, and index that points to the card that you actually want, use that and when the card is needed it builds it from the database? Input would be appreciated. Would love to see how others would do it.

*Also, how do you create tags for topics? If its not found then simply comma delimitation isnt working.


I would also.go with option 2 and using an XML file makes good sense for structure.

I personally would start with a whiteboard and a pen, or Excel I guess :slight_smile:

I would make a list of across the topic of the different card types. Then for each card type list underneath the properties and methods each would need. From that I would look for duplication across the columns. I would imagine there would be a lot of the same properties (“Card.Type” for example), these could be abstracted. Where you have specific methods that are definitely only relevant to that card type I would leave those with the specific card. In fact, I would probably break these out into a card component object, business layer etc.

You could just use base classes or interfaces.


I agree with Rob, definitely go with a database type.

If you go with option one, every time you add a new card, you’re going to have to do a new build, and submit updates to wherever the game is hosted, or the app stores.

Option 2 lets your game get new cards by just requesting the details from the server, maybe saving a pic to local storage, but that can all be done during runtime.

For different cards, again agreeing with Rob, going with generic/abstract DB fields will probably work best.
So you would end up with a database table with columns like (or xml file with tags)
Card Name, Card Type, Card Text, Card Cost, Card Special Abilities, Card Stats.

Using Magic The Gathering for an example, Card Type would be Mana, Creature, Artifact, etc.
Card Cost would be how much of what kind of Mana it takes to put it into play.
Special Abilities would like the “Tap to put 1/1 flying creature token into play” abilities some cards have.
And card stats would be dependant on card type. If its a mana, it tells you its a land, or if its a creature, it has attack and def points, etc.

Look into storing serialized arrays, it will help tremendously with such things.