It is currently 07 Sep 2025, 12:29
   
Text Size

[WIP] Improving usefulness of Foil

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: [WIP] Improving usefulness of Foil

Postby Max mtg » 01 Jul 2013, 15:56

same as in mtgo - a star with trail sign at the right of card name.
it's about writing a custom cell renderer.
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

Postby Agetian » 01 Jul 2013, 16:11

Max mtg wrote:same as in mtgo - a star with trail sign at the right of card name.
it's about writing a custom cell renderer.
Umm do you have an example screenshot of how it looks like? (I'm not particularly sure since I haven't played MTGO much to be honest)

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Improving usefulness of Foil

Postby Max mtg » 01 Jul 2013, 16:51

Here's a sample
Attachments
mtgo-old-de.png
deck editor
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

Postby Agetian » 02 Jul 2013, 13:51

@ Max: Gotcha, thanks! I'll see if I can figure out how to do something like that! :)

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Improving usefulness of Foil

Postby Max mtg » 02 Jul 2013, 23:30

Card picture (match ui) has wrong vertical alignment for card image.
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

Postby Agetian » 03 Jul 2013, 05:34

@ Max: hmm I'm not sure what's up with the card picture - on my system it shows OK, but it may be dependent on the card images themselves or some other factor (like screen resolution maybe?) :( I've tried a lot of things to make it work correctly but apparently it's too dependent on factors beyond intuitive control to make it work consistently across systems :\ Can you show me a screenshot of what kind of offset error you're getting? As of the latest svn build, the foil is applied from top left (0, 0) to the bottom right of the card picture with no other offsets accounted for, so I'm currently at a loss as to how to fix it... Unless I or someone else can figure out what's happening I guess I'll have to disable foiling the card picture panel in the match UI :(

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Improving usefulness of Foil

Postby Max mtg » 03 Jul 2013, 07:26

forge-pic-misaligned.png
Misalign 1 - uneven margins
forge-pic-misaligned2.png
Misalign 2 - lower part of card is cut
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

Postby Agetian » 03 Jul 2013, 08:06

@ Max: Hmm that's very weird, I've just tried it on my PC and it seems fine... what is it even controlled with? I'm pretty sure I did not touch anything that could have changed that, at least not intentionally, and especially since it doesn't concern foiling, non-foil cards are generally drawn the way they were before (and that is basically via a call to setImage which does the magic just the way it did before) :\ Do you have an idea what could be up? I mean, I could have broken something unintentionally but I'm clueless as to what it might be if I did :(

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Improving usefulness of Foil

Postby Max mtg » 03 Jul 2013, 10:56

to reproduce try changing aspect ratio of the card panel, that's what changes how much the card get cut
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

Postby Agetian » 03 Jul 2013, 11:43

@ Max: OK, I'll see if I can figure this one out!
EDIT: Weirdly enough, still unable to reproduce it, no matter how much I mutilate my card picture panel - I tried making it wider, narrower, taller, smaller, both wider/taller and narrower/smaller at the same time, wider/smaller and taller/narrower at the same time and in different proportions, and yet that card is scaled correctly and stays in the center both horizontally and vertically for me all the time... :\

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Improving usefulness of Foil

Postby Agetian » 03 Jul 2013, 18:19

Guys, I wanted to let you know that I'll be away on a two week vacation starting this weekend - I will try to follow the forum, maybe even play a bit of Forge on my netbook when I have some time (and report some bugs), but I don't think I'll be able to contribute much (if any) code during this 2-week period. As of right now, the foiling is mostly implemented but not hooked to anything - tomorrow I'll try to contribute another commit to be able to define what slot on the print sheet the foil should replace (according to the MTG wiki linked above, in certain editions foils replace whatever rarity they are, in other editions they always replace the common slot).

Anyhow, the remaining must-do parts of this project are:
1) Getting the foil to show everywhere (this includes the custom cell renderer for JTables to indicate that a card is a foil in e.g. the quest shop, the deck editor, etc.);
2) Adding the ability to produce foils to the booster generator;
3) Making foils appear in the quest shop (with a certain price difference - ideas are welcome how more expensive a foil should be).

If anybody is willing to contribute some code and help me out with this project during my off weeks, your help is highly welcome! I believe the visualization of foils in the deck editor and the proper generation of foil cards in boosters would be the trickiest things for me to implement as I have little experience with the related parts of Forge... Anyhow, I'll try to commit as much as I can before I leave, and I'll get back to coding foils roughly on 18th-20th of July. See you all soon, guys, and good luck with all your current projects!

P.S. I'll at least be in touch from time to time, so I won't disappear completely.

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Improving usefulness of Foil

Postby friarsol » 03 Jul 2013, 18:32

Agetian wrote:(according to the MTG wiki linked above, in certain editions foils replace whatever rarity they are, in other editions they always replace the rare slot).
In later editions they always replace a common slot, not the rare slot. Just wanted to make sure you didn't misread that.
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

Postby Agetian » 03 Jul 2013, 18:48

friarsol wrote:
Agetian wrote:(according to the MTG wiki linked above, in certain editions foils replace whatever rarity they are, in other editions they always replace the rare slot).
In later editions they always replace a common slot, not the rare slot. Just wanted to make sure you didn't misread that.
Yep, corrected that when I reread my message. :) Thanks for the heads-up, Sol!

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Improving usefulness of Foil

Postby Agetian » 31 Jul 2013, 05:53

As of r22715, Forge correctly displays both old-style and new-style foil cards in both the match UI and the deck editor UI. I think I'll now be moving onto booster generation improvements (since those may be drastic, I'll wait until v1.4.4 is released before committing any changes related to that). Currently I have the following idea in mind:

1) In every booster generated, generate a random foil card with the chance specified in the edition definition file. Place it either in the common slot or in whatever slot it belongs to, depending on the edition.
2) As for the price modification, I was thinking that common and uncommon foils can be double the price, while rare foils and mythic rare foils can be triple the price or maybe 2.5x the price, more or less judging by my approximated experience with price rates for foils in real life, but I'm not sure if that may be too little or too much.

Your input is welcome on these points. ;)

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Re: [WIP] Improving usefulness of Foil

Postby Agetian » 02 Aug 2013, 06:05

r22742 adds card value modification based on its foil/non-foil status (currently with hardcoded multipliers, but I may later switch that into a property set in the quest parameters).

I have a question: is anyone in the know about how exactly Forge generates boosters based on print sheets? I'm trying to figure out what the best approach would be to seed a random foil card into a booster but so far I'm unable to devise the best strategy (especially considering that sometimes a foil card has to go into the common slot and sometimes it has to simply be in whatever slot it should be in according to its rarity - the second case is easier because, I guess, we could just randomly foil one of the cards in the booster after it's already placed into its proper slot; the first case requires some micromanagement of print sheets or something like that :\ )

- Agetian
Agetian
Programmer
 
Posts: 3489
Joined: 14 Mar 2011, 05:58
Has thanked: 684 times
Been thanked: 572 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 54 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 54 users online :: 0 registered, 0 hidden and 54 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 54 guests

Login Form