#Help creating a complex card game system.

7 messages · Page 1 of 1 (latest)

trim crow
#

I have trouble creating a good card system that is flexible enough so I don't need to create a Card Scene for every single card in my game.

In my project, I use cards for attacks/actions. Some of them are like:

  • Dealing normal damage to monsters
  • Dealing piercing damage to monsters
  • Healing a player certain amount
  • Giving a player some shield
  • Giving a player more energy
  • Giving the player more action points
  • Discarding cards
  • Applying certain element to a monster

The problem arises when cards should be able to do more than one of those actions all at once, and some of them let you target your enemies as well as other players enemies. I've been doing this card system based on a dict, but it has become apparent that this is not gonna work.

Any ideas?? I've been thinking about creating a component system for every individual action a card could make, then add them on every card as needed, but that would mean creating a scene for every card in the game, and that doesn't sound very good.

Please know that I've just started this project, so I'm very interested in hearing what could be a good solution for a good, scalable system before doing anything else

brave acorn
#

Are you familiar with the Resource class? I would use that to create my cards data.
And a different set of Resource for each type of action. The card data could hold an array of actions that you can check during gameplay.

trim crow
#

Ideally, there's gonna be a bunch of characters, each with 5 cards associated, so, before going any further, I wanna be sure I have at least a system flexible enough for future updates and improvements

brave acorn
#

That looks like a good approach to me. Is there anything specific you feel like is not as flexible as you wanted?

trim crow
#

Ideally the game should be playable with 4 players. Every player should have 4 characters, and each card of those characters would go to their deck. My fear is that loading that many resources (80 cards in total on a 4 player game) at once might not be ideal, but I don't really know the impact of loading resources like that since I've never done it before