Jump to content
  • Advertisement

Archived

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

Dismantler

Trading Card Game

This topic is 5937 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Has anyone ever attempted this? I''m looking to make a magic the gathering online style game, but without all the perks. Anything you do will probably be manual, including changing your life points (pretty pathetic, but oh well). I''m especially puzzled about how to "do" the cards. I have no clue where to start when it comes to storing, displaying, handling, etc. the cards.

Share this post


Link to post
Share on other sites
Advertisement
I would really like to help out with this project but currently I am working on a project of my own. But let me help you out with a tip. When getting ready to start with the cards, use a randomizer, that''s the best way to start out. Everything else should be easy.




C-ya!

-shutoko2-

Share this post


Link to post
Share on other sites
Make a dynamic database to store the cards, probably one file each card.
You can keep the files in a folder or someting (c:\mycardgame\cards)
Your game will scan through all files in that database, and load it to the program.
If in any case you need to add more cards to add more fun, you can simply make a tool that will create the card file and put it on the database folder.
There!

The only problem I have is the card''s effects and specialties, how do you code those things??
Reducing HP of this player to a specific amount, increasing that monster''s hp, etc, etc.
We want to make it as dynamic as possible, where fantasy is the limit (not the code).
What if you want to make a card that requires the player to have a specifc card on the field, with a specific amount of HP, and then allow the player to draw a specific amount of card from the deck?? In addition to that, what if the game designer wants to make another card that has another effect/specialties...that''s another problem.
IF statements simply aren''t gonna make it.



My compiler generates one error message: "does not compile."

Share this post


Link to post
Share on other sites
From what I remember about Magic, you have your mana cards, and then a bunch of other cards that use different types and amounts of mana to place and cast. However, regular cards also have the ability to add to the mana to the pool if their description warrants it. Among the non-mana specific cards you have instancts, sorceries, summons, etc.

So what you want to do is devise some sort of data structure that can hold card information. For starters, most cards require mana to use, so each card should store the mana requirements - how much mountain, water, swamp and forest, as well as any generic mana requirements (some of these can be 0). Creature cards also have an offensive and defensive statistic, so you would want to store that. Cards also have specific colors, so there should be a bitflag that determines if this is a red, blue, green, black, mixture, etc. color card.

Next comes how to actually get these cards to interact. What you will have to do is break down everything into causes and effects. For example, "turning" a forest mana card adds that to the pool. So in a variable that holds the number of forest mana available for that player, you add one. Cause = "turning" of card, Effect = +1 to corresponding pool. Another example is casting a card, which reduces mana from the pool. Cause = Casting card, Effect = -X to all mana spent. However, there might be conditions that don''t allow for this to happen. For instance, sorceries can only be cast during your turn, so if a player tries to cast a sorcery when it isn''t his/her turn, you deny the request. If they try to cast an instant when there isn''t enough mana, you deny the request. In essense, you want to add something to the Cause and Effect case, which is Condition, which acts as a logical gate for triggering Effect.

I really can''t go into everything, this is something you just have to sit down and design from scratch. Just keep in mind everything that''s going to happen during a Magic game and how you wish to model that.

Share this post


Link to post
Share on other sites
quote:
Original post by Jim Adams
To be really dynamic, you''d probably want to create a script language that can modify every aspect of your game. That way, each card can do whatever it needs to do with all the data, and you''re leaving it open for as many cards/rules as you want.


A scripting language, eh? Yeah, it''s a good idea. You can store the script along the file and when your program load the file (card), you load the script also, and execute it.

something like:
INCREASE HP OPPONENTS ALL 20
// increase all opponents HP by 20
INCREASE HP OPPONENTS PICK 30
// increase selected opponent''s HP by 30

but again, it depends on the program(game) itself whether to recognize the commands on the script. What about if we have a script like this:
DRAW CARD 5
but the game doesn''t recognize what DRAW is?
You can make this sort of like a plug-in, where the card itself does the job, not the game. Usually the game reads the card info, and does the job according to the info. But if you can make the card does the job by itself (after the game passes necessary pointers to the card), that''s probably the solution.


My compiler generates one error message: "does not compile."

Share this post


Link to post
Share on other sites
I never thought I''d get replies this quick! Well thanks all, but I forgot to tell you that I have a working VB version of the game that uses an Access database backbone (guess that''s no longer an option). And the rules are, well, no rules! You play as you would in Apprentice (its completely manual and based on the honor system to not cheat). I''m currently working on a way to store the cards as images. I don''t think its possible to load them and put text on top of them. My only difficulty is writing a class that will load 1 card from an image and storing cards. I''ve noticed some programs have something like cards.dat and if I open it in notepad, its a bunch of mumbojumbo. How do they do that? Well, that was a lot of questions, I hope I didn''t over-confuse you.


To Jim Adams: I am honored that you answered my post. I love your book! In fact I have it in front of me right now and I''m using your Core files with a few modifications for this game! Just wanted to thank you for a great book and give you some credit.

Share this post


Link to post
Share on other sites
I never thought I''d get replies this quick! Well thanks all, but I forgot to tell you that I have a working VB version of the game that uses an Access database backbone (guess that''s no longer an option). And the rules are, well, no rules! You play as you would in Apprentice (its completely manual and based on the honor system to not cheat). I''m currently working on a way to store the cards as images. I don''t think its possible to load them and put text on top of them. My only difficulty is writing a class that will load 1 card from an image and storing cards. I''ve noticed some programs have something like cards.dat and if I open it in notepad, its a bunch of mumbojumbo. How do they do that? Well, that was a lot of questions, I hope I didn''t over-confuse you.


To Jim Adams: I am honored that you answered my post. I love your book! In fact I have it in front of me right now and I''m using your Core files with a few modifications for this game! Just wanted to thank you for a great book and give you some credit.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!