[WIP] Improving usefulness of Foil
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
45 posts
• Page 2 of 3 • 1, 2, 3
Re: [WIP] Improving usefulness of Foil
by Agetian » 27 Jun 2013, 15:16
Hehe sorry, got that corrected. Looks like I overshot a bit when killing text from the quotes.Max mtg wrote:That's not my quote!
@ Diogenes: Yeah, makes sense, and no problem!
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Improving usefulness of Foil
by Agetian » 30 Jun 2013, 16:13
Starting with r22352, edition-specific foiling is implemented in code. In particular, if the MTG edition definition file specifies Foil=NotSupported, no cards from this set will be foiled. If the definition file specifies Foil=OldStyle, cards from this edition will be foiled with foil images from the "sprite_old_foils.png" sheet if it is available (if it does not exist, "sprite_foils.png" will be used). If the definition file specifies Foil=NewStyle, cards from this edition will be foiled with foil images from the standard default "sprite_foils.png" sheet.
Starting with r22353, if an edition file does not contain the Foil line, it defaults to modern (NewStyle) foils.
Now, I've tried to compile a list of information about which editions should use which foil style, I'm really unsure about some of them. Can you please check and see if I'm right or if you'd need any changes? Really unsure about 6th edition by the way, historically it fits into the time frame after the foils have already been introduced, but I'm not sure if the set featured foils... (I think so, but you never know).
- Agetian
Starting with r22353, if an edition file does not contain the Foil line, it defaults to modern (NewStyle) foils.
Now, I've tried to compile a list of information about which editions should use which foil style, I'm really unsure about some of them. Can you please check and see if I'm right or if you'd need any changes? Really unsure about 6th edition by the way, historically it fits into the time frame after the foils have already been introduced, but I'm not sure if the set featured foils... (I think so, but you never know).
- Code: Select all
1998-11 Anthologies - N/A
2001-12 Deckmasters - N/A
1995-08 Renaissance - N/A
1996-07 Rivals Quick Start Set - N/A
1996-11 Multiverse Gift Box - N/A
10E 2007-07-14 Tenth Edition - MODERN
1E 1993-08-05 Limited Edition Alpha - N/A
2E 1993-10-01 Limited Edition Beta - N/A
2U 1993-12-01 Unlimited Edition - N/A
3E 1994-04-01 Revised Edition - N/A
4E 1995-04-01 Fourth Edition - N/A
5DN 2004-06-04 Fifth Dawn - MODERN
5E 1997-03-24 Fifth Edition - N/A
6E 1999-04-28 Classic Sixth Edition - OLD STYLE
7E 2001-04-11 Seventh Edition - N/A
8ED 2003-07-28 Eighth Edition - MODERN
9ED 2005-07-29 Ninth Edition - MODERN
AL 1996-06-10 Alliances - N/A
ALA 2008-10-03 Shards of Alara - MODERN
AN 1993-12-01 Arabian Nights - N/A
AP 2001-06-04 Apocalypse - OLD STYLE
AQ 1994-03-01 Antiquities - N/A
ARB 2009-04-30 Alara Reborn - MODERN
ARC 2010-06-18 Archenemy - MODERN
ASTRAL 1997-04 Astral - N/A
AVR 2012-05-04 Avacyn Restored - MODERN
BD 2000-12 Beatdown Box Set - OLD STYLE (?)
BOK 2005-02-04 Betrayers of Kamigawa - MODERN
BR 1999-11-12 Battle Royale Box Set - OLD STYLE (?)
CG 1999-06-07 Urza's Destiny - OLD STYLE
CH 1995-07 Chronicles - N/A
CHK 2004-10-01 Champions of Kamigawa - MODERN
CM1 2012-11-02 Commander's Arsenal - MODERN
CMD 2011-06-17 Magic: The Gathering-Commander - MODERN
CON 2009-02-06 Conflux - MODERN
CSP 2006-07-21 Coldsnap - MODERN
DD2 2008-11-07 Duel Decks: Jace vs. Chandra - MODERN
DDC 2009-04-10 Duel Decks: Divine vs. Demonic - MODERN
DDD 2009-10-30 Duel Decks: Garruk vs. Liliana - MODERN
DDE 2010-03-19 Duel Decks: Phyrexia vs. the Coalition - MODERN
DDF 2010-09-03 Duel Decks: Elspeth vs. Tezzeret - MODERN
DDG 2011-04-01 Duel Decks: Knights vs. Dragons - MODERN
DDH 2011-09-02 Duel Decks: Ajani vs. Nicol Bolas - MODERN
DDI 2012-03-30 Duel Decks: Venser vs. Koth - MODERN
DDJ 2012-09-07 Duel Decks: Izzet vs. Golgari - MODERN
DDK 2013-03-15 Duel Decks: Sorin vs. Tibalt - MODERN
DGM 2013-05-03 Dragon's Maze - MODERN
DIS 2006-05-05 Dissension - MODERN
DK 1994-08-01 The Dark - N/A
DKA 2012-02-03 Dark Ascension - MODERN
DRB 2008-08-29 From the Vault: Dragons - MODERN
DREAM 2001-06 Dreamcast - N/A
DST 2004-02-06 Darksteel - MODERN
EVE 2008-07-25 Eventide - MODERN
EVG 2007-11-16 Duel Decks: Elves vs. Goblins - MODERN
EX 1998-06-15 Exodus - N/A
FE 1994-11-01 Fallen Empires - N/A
FUT 2007-05-04 Future Sight - MODERN
GPT 2006-02-03 Guildpact - MODERN
GTC 2013-02-01 Gatecrash - MODERN
GU 1999-02-15 Urza's Legacy - OLD STYLE
H09 2009-11-20 Premium Deck Series: Slivers - MODERN
HM 1995-10-01 Homelands - N/A
HOP 2009-09-04 Planechase - MODERN
IA 1995-06-01 Ice Age - N/A
IN 2000-10-02 Invasion - OLD STYLE
ISD 2011-09-30 Innistrad - MODERN
JUD 2002-05-27 Judgment - OLD STYLE
LE 1994-06-01 Legends - N/A
LGN 2003-02-03 Legions - OLD STYLE
LRW 2007-10-12 Lorwyn - MODERN
M10 2009-07-17 Magic 2010 - MODERN
M11 2010-07-16 Magic 2011 - MODERN
M12 2011-07-15 Magic 2012 - MODERN
M13 2012-07-13 Magic 2013 - MODERN
MBS 2011-02-04 Mirrodin Besieged - MODERN
ME2 2008-09-22 Masters Edition II - MODERN
ME3 2009-09-07 Masters Edition III - MODERN
ME4 2011-01-10 Masters Edition IV - MODERN
MED 2007-09-10 Masters Edition - MODERN
MI 1996-10-08 Mirage - N/A
MM 1999-10-04 Mercadian Masques - OLD STYLE
MOR 2008-02-01 Morningtide - MODERN
MRD 2003-10-02 Mirrodin - MODERN
NE 2000-02-14 Nemesis - OLD STYLE
NPH 2011-05-13 New Phyrexia - MODERN
OD 2001-10-01 Odyssey - OLD STYLE
ONS 2002-10-07 Onslaught - OLD STYLE
P2 1998-06 Portal Second Age - N/A
P3 1999-07 Starter 1999 - OLD STYLE (???)
P4 2000-07 Starter 2000 - OLD STYLE (???)
PC2 2012-06-01 Planechase 2012 Edition - MODERN
PD2 2010-11-19 Premium Deck Series: Fire and Lightning - MODERN
PD3 2011-11-18 Premium Deck Series: Graveborn - MODERN
PK 1999-05 Portal Three Kingdoms - OLD STYLE
PLC 2007-02-02 Planar Chaos - MODERN
PO 1997-06 Portal - N/A
PPR Promo set for Gatherer - MODERN (???)
PR 2000-06-05 Prophecy - OLD STYLE
PS 2001-02-05 Planeshift - OLD STYLE
RAV 2005-10-07 Ravnica: City of Guilds - MODERN
ROE 2010-04-23 Rise of the Eldrazi - MODERN
RTR 2012-10-05 Return to Ravnica - MODERN
SCG 2003-05-26 Scourge - OLD STYLE
SHM 2008-05-02 Shadowmoor - MODERN
SOK 2005-06-03 Saviors of Kamigawa - MODERN
SOM 2010-10-01 Scars of Mirrodin - MODERN
ST 1998-03-02 Stronghold - N/A
TE 1997-10-14 Tempest - N/A
TOR 2002-02-04 Torment - OLD STYLE
TSB 2006-10-06 Time Spiral "Timeshifted" - MODERN (?)
TSP 2006-10-06 Time Spiral - MODERN
UG 1998-08-17 Unglued - N/A
UNH 2004-11-19 Unhinged - MODERN
UZ 1998-10-12 Urza's Saga - N/A (?)
V09 2009-08-28 From the Vault: Exiled - MODERN
V10 2010-08-27 From the Vault: Relics - MODERN
V11 2011-08-26 From the Vault: Legends - MODERN
V12 2012-08-31 From the Vault: Realms - MODERN
VAN Vanguard - N/A (?)
VI 1997-02-03 Visions - N/A
WL 1997-06-09 Weatherlight - N/A
WWK 2010-02-05 Worldwake - MODERN
ZEN 2009-10-02 Zendikar - MODERN
- Agetian
Last edited by Agetian on 30 Jun 2013, 16:30, edited 2 times in total.
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Improving usefulness of Foil
by Max mtg » 30 Jun 2013, 16:21
TSB - does it use old foiling style? (for being not-modern)
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: [WIP] Improving usefulness of Foil
by Agetian » 30 Jun 2013, 16:25
Umm that's a very interesting question! I've found this page with an example TSB foil, but I'm not sure if it's a real actual photo or if it's just modded to look foil:Max mtg wrote:TSB - does it use old foiling style? (for being not-modern)
http://www.trollandtoad.com/p385103.html
Here's another one on eBay:
http://www.ebay.com/itm/MTG-Magic-TIME- ... 0039143369
Anyhow, if it is real, it looks like the modern style foiling is used on TSB foils... :\
By the way, it looks like 6th edition indeed had foils (and black-bordered at that):
http://static.trollandtoad.com/products ... 123514.jpg
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Improving usefulness of Foil
by friarsol » 30 Jun 2013, 17:46
The link I posted the other day said that explicitly: "All foil cards are black-bordered, even those from core sets, except those from Unhinged which are silver-bordered."Agetian wrote:By the way, it looks like 6th edition indeed had foils (and black-bordered at that):
http://static.trollandtoad.com/products ... 123514.jpg
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: [WIP] Improving usefulness of Foil
by Agetian » 30 Jun 2013, 18:12
@ friarsol: Yep, I remember that, I was just surprised to see 6th edition foils at all for some reason
Not sure why.
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Improving usefulness of Foil
by lsdmaster » 30 Jun 2013, 20:16
Because they're promos (like foil Duress from Urza's Saga). 6th edition boosters don't contain foil cards.Agetian wrote:@ friarsol: Yep, I remember that, I was just surprised to see 6th edition foils at all for some reasonNot sure why.
- Agetian
http://www.magiclibrarities.net/sets-sixth-edition.html
http://www.magiclibrarities.net/5-rarit ... -2000.html
http://www.magiclibrarities.net/72-rari ... -2000.html
Re: [WIP] Improving usefulness of Foil
by Agetian » 01 Jul 2013, 03:42
@ lsdmaster: Thanks for the info! 
Is there any source for complete information about which editions have boosters with foils and which don't?
- Agetian
Is there any source for complete information about which editions have boosters with foils and which don't?
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Improving usefulness of Foil
by Agetian » 01 Jul 2013, 05:14
I'm trying to make the foil cards appear foiled in the card picture panel during the match (and possibly the deck editor), but for some reason I'm encountering a rather strange issue I can't crack on my own yet due to my lack of experience with the graphics subsystem in Java:
if I modify CardPicturePanel.setImage and do something like this:
I also tried to draw directly on the image but since the images are loaded from cache, it's not possible because the foil gets hard-drawn onto the surface of the image until the game is restarted, which is completely undesirable. What *is* possible to do is make a copy of the image from the cache and set the card picture panel to that, but that might waste the CPU cycles making the copy every time a new card is displayed in the card picture panel.
Can someone please advise me what the best approach would be here?
By the way, another potential issue is that even if I get the code above to work, it'll only work during the match, but not in the deck editor. The problem is that the deck editor operates with InventoryItems, while the match operates with Cards, and InventoryItem has no clue about whether its particular card instance (e.g. in the deck) is foil or not. Not sure if displaying a foiled picture would even be necessary in the deck editor (maybe a simple flag indicating it's a foil card would suffice), but do you have any suggestions for this one as well?
Thanks in advance for any help!
- Agetian
if I modify CardPicturePanel.setImage and do something like this:
- Code: Select all
if (image != this.currentImage) {
this.currentImage = image;
this.panel.setImage(image);
/* INSERTED CODE HERE */
if (foilIndex > 0) {
final String fl = String.format("foil%02d", foilIndex);
final int z = Math.round(this.getWidth() * CardPanel.getBorderSize());
CardFaceSymbols.drawOther(this.panel.getGraphics(), fl, z, z, this.panel.getWidth() - (2 * z),
this.panel.getHeight() - (2 * z));
}
/* INSERTED CODE ENDS HERE */
this.panel.repaint();
}
I also tried to draw directly on the image but since the images are loaded from cache, it's not possible because the foil gets hard-drawn onto the surface of the image until the game is restarted, which is completely undesirable. What *is* possible to do is make a copy of the image from the cache and set the card picture panel to that, but that might waste the CPU cycles making the copy every time a new card is displayed in the card picture panel.
Can someone please advise me what the best approach would be here?
By the way, another potential issue is that even if I get the code above to work, it'll only work during the match, but not in the deck editor. The problem is that the deck editor operates with InventoryItems, while the match operates with Cards, and InventoryItem has no clue about whether its particular card instance (e.g. in the deck) is foil or not. Not sure if displaying a foiled picture would even be necessary in the deck editor (maybe a simple flag indicating it's a foil card would suffice), but do you have any suggestions for this one as well?
Thanks in advance for any help!
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Improving usefulness of Foil
by Max mtg » 01 Jul 2013, 06:24
foilInBoosters - should be not just true/false, but some kind of foil rate.
Say, common editions have 1/5 foil ratio, while MMA has 1/1. Editions that have no foils may use just any ratio, it won't be considered in booster generator
Say, common editions have 1/5 foil ratio, while MMA has 1/1. Editions that have no foils may use just any ratio, it won't be considered in booster generator
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: [WIP] Improving usefulness of Foil
by Agetian » 01 Jul 2013, 07:25
I changed it to an int value that represents a chance (out of 100%) of a foil appearing in a booster - so, 1/5 would be 20% etc. Thanks for the advice!Max mtg wrote:foilInBoosters - should be not just true/false, but some kind of foil rate.
Say, common editions have 1/5 foil ratio, while MMA has 1/1. Editions that have no foils may use just any ratio, it won't be considered in booster generator
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Improving usefulness of Foil
by lsdmaster » 01 Jul 2013, 09:48
This site has all the info you need. Just check the expansion (for instance 7th edition says "350 foil black-border cards"):Agetian wrote:@ lsdmaster: Thanks for the info!
Is there any source for complete information about which editions have boosters with foils and which don't?
- Agetian
http://www.magiclibrarities.net/sets.html
Re: [WIP] Improving usefulness of Foil
by Agetian » 01 Jul 2013, 10:08
@ lsdmaster: Thanks for the info!
Ok, starting with r22363, the foil cards will show up as foil in the card picture panel during the match (but not in the deck editor). Still don't quite like the solution I've come up with, but it's the only thing I was able to work out after many hours of experiments - basically, if a card is non-foil, it's drawn the old fashioned way so there's no resource overhead; if it's foil, a temporary copy of the image from the cache is made, which is then foiled and displayed in the card picture panel. I've checked the memory usage and confirmed that there is no resource leak caused by that. If I come up with something better I'll change the implementation.
Still no idea how to work foiled picture in the card panel into the deck editor for now.
- Agetian
Ok, starting with r22363, the foil cards will show up as foil in the card picture panel during the match (but not in the deck editor). Still don't quite like the solution I've come up with, but it's the only thing I was able to work out after many hours of experiments - basically, if a card is non-foil, it's drawn the old fashioned way so there's no resource overhead; if it's foil, a temporary copy of the image from the cache is made, which is then foiled and displayed in the card picture panel. I've checked the memory usage and confirmed that there is no resource leak caused by that. If I come up with something better I'll change the implementation.
Still no idea how to work foiled picture in the card panel into the deck editor for now.
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Improving usefulness of Foil
by Agetian » 01 Jul 2013, 14:17
Here's a test sprite sheet for the old-style foils (based on the original one currently in Forge), I didn't commit it to SVN yet because I'm not sure how it may behave on card pictures coming from different sources (given that it has 'holes' in the places where the card picture and the card text should be). That being said, it works pretty well on my high quality pictures coming from CCGHQ. Please see how it works for you.
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
Re: [WIP] Improving usefulness of Foil
by Agetian » 01 Jul 2013, 14:39
Here's a good question: what do you think would be an easy enough and viable way to differentiate between foil and non-foil cards in the deck editor? I thought maybe indicating foil with a simple marker, like (*) next to the name, would suffice, but I'm not sure if it's possible and worth it to implement it like that.
- Agetian
- Agetian
- Agetian
- Programmer
- Posts: 3490
- Joined: 14 Mar 2011, 05:58
- Has thanked: 684 times
- Been thanked: 572 times
45 posts
• Page 2 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 20 guests