It is currently 16 Apr 2024, 10:55
   
Text Size

DOTP2013 Card generator

Moderator: CCGHQ Admins

DOTP2013 Card generator

Postby pcastellazzi » 02 Jul 2012, 06:17

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
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

Re: DOTP2013 Card generator

Postby thefiremind » 02 Jul 2012, 08:29

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.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: DOTP2013 Card generator

Postby Huggybaby » 02 Jul 2012, 18:12

And that tool only returns json. Please don't forget about the very full featured apps right here:
viewforum.php?f=96
User avatar
Huggybaby
Administrator
 
Posts: 3205
Joined: 15 Jan 2006, 19:44
Location: Finally out of Atlanta
Has thanked: 696 times
Been thanked: 594 times

Re: DOTP2013 Card generator

Postby pcastellazzi » 03 Jul 2012, 01:44

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.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

Re: DOTP2013 Card generator

Postby pcastellazzi » 03 Jul 2012, 01:51

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.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

Re: DOTP2013 Card generator

Postby thefiremind » 03 Jul 2012, 08:48

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
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Progress

Postby pcastellazzi » 17 Jul 2012, 02:32

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/
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

Re: DOTP2013 Card generator

Postby Persee » 25 Jul 2012, 12:15

http://poc-tutor.herokuapp.com/ return a "Cannot GET /" error with firefox and a 404 with IE
User avatar
Persee
 
Posts: 168
Joined: 02 Jun 2011, 08:33
Has thanked: 42 times
Been thanked: 24 times

Re: DOTP2013 Card generator

Postby pcastellazzi » 25 Jul 2012, 12:58

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.
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

DOTP2013 Card generator is now online.

Postby pcastellazzi » 26 Jul 2012, 12:47

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
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

Re: DOTP2013 Card generator

Postby RiiakShiNal » 26 Jul 2012, 13:19

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.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Re: DOTP2013 Card generator

Postby thefiremind » 26 Jul 2012, 14:06

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 "— ".
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
User avatar
thefiremind
Programmer
 
Posts: 3515
Joined: 07 Nov 2011, 10:55
Has thanked: 118 times
Been thanked: 721 times

Re: DOTP2013 Card generator

Postby RiiakShiNal » 26 Jul 2012, 14:38

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).
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Re: DOTP2013 Card generator

Postby pcastellazzi » 26 Jul 2012, 18:51

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
The lights then came up and the crowd erupted in applause, because that's what the crowd does after it watches destruction on a large screen.
— Ben Kuchera, Mordern Warfare 3 review.
User avatar
pcastellazzi
 
Posts: 184
Joined: 25 Apr 2012, 00:40
Location: Montevideo, Uruguay
Has thanked: 11 times
Been thanked: 30 times

Re: DOTP2013 Card generator

Postby RiiakShiNal » 26 Jul 2012, 18:58

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.
Last edited by RiiakShiNal on 26 Jul 2012, 19:08, edited 1 time in total.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 496 times

Next

Return to Utilities

Who is online

Users browsing this forum: No registered users and 14 guests


Who is online

In total there are 14 users online :: 0 registered, 0 hidden and 14 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 14 guests

Login Form