Designing a CCG
I don''t know if this has been discussed before since I can''t search with the search disabled.
CCG is a collectible card game. I have the design all done for a cheap VB version, and I''m thinking of doing one in DirectX, C++.
I don''t know where to start designing the graphical version since the VB was just a bunch of labels and easy stuff. I want it to work off a database of cards.
Does anyone have suggestions or tips on how to design this and make it programmable by a intermediate programmer?
Thanks.
Well, I wrote a program in Qbasic for keeping a database of my MTG cards. It worked pretty well. Granted its not any c++ but the database part would be the same. Just write a simple program (no graphics) and have 3 options in that program. Add card, Remove card, Save and Quit. That simple. Im giving examples base on MTG since I dont know anything about your CCG. In a directory called CCG (or whatever), have all your graphics for the game, a file thats the database of cards, and another file (called something like NumCards). The Numcards and the database are both .txt files. NumCards simply has a number for the number of cards in the database. Anyway back to the program. The Add card option would ask for name of card, description, red mana required, black mana require, etc. (for your game your would have to set up a table most likely for effects of card. IE Mana bonus=?, AttackDamage=?,AddedDefense=?, etc that fits your game design.)All this (in C++) would be stored in a structure
struct Card {
char Name(20) //or you can use strings if you want
char Desc(35) //or whatever
int Type //ie 1 for creature, 2 for spell, etc
MR mana
Eff effects
}
struct MR {
int red,black,green,blue,white,colorless
}
struct Eff {
int Attackdamage
int DirectDamage
.
.
.
.
.
}
Once the final entry is made, have the program read through the database.txt file (in random access mode) for any entries that match the name given to the card being created. If a name matches prompt to overwrite or whatever. If it doesnt store created card in memory.
The removed card will work the same. Prompt for card name, then search database.txt for a matching card name. If match is found, remove that entry from the card list. If not then tell user and go back to menu.
save and quit is easy. All the cards created this run will be added to the end of the database.txt in random access mode. I chose random access becuase you cand simply save Card (the structure we created) in the file as entry 1 or whatever then, when you view entry 1 all that cards information is saved into whatever structure you want.
Hope that helps. Please keep in mind my c++ command knowledge is rusty. But i think i got my point across. Good luck.
Life is just one big game.
struct Card {
char Name(20) //or you can use strings if you want
char Desc(35) //or whatever
int Type //ie 1 for creature, 2 for spell, etc
MR mana
Eff effects
}
struct MR {
int red,black,green,blue,white,colorless
}
struct Eff {
int Attackdamage
int DirectDamage
.
.
.
.
.
}
Once the final entry is made, have the program read through the database.txt file (in random access mode) for any entries that match the name given to the card being created. If a name matches prompt to overwrite or whatever. If it doesnt store created card in memory.
The removed card will work the same. Prompt for card name, then search database.txt for a matching card name. If match is found, remove that entry from the card list. If not then tell user and go back to menu.
save and quit is easy. All the cards created this run will be added to the end of the database.txt in random access mode. I chose random access becuase you cand simply save Card (the structure we created) in the file as entry 1 or whatever then, when you view entry 1 all that cards information is saved into whatever structure you want.
Hope that helps. Please keep in mind my c++ command knowledge is rusty. But i think i got my point across. Good luck.
Life is just one big game.
Thanks for your sharing your idea. I already have the card database in Microsoft Access. I am willing to put it into text form.
How come when I view other games card lists in notepad, it shows a few blank spaces and weird symbols. How can I emulate that to prevent cheating?
To make the load easier on me, I decided for it to be multiplayer, but with no rules (i.e. I''m lazy and I don''t have time) kinda like Apprentice (for you Magic players out there).
Also, I think I want it to be drag/drop and I need to learn more about DirectX to do that. But I''m focusing on getting the design straight right now. Another design issue is what forms the cards will be in. Will it be textures, all the cards is its own image file, etc. I would appreciate any help from someone who has already made a CCG in DirectX.
How come when I view other games card lists in notepad, it shows a few blank spaces and weird symbols. How can I emulate that to prevent cheating?
To make the load easier on me, I decided for it to be multiplayer, but with no rules (i.e. I''m lazy and I don''t have time) kinda like Apprentice (for you Magic players out there).
Also, I think I want it to be drag/drop and I need to learn more about DirectX to do that. But I''m focusing on getting the design straight right now. Another design issue is what forms the cards will be in. Will it be textures, all the cards is its own image file, etc. I would appreciate any help from someone who has already made a CCG in DirectX.
The text files are encrypted;
i belive there are tons of tutorials on this subject...
seach @ google ->
i belive there are tons of tutorials on this subject...
seach @ google ->
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement