Search Unity

Making cards in Trading Card Game

Discussion in 'Getting Started' started by executor1909, May 27, 2016.

  1. executor1909

    executor1909

    Joined:
    Jan 23, 2016
    Posts:
    17
    So I want to make a Trading Card Game. I've got all the needed rules and graphics, I only have to programme it. I'm wondering if I should make a prefab of every existing card in my game (which is more than 150) or...
    Is it good idea to add .txt files with all necesarry informations about card (number for deckbuilder, name, description text, etc.) and only one prefab of a card? Will it change game size and performance? Or maybe store this information in some other way?

    And second question about deckbuilder. Should I make a deck.txt file which contains all cards used in the deck (I mean their ID)? Maybe there are some better methods to achieve this.
     
    Last edited: May 27, 2016
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I would certainly use a data-driven approach in this case, that is, have text assets (or an embedded DB or a Google Sheets sheet or whatever you prefer) which define your 150+ cards and all their attributes.

    It won't make any difference to the game size and performance, but it will make your maintenance & development much easier. And since that is going to be the biggest cost to the whole project, it is certainly worth optimizing!
     
    Kiwasi, executor1909 and jhocking like this.
  3. jhocking

    jhocking

    Joined:
    Nov 21, 2009
    Posts:
    814
    yeah what he said, about the difficulty of development and maintenance being the real deciding factor here. It'll perform about the same either way, but imagine the nightmare of trying to manage 150 separate card prefabs. What if you ever decide to change what your cards look like? shudder

    Definitely go with one general card prefab that gets updated with data about specific cards (eg. change the picture on it)
     
    Kiwasi likes this.
  4. executor1909

    executor1909

    Joined:
    Jan 23, 2016
    Posts:
    17
  5. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Yep. There are a few assets for that, like this and this. A google search can probably turn up more. I'm afraid I haven't used any of these, so I don't know what's best.