Magic Data
General Discussion of the Intricacies
Moderator: CCGHQ Admins
Re: Magic Data
by Marek14 » 21 Jul 2010, 10:47
The list is still about as short as full list of land types
Re: Magic Data
by Marek14 » 23 Jul 2010, 21:57
It seems that the Ongoing Schemes have an empty line in the latest version.
Re: Magic Data
by Marek14 » 26 Jul 2010, 14:52
Dovescape has an empty line as well...
...and Selesnya Guildmage and Spectral Procession.
Utopia Sprawl has not only an empty line, but actual missing text.
The land type "Urza's" is written as "Urza’s"
...and Selesnya Guildmage and Spectral Procession.
Utopia Sprawl has not only an empty line, but actual missing text.
The land type "Urza's" is written as "Urza’s"
Re: Magic Data
by Arch » 26 Jul 2010, 19:24
Good finds Marek. There was regexp that was a little to specific which caused rules containing parentheses to be omitted. I also escaped the tick in the typeline for Urza's and made a minor fix to hybrid mana. All in all affecting some 100-150 cards.
ZIP
I also put up the source for the parser at http://github.com/karmag/loa
ZIP
I also put up the source for the parser at http://github.com/karmag/loa
Re: Magic Data
by rocketnia » 02 Aug 2010, 15:19
Thanks a lot for showing the code. I've been casually porting it to Arc just to help myself search the data and build some decks. I'd fork your code on GitHub, but there's no open-source license, so even if I get your permission, I'm not sure what restrictions you might like me to place on my own sharing of the code.
Anyway, Balduvian Shaman, which is sorta unique in that it has two pieces of reminder text in one ability, is being treated in the XML as though the last part of that ability's rules text is part of the reminder text:
Anyway, Balduvian Shaman, which is sorta unique in that it has two pieces of reminder text in one ability, is being treated in the XML as though the last part of that ability's rules text is part of the reminder text:
- Code: Select all
<rule reminder="For example, you may change "counters black spells" to "counters blue spells.") That enchantment gains "Cumulative upkeep {1}." (At the beginning of its controller's upkeep, that player puts an age counter on it, then sacrifices it unless he or she pays its upkeep cost for each age counter on it.">{T}: Change the text of target white enchantment you control that doesn't have cumulative upkeep by replacing all instances of one color word with another.</rule>
Re: Magic Data
by Arch » 02 Aug 2010, 19:10
Always nice to see some more lisp.rocketnia wrote:Thanks a lot for showing the code. I've been casually porting it to Arc just to help myself search the data and build some decks. I'd fork your code on GitHub, but there's no open-source license, so even if I get your permission, I'm not sure what restrictions you might like me to place on my own sharing of the code.
Never liked licenses, especially the ones that use five pages to specify how free the code is. I do understand why you might need them though. I added a license.txt with the WTFPL license since it's the best I know of.
Thanks for reporting. That's a pretty tricky problem to solve given the current structure of the data. Chances are I'm going to leave the first reminder text in the rule and just extract the second one, or just delete it. We'll see...rocketnia wrote:Anyway, Balduvian Shaman, which is sorta unique in that it has two pieces of reminder text in one ability, is being treated in the XML as though the last part of that ability's rules text is part of the reminder text:
There are actually a couple of rules that have reminder text that I've choosen to leave as they were. "in addition to the mana the land produces" specifically as it doesn't really make sense as a stand-alone reminder text. (Just noticed that Transguild Courier and Mistform Ultimus have similar reminders.)
Re: Magic Data
by rocketnia » 09 Aug 2010, 15:03
Well, porting your code to Arc wasn't as simple as I expected, and I've basically lost interest. Clojure has proper namespaces, and I haven't come up with a good way to translate lazy seqs and agents to idiomatic Arc. I'd also have to get my hands on a comparable lazy XML library, and once I have that set up, I think I'd rather just parse your XML files directly. :-p Doing this has at least given me a much better understanding of Clojure, so thanks for that. ^_^
I wonder if you've considered doing searches for all the cards at once rather than all the cards from each set. The URLs I'm thinking of are just the same as what you have, but with name=[m/^/] instead of set=["whatever"]. If two predefined URLs are sufficient, that'll probably simplify the code quite a bit. On the other hand, a 25+ MB HTML page might be cumbersome.
I wonder if you've considered doing searches for all the cards at once rather than all the cards from each set. The URLs I'm thinking of are just the same as what you have, but with name=[m/^/] instead of set=["whatever"]. If two predefined URLs are sufficient, that'll probably simplify the code quite a bit. On the other hand, a 25+ MB HTML page might be cumbersome.
Re: Magic Data
by Arch » 09 Aug 2010, 18:12
Yeah, introducting lazyness into a language that does not intrinsically support it is probably going to be hard - or not pretty. Clojure's lazyness is bootstrapped in java. On the other hand neither lazy nor agents are needed. I don't use them for anything fundamental in the program and you could easily get away with not using such constructs. The problem might rather be that I'm using additional clojure libraries (for lazy-xml and fetching urls amongst others) which would increase the workload quite significantly unless equivilent functionality exists.rocketnia wrote:Well, porting your code to Arc wasn't as simple as I expected, and I've basically lost interest. Clojure has proper namespaces, and I haven't come up with a good way to translate lazy seqs and agents to idiomatic Arc. I'd also have to get my hands on a comparable lazy XML library, and once I have that set up, I think I'd rather just parse your XML files directly. :-p Doing this has at least given me a much better understanding of Clojure, so thanks for that. ^_^
Have not thought about that before. The reason it is the way it is now is because at the time it felt like the most natural way of working with it, set by set. Doing one search would remove a bunch of duplicate work that's being done right now with parsing reoccuring cards multiple times. The filesize shouldn't have much impact, I'll just have to implement it and try it out.rocketnia wrote:I wonder if you've considered doing searches for all the cards at once rather than all the cards from each set. The URLs I'm thinking of are just the same as what you have, but with name=[m/^/] instead of set=["whatever"]. If two predefined URLs are sufficient, that'll probably simplify the code quite a bit. On the other hand, a 25+ MB HTML page might be cumbersome.
Re: Magic Data
by atastypie » 05 Sep 2010, 01:56
Fantastic work here Arch. Giving it away is pretty awesome. Really appreciate it, you're really helping the MTG community with this.
I just wanted to post that it appears unglued and unhinged are not included--at least, not in mtg-data-2010-08-14.zip. I haven't gone back in the past to see if they exist in older releases.
I just wanted to post that it appears unglued and unhinged are not included--at least, not in mtg-data-2010-08-14.zip. I haven't gone back in the past to see if they exist in older releases.
- atastypie
- Posts: 2
- Joined: 05 Sep 2010, 01:53
- Has thanked: 0 time
- Been thanked: 0 time
Re: Magic Data
by Arch » 05 Sep 2010, 11:23
Thanks.
Unglued/hinged are not included because they require extra work to properly fit in with the rest of the data. (Such as BFM, 0.5 mana/pow-tgh creatures, Atinlay Igpay.) It not really that hard to fix, I just have more interesting things to play around with. Also since Marek is the only one I know that use the data and he doesn't seem to mind I've had no real incentive to fix it.
If anyone really wants this just make a post.
Unglued/hinged are not included because they require extra work to properly fit in with the rest of the data. (Such as BFM, 0.5 mana/pow-tgh creatures, Atinlay Igpay.) It not really that hard to fix, I just have more interesting things to play around with. Also since Marek is the only one I know that use the data and he doesn't seem to mind I've had no real incentive to fix it.
If anyone really wants this just make a post.
Return to Magic Rules Engine Programming
Who is online
Users browsing this forum: No registered users and 20 guests