Skip to main content
tags
Link
congusbongus
  • 14.9k
  • 59
  • 91

How to implement the logic of a trading card game's "special effects cards"?

Tweeted twitter.com/#!/StackGameDev/status/195832528962191361
deleted 1 characters in body; edited title
Source Link
House
  • 73.5k
  • 17
  • 188
  • 276

how How to implement the logic of a trading card game's "special effects cards"?

iI am trying to write a kind of a trading card game here, in some way, it is similar to Magic The GatheringMagic The Gathering, or the Yu-Gi-Oh! (http://www.yugioh-card.com/uk/rulebook/Yu-Gi-Oh!) card game.

For those of you who are not familiar with it, basically, in the game, there is a special kind of card (Spell cards/ Trap cards/ etc.), which have special effects that can kind of bend the rulerules of the game. What I totally have no idea is, how to implement the logic of these cards. I have some idea of storing the card's data with some flags that can signal what kind of ability it has, but that would be very limited in what it can do (only some simple stats modification, maybe).

To give you an idea of what kind of effects these cards can have, here is some example of the spell card effects that are present in the Yu-Gi-Oh!Yu-Gi-Oh! card game:

  • Revive a creature that has been destroyed
  • Take control of the opponent's creature
  • Modify stats of the creature based on some conditions (e.g. Number of creature with certain names that have been destroyed)
  • Special summon a certain creatures if the some conditions are fulfilled.
  • Fuse two or more creatures into a stronger creature.
  • Immunity to some of the special cards' effect.

Konami has made several video games of the game, complete with the AI and thousands of cards variety. I don't think it is actually possible to hard-code the entire database, isn'tis it?

Now, of course what I am trying to do is in no where as complex as those games, but I am curious, how do they implement these?

how to implement the logic of a trading card game's "special effects cards"?

i am trying to write a kind of a trading card game here, in some way, it is similar to Magic The Gathering, or the Yu-Gi-Oh! (http://www.yugioh-card.com/uk/rulebook/) card game.

For those of you who are not familiar with it, basically, in the game, there is a special kind of card (Spell cards/ Trap cards/ etc), which have special effects that can kind of bend the rule of the game. What I totally have no idea is, how to implement the logic of these cards. I have some idea of storing the card's data with some flags that can signal what kind of ability it has, but that would be very limited in what it can do (only some simple stats modification, maybe).

To give you an idea of what kind of effects these cards can have, here is some example of the spell card effects that are present in the Yu-Gi-Oh! card game:

  • Revive a creature that has been destroyed
  • Take control of the opponent's creature
  • Modify stats of the creature based on some conditions (e.g. Number of creature with certain names that have been destroyed)
  • Special summon a certain creatures if the some conditions are fulfilled.
  • Fuse two or more creatures into a stronger creature.
  • Immunity to some of the special cards' effect.

Konami has made several video games of the game, complete with the AI and thousands of cards variety. I don't think it is actually possible to hard-code the entire database, isn't?

Now, of course what I am trying to do is in no where as complex as those games, but I am curious, how do they implement these?

How to implement the logic of a trading card game's "special effects cards"?

I am trying to write a kind of a trading card game here, in some way, it is similar to Magic The Gathering, or the Yu-Gi-Oh! card game.

For those of you who are not familiar with it, basically, in the game, there is a special kind of card (Spell cards/ Trap cards/ etc.), which have special effects that can bend the rules of the game. What I totally have no idea is, how to implement the logic of these cards. I have some idea of storing the card's data with some flags that can signal what kind of ability it has, but that would be very limited in what it can do (only some simple stats modification, maybe).

To give you an idea of what kind of effects these cards can have, here is some example of the spell card effects that are present in the Yu-Gi-Oh! card game:

  • Revive a creature that has been destroyed
  • Take control of the opponent's creature
  • Modify stats of the creature based on some conditions (e.g. Number of creature with certain names that have been destroyed)
  • Special summon a certain creatures if the some conditions are fulfilled.
  • Fuse two or more creatures into a stronger creature.
  • Immunity to some of the special cards' effect.

Konami has made several video games of the game, complete with the AI and thousands of cards variety. I don't think it is actually possible to hard-code the entire database, is it?

Now, of course what I am trying to do is in no where as complex as those games, but I am curious, how do they implement these?

Source Link
hndr
  • 273
  • 1
  • 2
  • 5

how to implement the logic of a trading card game's "special effects cards"?

i am trying to write a kind of a trading card game here, in some way, it is similar to Magic The Gathering, or the Yu-Gi-Oh! (http://www.yugioh-card.com/uk/rulebook/) card game.

For those of you who are not familiar with it, basically, in the game, there is a special kind of card (Spell cards/ Trap cards/ etc), which have special effects that can kind of bend the rule of the game. What I totally have no idea is, how to implement the logic of these cards. I have some idea of storing the card's data with some flags that can signal what kind of ability it has, but that would be very limited in what it can do (only some simple stats modification, maybe).

To give you an idea of what kind of effects these cards can have, here is some example of the spell card effects that are present in the Yu-Gi-Oh! card game:

  • Revive a creature that has been destroyed
  • Take control of the opponent's creature
  • Modify stats of the creature based on some conditions (e.g. Number of creature with certain names that have been destroyed)
  • Special summon a certain creatures if the some conditions are fulfilled.
  • Fuse two or more creatures into a stronger creature.
  • Immunity to some of the special cards' effect.

Konami has made several video games of the game, complete with the AI and thousands of cards variety. I don't think it is actually possible to hard-code the entire database, isn't?

Now, of course what I am trying to do is in no where as complex as those games, but I am curious, how do they implement these?