Skip to Content
 

[Software] Card Editor

5 replies [Last post]
larienna
larienna's picture
Offline
Joined: 07/28/2008

Now I have tought about how could a card editor could work. I am only currently trying to design what it would look like, I am not actively coding. I found a GUI lately that works well and which is convenient to use(code). I also found the "alfont" library which allows to use resizable ttf fonts in Allegro. I simply did not find a free, simple to use PDF maker library so the files will be save on either 300 or 600 DPI Jpg. I tought I could make a post to ask some question and get some comments.

The card editor would basically require these steps

- Template Data : This step is important because it cannot be changed later. It consist in determining what it the items(see below) that will appear on the cards. It cannot be changed later because adding and removing items would mean to change the card database information.

- Template Configuration : Is is simply placing the items, setting options, changing colors, etc.

- Material Loading: It consist in loading textures, background, pictures, icons that will be used by the template.

- Data Entry : This step consist in entring data in the database to create cards. You will abe able to preview the cards.

- Card generation : You select some options, push the red button and it generates the cards.

A card will be made of items or if you prefer components. These components are listed below. Feel free to add some if you have new ideas.

- Bitmap : The bitmap component is used for card background and picture on the card. You will be allowed to determine the size and the placement with zoom, stretch and other possibilities.

- Text String : This is a simple text string used to show the card's name, type of card, illustrator's name, etc. You would be allowed to rotate text and if possible draw it from top to bottom.

- Multiline text : This is used for writting a paragraph of text. This item would be more sophisticated than text string since it must do some word wrap and must adjust the size of the font according to the amount of text to write.

- Icon List : The best example is mana cost in MTG. You have a series of icon where is icon is identified by a letter or number.(ex : in MTG : 2WW ). This component will also allow you to draw your icon in columns or in a 3xN grid like in vampire.

- Shape : This will allow you to draw any basic shape ( circle, rectangle ) anywhere on the card. You would also be able to apply any other effect , like translucency or texture maping, which are available in the Allegro library.

Now there is a few thing that I am not sure if I am going to be able to implements :

- Conditional layout : Change some aspect of the layout according to some information in the card. Ex : In MTG, creatures have an additional rectangle with power/toughness number in it. In this case, you will have to make 2 different card database.

- Icon in text: Since I would be using TTF, I don't think I would be able to put an icon in the middle of a text string and then continue the text. Unless you have a font that actually contains those symbols.

- Standard Variables: One nice thing in the MTG editor are varaibles that can be used in the text like: card name, card id number, etc. I am not sure If I will do this.

For example, a MTG card has the following components :

Text String : Card Name
Text String : Card Type
Text String : Illustrator's name
Text String : Copyright
Text String : Power/Toughness
Multiline Text : Card effect
Multiline Text : Useless additional text
Bitmap : Background
Bitmap : Picture
Icon List : Mana
Icon List : Collection

For a total of 11 components.

Now I intend to make the number of components you can place on a card static ( easier to code ).

Do you think that 16 components on a card is far enough or do you need more components?

Carlos
Offline
Joined: 08/01/2009
Re: [Software] Card Editor

Long time lurker, first-time poster. I'm coming out into the light mostly out of self-interest: boy would a robust card editor like this one help me out!

Larienna wrote:

- Template Data : This step is important because it cannot be changed later. It consist in determining what it the items(see below) that will appear on the cards. It cannot be changed later because adding and removing items would mean to change the card database information.

As a person who uses computer programs (as opposed to those program them), the idea of having to have my template set before I actually begin structuring the card is at best less-than-ideal. I'm positive I will not get every element of the template right on the first go, so if there is any way NOT to have to start from scratch once I decide to make changes, please implement it!

Again, I'm not a programmer, but everything else looks pretty good to me here as a plan. I hope some more computer-literate people chime in to give you better input than I can about it. So far, though, this seems in my humble opinion like a great beginning.

Oh, and I think I would try and implement more than 16 possible components as you have them defined. I can definitely imagine creating a more complex card than MTG uses, and, as you pointed out, they already have 11.

Xyvius
Offline
Joined: 12/31/1969
Re: [Software] Card Editor

Larienna wrote:
It cannot be changed later because adding and removing items would mean to change the card database information.

Although "ideally" this would simplify the software, this isnt really accurate. Of course depending on the structure and language used there will be different limitations. I admit that I am not allegro knowledgable but I have done plenty of DB work for non-profit orgs and I can tell you that it IS quite possible in VB (and similar languages) to set up a DB of DB info so that elements can be added after the fact by the user. I admit though that this is a MAJOR undertaking and requires quite a bit of work. More then is prolly gonna happen for such a "small time" audience.

I guess my point summed up is that it is possible, Its just prolly not worth it.

VeritasGames
VeritasGames's picture
Offline
Joined: 08/01/2008
[Software] Card Editor

There are certainly freeware PDF libraries. Ghostscript is based on such a license, I believe. I think XPDF is also licensed under the GPL.

Apache Cocoon can also dynamically generate PDFs, so that may be worth a look.

VeritasGames
VeritasGames's picture
Offline
Joined: 08/01/2008
Re: [Software] Card Editor

Larienna wrote:
- Conditional layout : In this case, you will have to make 2 different card database.

This is sub-optimal to need entirely separate databases to manage different types of cards. You should be able to have the data stored as separate tables within a single database, at the very least.

Quote:

- Icon in text: Since I would be using TTF, I don't think I would be able to put an icon in the middle of a text string and then continue the text. Unless you have a font that actually contains those symbols.

In general, there should be two ways to implement this. One, allow multiple fonts within one Rich Text Format box, so that the icons can be a
True Type dingbat font. Then, if you can change font and font color midstream, you can easily integrate icons in the text. Alternately, program your text field with image wrap functions so that you can drop in icons as images and have the text wrap around them.

Lots of games have some kinds of icons or fontographic changes in-line with the text, so you need to support at least mixing of font colors, font styles, and font type faces.

Quote:
Do you think that 16 components on a card is far enough or do you need more components?

Why do you need to code in a low number of fixed options? Either allow for a high number of fixed options, or a variable number of options based on the metadata for the card database.

larienna
larienna's picture
Offline
Joined: 07/28/2008
[Software] Card Editor

I will probably be using my own database system that I have created for video games. All the data in an entry are saved as a data stream of bytes in memory or a file. The stream is made according to a data structure and it works pretty well.

Now the problem is that the data structure must now be dynamic because I don't know what item would the user want on his card. The only way to make it static is to predefine the item on the card (ex: all cards have 3 multitex, 5 string, 3 icon list and 3 picture). But it is ugly and it will take too much space for nothing.

So I must create a list of items according to the user and I must read the stream byte per byte since I don't have a struct. Now removing or adding items on the card would mean to alterate all the data in all the data stream which is already variables. So doing so would require some conversion operation between the old and new format.

Now the reason why I tought of determining a fixed list of item is because it is first easier to manage internally since we would would now have : a variables list of item with varaibles content type ( too much variables (^_^) ) and all the forms and windows will have to be generated dynamically because I don't know how much neither the type of control that should appear on the form before run-time.

It get even worst when the gui create a new class for components that can be clicked ( ex: button ) to redefine the onClick method ( sorry for the technicallities ). The problem is that I can't create a class at run-time. It just complexify things.

By the way, I cannot use rich text boxes ( I am not coding with windows DLL here ). From what I know, I can draw some character strings according to a font. I can look to see how much control I have on the position of the text to cut the text, draw an icon, and then continue the text, but I am not sure yet and it might get ugly with the font resizing.

Anyway, It does not mean that everything above is impossible, it just mean that it will take more time. So I would better have a more limited software, done faster that works. Then if I want it, I could make improvements.

Syndicate content


forum | by Dr. Radut