Page 1 of 3

DOTP2013 Card generator

PostPosted: 02 Jul 2012, 06:17
by pcastellazzi
David Chambers created an awesome tool to access Gatherer with a consistent API. With this tool we probably be able to create a basic card generator which given a card name build most of the XML boilerplate.

I will give it a shot in a week or two. Now my work keep me too busy to have side projects. In the meantime i would like to know what do you think about the idea.

My idea for it right now is to put a web app which given a card name it will give you all the XML we can posibly generate automatically.

At this moment i can think of:

  • Title
  • Flavour text
  • Casting cost
  • Rarity
  • Type
  • Subtype
  • Power
  • Toughness
  • Common static abilities (dethtouch, flying, etc)

General Notes:

  • Everything should be fully translated (Should we google translate missing text?)
  • Common static abilities shoulde include proper help tags
  • Allow batch processing

Re: DOTP2013 Card generator

PostPosted: 02 Jul 2012, 08:29
by thefiremind
The problem is that Gatherer gives translations only for title and flavour text (for recent cards you can find the fully translated picture, but it's not useful for this purpose :wink:). That's why my "Localised" software takes the information from magiccards.info instead of Gatherer.

Re: DOTP2013 Card generator

PostPosted: 02 Jul 2012, 18:12
by Huggybaby
And that tool only returns json. Please don't forget about the very full featured apps right here:
viewforum.php?f=96

Re: DOTP2013 Card generator

PostPosted: 03 Jul 2012, 01:44
by pcastellazzi
thefiremind wrote:The problem is that Gatherer gives translations only for title and flavour text (for recent cards you can find the fully translated picture, but it's not useful for this purpose :wink:). That's why my "Localised" software takes the information from magiccards.info instead of Gatherer.
May be when you looked at it was bugged. Right now it shows the information fully translated when available. The only trick, if you can call it that, is to ask for the printed version of the card, by default it only return the oracle text.

Re: DOTP2013 Card generator

PostPosted: 03 Jul 2012, 01:51
by pcastellazzi
Huggybaby wrote:And that tool only returns json. Please don't forget about the very full featured apps right here:
viewforum.php?f=96
I did not. The tool mencioned here is for programmers, more than for final users. The idea is to have a common API to access gatherer information. I plan to use the tool to create an app for final users (which in this particular case are DOTP2013 modders).

The other apps mentioned in the post you linked are more generic, and designed to for offline card databases and similar tools. The one i am planning to make is to bootstrap DOTP2013 mods easier.

Some of the problems we have when modding for DOTP are inconsistent file names, duplicated multiverse ids, missing translations, a lot of duplicated lua/xml code. I plan to make this app write all the boilerplate for you.

Re: DOTP2013 Card generator

PostPosted: 03 Jul 2012, 08:48
by thefiremind
pcastellazzi wrote:The only trick, if you can call it that, is to ask for the printed version of the card, by default it only return the oracle text.
Haha, I didn't even notice that choice between Oracle and Printed! Thanks for the tip! :D

Progress

PostPosted: 17 Jul 2012, 02:32
by pcastellazzi
I was working with David Chambers the last few days to give tutor the final touches i needed to make it fully functional. A test version is running at: http://poc-tutor.herokuapp.com/, You may find the API documentation at: https://github.com/davidchambers/tutor/

Re: DOTP2013 Card generator

PostPosted: 25 Jul 2012, 12:15
by Persee
http://poc-tutor.herokuapp.com/ return a "Cannot GET /" error with firefox and a 404 with IE

Re: DOTP2013 Card generator

PostPosted: 25 Jul 2012, 12:58
by pcastellazzi
Persee wrote:http://poc-tutor.herokuapp.com/ return a "Cannot GET /" error with firefox and a 404 with IE
That's expected. The app there is a service not a user facing app. If you try something like Birds of paradise you will get a JSON response which is the purpose of the app.

Right now i am working in the user facing app, it will be ready in a few more days for testing.

DOTP2013 Card generator is now online.

PostPosted: 26 Jul 2012, 12:47
by pcastellazzi
You can find the app at http://poc-dotpg.herokuapp.com.

What's done?
  • basic xml skeleton
  • localized title/flavour text/abilities
  • when the translation is not available the oracle text is used
  • a static ability is generated for creatures, a spell ability otherwise

What's missing?
  • Ability skeletons for known keywords (deathtouch, first strike, etc)
  • Caching of requests to tutor
  • Caching of generated xml
  • Any other ideas you guys came up

Re: DOTP2013 Card generator

PostPosted: 26 Jul 2012, 13:19
by RiiakShiNal
Couple of issues I noticed when doing a couple of quick tests on your generator:

  • It generates a FLAVOURTEXT block even when no flavour text is available for a card (should probably be a quick fix). Examples:
  • It does not correctly handle hybrid mana (and probably phyrexian mana) in card abilities (should be relatively easy to fix). Example:
  • It does not separate card abilities into blocks when more than one ability block is present (this will probably be harder to fix). Examples:

Edit: I guess I should mention these tests were done on the user app.

Re: DOTP2013 Card generator

PostPosted: 26 Jul 2012, 14:06
by thefiremind
RiiakShiNal wrote:It generates a FLAVOURTEXT block even when no flavour text is available for a card
I tried with Mold Shambler and I saw that it also adds an additional line in the flavour text which only contains "— ".

Re: DOTP2013 Card generator

PostPosted: 26 Jul 2012, 14:38
by RiiakShiNal
thefiremind wrote:I tried with Mold Shambler and I saw that it also adds an additional line in the flavour text which only contains "— ".
That seems to be because it separates out the Flavour Text and Who the Flavour Text is attributed to (in other words which character said it) then constructs the FLAVOURTEXT block by combining the two and putting in the long dashes and the new line automatically. Unfortunately, it does not work correctly even when an attribution is there if the attribution is slightly different than expected for example the french translation of Plague Beetle (which posed some problems for me as well though I don't separate out the attribution).

Edit: Doing a search for Hill Giant gives me an Internal Server Error (though maybe the code is being worked on at the moment).

Re: DOTP2013 Card generator

PostPosted: 26 Jul 2012, 18:51
by pcastellazzi
Thanks a lot for your feedback. I believe i fixed all the reported bugs. Also i added some support for well know abilities.

At this point it supports:

  • battle cry
  • changeling
  • deathtouch
  • defender
  • exalted
  • fear
  • first strike
  • flash
  • flying
  • haste
  • hexproof
  • lifelink
  • reach
  • trample
  • undying
  • vigilance

Re: DOTP2013 Card generator

PostPosted: 26 Jul 2012, 18:58
by RiiakShiNal
Well some of them seem to be fixed though Hill Giant, Canyon Minotaur, and Merfolk of the Pearl Trident all seem to cause an Internal Server Error.

It could be that it doesn't like cards with no abilities. Edit: Nevermind Alpha Myr works.

Edit: Filename and Cardname for Aether Figment lost the special character and it was not replaced with "AE".
Code: Select all
<FILENAME text="THER_FIGMENT_170993" />
<CARDNAME text="THER_FIGMENT" />
Lifelink shows up as two separate abilities in Caravan Hurda.