Templates for cards, all of them
by ubeefx
Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins
Templates for cards, all of them
by ember hauler » 06 Oct 2013, 20:05
Hi guys,
As far as I know, Magic has more than 13 500 unique cards (if you count planes, avatars, characters and the rest).
Magarena v.1.42 has 3735. Huge difference.
Adding new cards is a hard work, and I'm really glad there are some cool guys doing scripting and programming and everything.
I was thinking about my contribution, about some way to make this scripting work a bit easier for you.
So I managed to create a template for every card up to M14, which is 13 431 cards in total. These templates could be a starting point for scripting new card, saving some time with boring stuff like types, subtypes, manacost, url, image, PT, etc.
See the attachment.
Let me know if this is helpful.
Regards.
UPDATE:
Attached file was updated so now it's easier to find it in this thread.
As far as I know, Magic has more than 13 500 unique cards (if you count planes, avatars, characters and the rest).
Magarena v.1.42 has 3735. Huge difference.
Adding new cards is a hard work, and I'm really glad there are some cool guys doing scripting and programming and everything.
I was thinking about my contribution, about some way to make this scripting work a bit easier for you.
So I managed to create a template for every card up to M14, which is 13 431 cards in total. These templates could be a starting point for scripting new card, saving some time with boring stuff like types, subtypes, manacost, url, image, PT, etc.
See the attachment.
Let me know if this is helpful.
Regards.
UPDATE:
Attached file was updated so now it's easier to find it in this thread.
- Attachments
-
- card templates 2014-03-11.zip
- (4.18 MiB) Downloaded 357 times
Last edited by ember hauler on 11 Mar 2014, 05:39, edited 4 times in total.
- ember hauler
- Posts: 79
- Joined: 14 Aug 2013, 08:13
- Has thanked: 27 times
- Been thanked: 14 times
Re: Templates for cards, all of them
by Huggybaby » 06 Oct 2013, 23:41
I'm not capable of judging how helpful your contribution is, but I sure like the way you think.
-
Huggybaby - Administrator
- Posts: 3207
- Joined: 15 Jan 2006, 19:44
- Location: Finally out of Atlanta
- Has thanked: 701 times
- Been thanked: 594 times
Re: Templates for cards, all of them
by jerichopumpkin » 07 Oct 2013, 08:14
Holy cow! That is amazing, it will save me an awful lot of time!
- jerichopumpkin
- Posts: 212
- Joined: 12 Sep 2013, 11:21
- Has thanked: 19 times
- Been thanked: 13 times
Re: Templates for cards, all of them
by melvin » 07 Oct 2013, 08:55
Thanks, ember hauler. This is a very useful resource that will reduce the work needed to create a card.
Some suggestions for improvements to better match current conventions:
File names should be card name with non alpha numeric characters changed to _, eg Lu_Su,_Wu_Advisor.txt should be Lu_Su__Wu_Advisor.txt
Currently I'm checking for conformance against Arch's cards.xml for name, type, subtype, cost, pt in that order. It would help if in the template, the cost property appears after subtype property.
Could you share the scripts for generating these templates so that we can include them in the project? This will allow us to generate templates for future sets.
Some suggestions for improvements to better match current conventions:
File names should be card name with non alpha numeric characters changed to _, eg Lu_Su,_Wu_Advisor.txt should be Lu_Su__Wu_Advisor.txt
Currently I'm checking for conformance against Arch's cards.xml for name, type, subtype, cost, pt in that order. It would help if in the template, the cost property appears after subtype property.
Could you share the scripts for generating these templates so that we can include them in the project? This will allow us to generate templates for future sets.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Templates for cards, all of them
by ember hauler » 07 Oct 2013, 10:16
I truly hope so.melvin wrote:Thanks, ember hauler. This is a very useful resource that will reduce the work needed to create a card.
Sure thing! Will do in a couple of days. I've noticed some things to improve as well, so I'll put updated files here.melvin wrote:Some suggestions for improvements to better match current conventions:
File names should be card name with non alpha numeric characters changed to _, eg Lu_Su,_Wu_Advisor.txt should be Lu_Su__Wu_Advisor.txt
Currently I'm checking for conformance against Arch's cards.xml for name, type, subtype, cost, pt in that order. It would help if in the template, the cost property appears after subtype property.
It was just several hours in MS Excel, I'm not sure if it counts as "programming environment"melvin wrote:Could you share the scripts for generating these templates so that we can include them in the project? This will allow us to generate templates for future sets.
- ember hauler
- Posts: 79
- Joined: 14 Aug 2013, 08:13
- Has thanked: 27 times
- Been thanked: 14 times
Re: Templates for cards, all of them
by ember hauler » 07 Oct 2013, 10:19
Good to hearjerichopumpkin wrote::D Holy cow! That is amazing, it will save me an awful lot of time!
There are no Theros cards at the moment, but I'm planning to deal with them as well, as soon as I'll find more recent database.
- ember hauler
- Posts: 79
- Joined: 14 Aug 2013, 08:13
- Has thanked: 27 times
- Been thanked: 14 times
Re: Templates for cards, all of them
by ember hauler » 07 Oct 2013, 10:23
Another thing I keep thinking about is the "value" property of the card.
Is there any way to fetch community rating from Gatherer for every card?
Is there any way to fetch community rating from Gatherer for every card?
- ember hauler
- Posts: 79
- Joined: 14 Aug 2013, 08:13
- Has thanked: 27 times
- Been thanked: 14 times
Re: Templates for cards, all of them
by melvin » 07 Oct 2013, 12:05
that's incredible, never knew Excel could do something like this. I'll see if I can whip up something to detect vanilla creatures that are not yet in the game, then those could be added directly from your templates as they don't need anything else.ember hauler wrote:It was just several hours in MS Excel, I'm not sure if it counts as "programming environment"
Before a release, I'll run a script that update every card in the game. I just grab the Gatherer page for the card and scrap the rating. So the value property is not that important as we can update it automatically, perhaps you can default it to 2.5 first.ember hauler wrote:Another thing I keep thinking about is the "value" property of the card.
Is there any way to fetch community rating from Gatherer for every card?
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Templates for cards, all of them
by ember hauler » 07 Oct 2013, 12:29
Well, now that you mentioned Arch's xml I guess I will redo my templates. My source was Deckbuilder's csv, which is not as accurate as Arch's, I guess. For example we could fetch simple abilities and put them into templates. I think I can do that.melvin wrote:I'll see if I can whip up something to detect vanilla creatures that are not yet in the game, then those could be added directly from your templates as they don't need anything else.
Great, let's do it this way.melvin wrote:Before a release, I'll run a script that update every card in the game. I just grab the Gatherer page for the card and scrap the rating. So the value property is not that important as we can update it automatically, perhaps you can default it to 2.5 first.
- ember hauler
- Posts: 79
- Joined: 14 Aug 2013, 08:13
- Has thanked: 27 times
- Been thanked: 14 times
Re: Templates for cards, all of them
by mike » 07 Oct 2013, 12:41
I have a relatively up to date copy of the gatherer database for Project Firemind. If you need an easy to use API (json/xml) for generating the templates let me know, I'll set one up.
Would it be helpful to anyone if I hosted those templates on firemind.ch linked to the specific cards? So people could search for a card and directly download the template (or even edit and submit it directly in the browser).
Would it be helpful to anyone if I hosted those templates on firemind.ch linked to the specific cards? So people could search for a card and directly download the template (or even edit and submit it directly in the browser).
Re: Templates for cards, all of them
by ember hauler » 11 Oct 2013, 08:00
Well, I did all the work again, completely from scratch. This time I used Arch's XML, the most recent one. I've corrected requested things and did some other small improvements.
The result is in the attachment:
- 13 648 card templates
- Theros included (so I guess now it's really ALL the cards)
- file names follow conventions
- name, type, subtype, cost, pt are in correct order
- value is 2.500 by default
I hope it will help.
UPDATE:
Now you can find the latest templates at the first post in this thread.
The result is in the attachment:
- 13 648 card templates
- Theros included (so I guess now it's really ALL the cards)
- file names follow conventions
- name, type, subtype, cost, pt are in correct order
- value is 2.500 by default
I hope it will help.
UPDATE:
Now you can find the latest templates at the first post in this thread.
Last edited by ember hauler on 13 Oct 2013, 12:56, edited 1 time in total.
- ember hauler
- Posts: 79
- Joined: 14 Aug 2013, 08:13
- Has thanked: 27 times
- Been thanked: 14 times
Re: Templates for cards, all of them
by ember hauler » 11 Oct 2013, 08:06
I think it's a great idea.mike wrote:Would it be helpful to anyone if I hosted those templates on firemind.ch linked to the specific cards? So people could search for a card and directly download the template (or even edit and submit it directly in the browser).
The more ways we have for people to participate and find the information/templates, the more card scripts we will get.
Most of the card submitting traffic, I believe, is now goes thru firemind.ch, so it's quite natural to host templates there as well.
- ember hauler
- Posts: 79
- Joined: 14 Aug 2013, 08:13
- Has thanked: 27 times
- Been thanked: 14 times
Re: Templates for cards, all of them
by melvin » 13 Oct 2013, 03:38
Great to have the Theros cards available now. Btw, how did you get the URLs for the image and text propert of the cards? That was my stumbling block when I tried to so something similar.ember hauler wrote:Well, I did all the work again, completely from scratch. This time I used Arch's XML, the most recent one. I've corrected requested things and did some other small improvements.
I was merging the 35 cards you submitted when I noticed that the order of types and subtypes do not follow from Arch's cards.xml.
For example, Triton Shorethief is printed as Merfolk Rogue but in the template it is given as "subtype=Rogue,Merfolk", similarly Bronze Sable is printed as Artifact Creature but given as "type=Creature,Artifact". All things being equal, it would be better if the order of subtypes follow from cards.xml as well.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
Re: Templates for cards, all of them
by ember hauler » 13 Oct 2013, 13:15
Arch's XML pack has setinfo.xml, from that I took set codes and release dates. In meta.xml there is a set for every card, so I calculated the code for most recently released set for every card. Then I added number of the card inside the release (this info is also from meta.xml). This way I was able to construct URL and Image for 88.5% of all cards. Sometimes these URLs lead to 404 (sorry), but most of the time they are accurate.melvin wrote: Btw, how did you get the URLs for the image and text propert of the cards? That was my stumbling block when I tried to so something similar.
True. Unfortunately, once XML is imported to Excel there is no way of telling the right order - there is no attribute for this, only for supertypes.melvin wrote:I was merging the 35 cards you submitted when I noticed that the order of types and subtypes do not follow from Arch's cards.xml.
But I managed to put all of the types and some of the subtypes in the right order by working with keywords. I hope it's not crucial.
Updated ZIP is now in the first post of the thread.
- ember hauler
- Posts: 79
- Joined: 14 Aug 2013, 08:13
- Has thanked: 27 times
- Been thanked: 14 times
Re: Templates for cards, all of them
by ember hauler » 08 Nov 2013, 12:08
The file in the first post was updated, now with Commander 2013 cards.
13699 card templates in total.
13699 card templates in total.
- ember hauler
- Posts: 79
- Joined: 14 Aug 2013, 08:13
- Has thanked: 27 times
- Been thanked: 14 times
16 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 65 guests