Archived

This topic is now archived and is closed to further replies.

Ganryu

Making A Magic: The Gathering Game = Suicide

Recommended Posts

Ganryu    122
I need some help here. Has anyone ever tried making an M:tG game? I thought it would be easy at first... but well. I''ve stumbled upon a few VERY annoying problems and i believe developing the AI is the worst of them. My first step though is to make the game playable without an AI and my problem NOW is that i don''t even know how to make the game UNDERSTAND what each card will do. Help, please.

Share this post


Link to post
Share on other sites
Machaira    1033
Not knowing how the game is played I can''t offer much advice. Aren''t there different categories of cards though? I''m assuming you have a Card class. Have some members for the category (offense, defense, whatever), the damage an attack can do or how much defense it offers. Things like that. Hopefully someone that plays the game can offer more advice.

Breakaway Games

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
You could use a script for each card and each state the card could be in. The script would hold the attack and defense for a card and any special commands the card can do. I don’t remember the exact way to play MTG but from what I can remember this would work and would provide a lot of flexibility for the cards.

Share this post


Link to post
Share on other sites
black_mage_s    103
a good idea for that kind of game is to store the stats in an ascii text file and have it read from that, and use code in the game to handle the information.

this is what i did with my first rpg ''Bafl Crystal I'' for all of the enemies and character stats

Share this post


Link to post
Share on other sites
Ganryu    122
You mean like making some sort of script interpreter? Do you know somewhere i can find tutorials on incorporating scripting into my game?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
You know that there''s already a licensed version of this game available boxed retail, right? Single player, multiplayer via internet, even an RPGish adaptation of the rules.

You''ll be sued so fast your head will spin if you try to distribute something like this.

Share this post


Link to post
Share on other sites
Stoffel    250
No shame in making your own games for your own enjoyment. I plan on doing the same for myself with Robo Rally (yet another great WotC game).

Magic is inherently very difficult because the rules of the game go something like this:
- There''s a base set of rules
- Every card breaks a rule in a small way.

It''s a programmer''s nightmare. However, I have to say that the retail version of the game, which hit about 2 years after it should have marketting-wise, is very well done. It handles almost every card in the edition correctly, with some noteable exceptions.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
get the latest edition of the rulebook. Read each rule and make a piece of code for it. Then figure out how to connect them together. Since 6th edition the rules are programable it will just take a lot of work, implementing the timing system as a stack was a smart move on their part. Start thinking about functions as objects as much as possible. Also read the rules several times and carefully. For example, how are you supposed to store the color of a card? As one variable? Wrong, you need five bools. Artifact status is another. Summoning sickness? That''s a bool too, and all cards have it only creatures are affected by it. You need to have an exceptional understanding of the rules, but even if you do the project will still be very difficult. I''m thinking I might do it as my project if I go for my masters, but first I''m going to do something much easier, like make zelda or something.

Share this post


Link to post
Share on other sites
Ganryu    122
NOOO! Dammit! I just stumbled upon another problem. This:

Flashfires: Instant
- Destroy all plains

Magical Hack: Instant
- Change one instance of a land type of your choice to another land type of your choice on target card. This effect is permanent.

Now i''ll have to store every landtype written on each card together with the card itself.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
um no you don''t, I don''t even know where to begin on this issue but you definently don''t want to store one card in another.

Share this post


Link to post
Share on other sites
Stoffel    250
Read it again: he said he'd have to store the land type with each card. He is correct.

Furthermore, there are dual lands, so some cards are both types (ahhh, I remember my black/white pestilence/COP:Black deck. Happy days).

Ah, what I meant to say (got interrupted & hit post) is that you'll actually probably have a _list_ of land types with each card. =)

Edited by - Stoffel on October 18, 2001 9:11:12 PM

Share this post


Link to post
Share on other sites
Drizzt DoUrden    100
If you want to learn more about Magic.. and making table top/ card games... you should get the Dungeons and Dragons Player Hanbook and Dungeon Masters Guide.

They will help you understand how to create creatures and worlds... You can get them at www.bn.com... I couldn't find them on Amazon.com, when I looked.

"He who fights with monsters should look to it that he himself does not become a monster... when you gaze long into the abyss, the abyss also gazes into you..."~Friedrich Nietzsche

Edited by - Drizzt DoUrden on October 18, 2001 9:17:09 PM

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I still say scripts are the way to go for this. I would make a good generic base card class.
In my class I might have
Properties
Card ID
Card Type
Card sub type
ect

Methods
Attack
Defend
Tap
ect

Scripts
Attack
Defend
Tap
And all other states the card could be in

A couple questions I would ask my self are.
How am I going to store the cards?
Is it easy to add, remove, and edit cards?

I wish I could remember the game more so I could be more help.

Check out
http://www.flipcode.com/tutorials/tut_scr01.shtml
this Scripting Engine is proable more than what you would need.
I would try to use more of an assembly lang approach though.

Share this post


Link to post
Share on other sites
Peon    276
A long time ago I wanted to make a game based on the SW:CCG. It would suffer from the same problem. Magic is not solitaire... I mean each card is soooo different from the others. Anyway though, I wish you luck. Keep us updated

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
well yeah of course the flashfires card is going to have a bit of attached data that indicates that it works on plains, but that was very obvious right? Since it is a sorcery it generates one effect (unlike a creature or enchantment) so it would have an effect variable. That variable would be a pointer to a function object. The specific object in this case would be a bind_first object or whatever it is called (it is in STL). bind_first has two variables, a function argument and an argument. Then when you call operator() on the bind_first it calls operator(type t) on the function object using the stored argument as t. So in this case the function object would be a destroy_all and the arguement would be an enum or something similar representing plains. destroy_all would of course destroy all plains.

This is really simplified of course, instead of using something for plains directly you''d probably want to use a predicate as the criteria to make it more general. Then it would go through all permanents in play and if the predicate returns true it would apply the effect. So for a very simple card you have quite a bit of infrastructure required. Making the fancier cards work... I suggest you make an easier game first

Share this post


Link to post
Share on other sites
Zaei    122
Robo Rally ROCKS!

Anyway, I would Implement an abstract Card class, and then have different sub-classes (Creature, Land, Artifact, etc). In your abstract class, have the basic stats, probably mana needed to cast, and thats about it. Then, for each card, instantiate it as an object, and cache it somewhere. Then (we will use Flashfires as an example), you can loop through your cache of played card objects, and if it is a plain, kill it. For a game like this, good OOP skills are probably a must, because you are going to need a good standard interface to link all of the cards together. Also, regardless, the AI will still be a nightmare =(.

Z.

Share this post


Link to post
Share on other sites
Drizzt DoUrden    100
Make a class for land, cretures, enchantments, instants... etc ( i haven''t played Magic in a while, so I don''t know if those names are still stanard..)

The land class would have:

color=?

and every time you made a instance of this class, you would assign it a color.

THe creature would have:

color land needed=?
other color land needed=?
name=?
damage=?
image=the bitmap
health=?
description=?

and every time you made a instance of this class, you would assign it name, and any other attributes foundon the card. The bitmap loaded would be the image.... then 12/5 in the bottom would be text. The description would be text.. etc

The enchantment would need:

health increase=?
health decrease=?
damage increase=?
damage decrease=?
description=?
image = the bitmap

and every time you made a instance of this class, you would assign a value to each of these and add or subtract it depending on what it does. If it dcreases... subtract, increases... add.

That would seem like a good way to do it to me.

Maybe start with something alittle smaller, like you said, and then do this.

"He who fights with monsters should look to it that he himself does not become a monster... when you gaze long into the abyss, the abyss also gazes into you..."~Friedrich Nietzsche

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
no that''s all wrong, both of you! Making an instance for every card is correct though. For example as I said before color is NOT a single variable, it is five bools. Actually you''d probably store colors with type, creature type, artifact status, etc.. to make writing predicates easier so you wouldn''t even have any variables dedicated to color. Magic is vastly more complicated than any of you realize. I was a very good Magic player and I have an exceptional understanding of the rules so trust me on this. You might be able to make a game that feels like Magic but you probably won''t even be able to get a subset of the game implemented acccurately. This is with 6th or 7th edition, previous editions quite simply could not have been programmed because they had inherent design flaws which led to contradictions. Most newbies and average players didn''t notice them but at high levels of play it really messed things up.

Share this post


Link to post
Share on other sites