Search Unity

CCG/TCG best practice, sprites vs UI

Discussion in '2D' started by prototyped, Feb 20, 2019.

  1. prototyped

    prototyped

    Joined:
    May 31, 2013
    Posts:
    18
    In making a CCG or TCG whats a better route to take make the cards via UI or sprite? imagies?
     
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    For a basic game, UI images/buttons are probably better because it's easier to set up input. Since you're asking, this is probably the best way for you to start.

    When you develop your next card game, with more experience under your belt, you might switch to sprites or even 3D quads so you can add more visual effects such showing the card flipping over or an imp carrying it from your deck to the play area.
     
  3. prototyped

    prototyped

    Joined:
    May 31, 2013
    Posts:
    18
    Im thinking about doing that as a reiteration of the game rn I got a basic form so redoing it isnt a bid thing, but i want to know as PVE i want the AI to have a card set, whats the best practice to have the cpu to have its own card deck? I was thinking pooling maybe? then play the card on a randomizer.
     
  4. RichardKain

    RichardKain

    Joined:
    Oct 1, 2012
    Posts:
    1,261
    Honestly, performing 3D picking in Unity is not that difficult. Also, if your card positioning is going to be consistent, you can use invisible 2D elements for interactions, and 3D graphics for presentation. The two do not have to be mutually exclusive.

    It really just comes down to the style you want, as opposed to anything technical. Either approach is going to provide a reasonable degree of flexibility.
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    The best way is to treat each player (human or AI) the same, and have a different "control" layer on top that can either be player control or AI control. But underneath the control layer, the deck management code will be exactly the same.
     
  6. prototyped

    prototyped

    Joined:
    May 31, 2013
    Posts:
    18
    I understand it, this is just the biggest hurdle I think I have an idea, just dont want it to be too bulky ya know.
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    The different layers is actually less bulky because you can re-use the rest of the code for human or AI instead of having different code for them.

    But make it bulky at first. Refactor later once you get a version working.