It is currently 26 Apr 2024, 16:04
   
Text Size

Forge version 1.5.12

Post MTG Forge Related Programming Questions Here

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

Re: Forge version 1.5.12

Postby Max mtg » 02 Feb 2014, 09:31

Agetian wrote:By the way, how viable is this for a simple solution to list unsupported cards (in CardPool.java:80)?

Code: Select all
        else {
            System.err.println(String.format("An unsupported card was found when loading Forge decks: %s", cardName));
            cp = PaperCard.createUnsuportedCard(cardName);
        }
(so that at least the player knows which card to look for immediately instead of stumbling across the card randomly in one of his thousands of decks).

- Agetian
Not bad.

Note that game starts now even with invalid cards, but they are pretty useless during the game.

What if 'create unsuported card' method is moved to CardDb? The card database may log all those requests into System.out, an ArrayList field, or forge.log ... whatever. If there's a list to keep track of unsupported card requests, the gui or another system may check it after the loading is done and show any imaginable popup.

As another benefit of having CardDb handle the requests for bad cards - it can check if the card is really unsupported or just mistyped. That is possible because CardDb has all editions, and those hold all cards' names, even the unsupported ones.
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: Forge version 1.5.12

Postby Agetian » 02 Feb 2014, 09:42

Those sound like very good calls, Max! I think well worth it!

- Agetian
Agetian
Programmer
 
Posts: 3472
Joined: 14 Mar 2011, 05:58
Has thanked: 677 times
Been thanked: 561 times

Re: Forge version 1.5.12

Postby Max mtg » 02 Feb 2014, 10:07

Now there are different errors:
Code: Select all
An unsupported card was requested: "Daxos of Meletis" from "Theros" set. We're sorry, but you cannot use this card now.
An unknown card found when loading Forge decks: "Turtle Ninja" Forge does not know of such card's existance. Have you mistype the card name?
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: Forge version 1.5.12

Postby drdev » 02 Feb 2014, 16:31

Would it be possible to also include in the message the name of the deck containing the invalid card? That would make it easier than having to find the card among potentially hundreds of decks.

Otherwise, this solution looks good to me.
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.12

Postby Max mtg » 02 Feb 2014, 17:11

drdev wrote:Would it be possible to also include in the message the name of the deck containing the invalid card? That would make it easier than having to find the card among potentially hundreds of decks.
Not sure. There's a chain of methods from where deck is still known to unsupported card retrievement.
fromDeckToCard.png
from deck to detection of odd card


"having to find the card" is knowing to use "find in files". Though I have doubts that everyone knows how to search for files with a certain string in their folders deck, those people who know will be able to solve their problems that way.

Forge itself could help a bit to find unsupported cards: the unknown cards are added with no type and no cost. While recognized but not yet supported cards are assigned their matching set and rarity, unknown cards are bound to '???' edition with Unknown ('?') rarity. So the client could scan through all the decks and find the ones with cards matching the above criteria.

I've tested the deck editor - it handles such cards correctly, ie. you may change their amount in a deck and save it... unknown cards are saved correctly into deck file.
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: Forge version 1.5.12

Postby Xitax » 02 Feb 2014, 19:32

I sifted through all the decks and found the bad ones. Two decks had invalid avatars for Vanguard, and 4 decks had a bad format. Does the solution above handle a deck like this with bad formatting? Notice it's missing "Name=" and "[metadata]".

Code: Select all
Elf Ball
[general]
constructed
[main]
1 Staff of Domination
14 Forest
3 Elvish Archdruid
4 Elvish Visionary
1 Fyndhorn Elves
4 Heritage Druid
4 Llanowar Elves
4 Nettle Sentinel
3 Priest of Titania
2 Quirion Ranger
1 Regal Force
2 Wirewood Hivemaster
4 Wirewood Symbiote
1 Wirewood Lodge
1 Emrakul, the Aeons Torn
2 Genesis Wave
4 Glimpse of Nature
4 Green Sun's Zenith
1 Concordant Crossroads
[sideboard]
Xitax
 
Posts: 918
Joined: 16 May 2010, 17:19
Has thanked: 183 times
Been thanked: 133 times

Re: Forge version 1.5.12

Postby Agetian » 03 Feb 2014, 07:35

@ Xitax: While we're discussing faulty decks, it might be a good idea to inform gos about these errors, can you please PM him so that he can correct the relevant decks?

- Agetian
Agetian
Programmer
 
Posts: 3472
Joined: 14 Mar 2011, 05:58
Has thanked: 677 times
Been thanked: 561 times

Re: Forge version 1.5.12

Postby Max mtg » 03 Feb 2014, 08:19

Xitax wrote:I sifted through all the decks and found the bad ones. Two decks had invalid avatars for Vanguard, and 4 decks had a bad format. Does the solution above handle a deck like this with bad formatting? Notice it's missing "Name=" and "[metadata]".
Looks like there was some code that used to catch that 'deck has old format' exception. But now when there's noone to catch those exceptions, Forge will just load such decks silently. If someone saves such deck, it will be overwritten with the new format. Otherwise the file will remain as it is.
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: Forge version 1.5.12

Postby drdev » 04 Feb 2014, 02:25

I've made some progress on Image View for CardManagers. The CardManager on the Current Deck pane of each Deck Editor, as well as the CardManager on the FDeckViewer, now support grouping cards. By default cards are grouped into Creatures, Spells, and Lands, though eventually other group options will be available such as Color and Type. Each group is collapsible (by clicking the header) and displays the count within it next to its caption. Here's an idea of what it looks like:

CardGroups.png

Next up is supporting sorting cards into piles within each group based on a property such as CMC. Unlike non-pile view which has cards wrap and never has a horizontal scrollbar, pile view will introduce a horizontal scrollbar if there's not enough horizontal space for every pile in a group. Does anyone think that will be a problem? Would arrow buttons perhaps be preferable for pile view given that?

Also note that I will eventually make card size adjustable, which should alleviate any scrolling concerns somewhat.

Let me know if you have any suggestions or concerns.

Thanks.
-Dan
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.12

Postby Agetian » 04 Feb 2014, 02:29

@ drdev: Great job so far, keep it up! Ummm not sure about scrollbars vs. arrow buttons because I can't imagine how it's going to look in the end... Can you maybe post a mockup sketch or an example screenshot of what it's going to look like?

- Agetian
Agetian
Programmer
 
Posts: 3472
Joined: 14 Mar 2011, 05:58
Has thanked: 677 times
Been thanked: 561 times

Re: Forge version 1.5.12

Postby Agetian » 04 Feb 2014, 02:43

Another post on the Forge board reminded me of something I wanted to bring up eventually... As of right now, Forge is not 100% Linux (and Mac?..) friendly because some of the image files stored on our servers do not correspond in case of symbols to what Forge requests from the disk. First of all, I absolutely love and support the idea that Forge itself (the code) requests all precon quest images in lowercase with underscores (e.g. a_precon_deck.jpg). However, the picture itself may be stored on the server as A_Precon_Deck.jpg, which confuses operating systems that distinguish the case of file names. Can we fix the file names on the server so that they match what Forge expects? This would be a good thing to eventually do for at least one of the releases. Not that I'm particularly worried about it, but knowing that it was a bit of a pain to manually go over it and fix it in my installation, I think it'd be a nice thing for those Linux/Mac users that we have.

- Agetian
Agetian
Programmer
 
Posts: 3472
Joined: 14 Mar 2011, 05:58
Has thanked: 677 times
Been thanked: 561 times

Re: Forge version 1.5.12

Postby drdev » 04 Feb 2014, 03:10

Agetian wrote:@ drdev: Great job so far, keep it up! Ummm not sure about scrollbars vs. arrow buttons because I can't imagine how it's going to look in the end... Can you maybe post a mockup sketch or an example screenshot of what it's going to look like?

- Agetian
I should have something working soon, and I'll post screenshots for each type of scrolling support.

Another question I just thought of. For the default deck grouping, should Planeswalkers be its own group instead of falling under Spells? I know decklists on WOTC articles use a separate section for Planeswalkers, but I wasn't sure if that was really necessary given most decks don't even have Planeswalkers, and they aren't that different than Artifacts and Enchantments which fall under Spells.

Note that the Type grouping option will offer separate groups for all 7 card types, including Planeswalkers, so you'll still be able to have a separate group for Planeswalkers if you want. If people would find it useful, I might also create another grouping option which would have 5 groups: Creatures, Artifacts/Enchantments, Planeswalkers, Instants/Sorceries, Lands.

Note that I created the default Creatures/Spells/Lands grouping structure as I find that the most useful for building Constructed and Limited decks.
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.12

Postby Agetian » 04 Feb 2014, 03:19

@ drdev: My opinion is that since you can always set up a separate group for Planeswalkers, I think it's possible to group them into Spells by default, thus following the standard "Creatures - Spells - Lands" convention that most deck lists (at least the ones I've seen, anyway...) use.

- Agetian
Agetian
Programmer
 
Posts: 3472
Joined: 14 Mar 2011, 05:58
Has thanked: 677 times
Been thanked: 561 times

Re: Forge version 1.5.12

Postby Max mtg » 04 Feb 2014, 04:02

The group title bars look too "heavy" - they distract attention, visually break deck into unrelated pieces.
They have to be lighter, like a thin line in windows explorer

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: Forge version 1.5.12

Postby drdev » 04 Feb 2014, 06:41

Max mtg wrote:The group title bars look too "heavy" - they distract attention, visually break deck into unrelated pieces.
They have to be lighter, like a thin line in windows explorer
The reason they have that thickness is because you can click anywhere on the header to expand/collapse the group. Notice the glyph on the right side of the header.

I considered the idea of having text inline with a border (similar to what you're describing), but ultimately I thought the way I went with looked nicer, particularly since I wanted to support expand/collapse.

That said, I'm open to changing it, particularly if others feel the same as you.
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 89 guests


Who is online

In total there are 89 users online :: 0 registered, 0 hidden and 89 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 89 guests

Login Form