It is currently 24 Apr 2024, 14:28
   
Text Size

Forge version 1.5.43 or 1.6.0

Post MTG Forge Related Programming Questions Here

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

Forge version 1.5.43 or 1.6.0

Postby Chris H. » 01 Aug 2015, 21:33

Tentative target release date: August 14 2015.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Forge version 1.5.43 or 1.6.0

Postby drdev » 04 Aug 2015, 01:13

Got inspired last night while playing standard Goblins with Obelisk of Urd to add a usability enhancement to the creature type select dialog. Especially on mobile, I was finding it annoying to have to search for "Goblin" ever time I played that card, as the list is so large to try scrolling to it would take awhile. Hopefully my change should make such effects much more user friendly going forward.

From CHANGES.txt:

- Easier creature type selection -
Now, when prompted to select a creature type for a card like Obelisk of Urd, creature types present in your deck will appear on top, sorted from most to least frequent, followed by all other creature types.
This should make it so, more often than not, you can just accept the dialog without searching.

Here's what this looks like in practice:

CreatureTypeDialog.PNG

Deck List (for reference) | Open
Standard Goblins

Main:
4 Dragon Fodder
4 Foundry Street Denizen
2 Frenzied Goblin
4 Goblin Glory Chaser
1 Goblin Heelcutter
4 Goblin Piledriver
4 Goblin Rabblemaster
1 Hall of Triumph
4 Hordeling Outburst
4 Lightning Strike
16 Mountain
4 Obelisk of Urd
1 Purphoros, God of the Forge
3 Stoke the Flames
4 Wooded Foothills
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.43 or 1.6.0

Postby friarsol » 04 Aug 2015, 01:28

This sounds similar to the requested feature for Cursed Scroll to sort cards in your hand to the top of the list...
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Forge version 1.5.43 or 1.6.0

Postby drdev » 04 Aug 2015, 01:31

friarsol wrote:This sounds similar to the requested feature for Cursed Scroll to sort cards in your hand to the top of the list...
"Name a card" type cards would be slightly less trivial to implement custom sorting for, especially given most deal with your opponent's cards rather than your own and we shouldn't be revealing information about the opponent's deck via a custom sort. We'd probably have to make card specific sorting logic. Is that something we could maybe include in the card script?
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.43 or 1.6.0

Postby friarsol » 04 Aug 2015, 01:55

drdev wrote: We'd probably have to make card specific sorting logic. Is that something we could maybe include in the card script?
Yea I think that's the only way to do it. Sort by alphabetical by default, and if the script defines a specific sorting method use that. Not sure if it's possible to use the "Valid" property scheme to do this, or if we'd need to specifically name sorting algorithms. viz: "ValidHand Card.YouCtrl" vs "CardsInYourHand"
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Forge version 1.5.43 or 1.6.0

Postby drdev » 04 Aug 2015, 02:11

friarsol wrote:
drdev wrote: We'd probably have to make card specific sorting logic. Is that something we could maybe include in the card script?
Yea I think that's the only way to do it. Sort by alphabetical by default, and if the script defines a specific sorting method use that. Not sure if it's possible to use the "Valid" property scheme to do this, or if we'd need to specifically name sorting algorithms. viz: "ValidHand Card.YouCtrl" vs "CardsInYourHand"
We shouldn't use "Valid" because that restricts the list, whereas with Cursed Scroll you're technically allowed to choose a card name that's not in your hand even if there's usually no good reason to do so.

We'd probably need to create a new script identifier for this. Are there other cards of this sort that would benefit from some custom sorting on a prompt it shows?
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.43 or 1.6.0

Postby Phoenix » 04 Aug 2015, 05:45

For cards like Cursed Scroll, that affect only YOUR cards:
Just take alle cards or card names of your deck on top of the list. You should know your own deck.

For cards like Booby Trap, that affact your OPPONENT's cards:
Just take all cards visible on the battlefield, in his graveyard and exiled.
No cards of his hand, his library or face-down cards.

But what about cards being returned to hand or library by e.g. Unsummon.
You know about them being in your opponent's hand.

So maybe there should be a new flag showing if a card is known to player 1-x. Then a sorting algorithm can access the omniscient list of all cards in play and choose all cards known by the specific player.
Phoenix
 
Posts: 77
Joined: 15 Dec 2011, 10:23
Has thanked: 6 times
Been thanked: 3 times

Re: Forge version 1.5.43 or 1.6.0

Postby friarsol » 04 Aug 2015, 12:29

drdev wrote:We shouldn't use "Valid" because that restricts the list, whereas with Cursed Scroll you're technically allowed to choose a card name that's not in your hand even if there's usually no good reason to do so.

We'd probably need to create a new script identifier for this. Are there other cards of this sort that would benefit from some custom sorting on a prompt it shows?
I wasn't saying filter by Valid. I was saying sort by it.

If X is a valid name, sort it higher in the list. If X is not a valid name, leave it in the normal alphabetical spot.

Phoenix wrote:For cards like Cursed Scroll, that affect only YOUR cards:
Just take alle cards or card names of your deck on top of the list. You should know your own deck.
This isn't true. Cursed Scroll doesn't affect only your cards. Cursed Scroll allows you to choose any card name (allowing you to bluff) Typical use case is to choose a card in your hand, but there's certainly times when if you have two cards in your hand (say both random card draw) you can name "Counterspell" and then when a Divination is revealed your opponent thinks he just got lucky, but now also thinks you have a counter readied.

So maybe there should be a new flag showing if a card is known to player 1-x. Then a sorting algorithm can access the omniscient list of all cards in play and choose all cards known by the specific player.
That sounds way too complicated for minimal gain. I'm not sure we really should be aiding the player in memorizing which cards he "might" know about.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Forge version 1.5.43 or 1.6.0

Postby drdev » 04 Aug 2015, 13:59

friarsol wrote:
drdev wrote:We shouldn't use "Valid" because that restricts the list, whereas with Cursed Scroll you're technically allowed to choose a card name that's not in your hand even if there's usually no good reason to do so.

We'd probably need to create a new script identifier for this. Are there other cards of this sort that would benefit from some custom sorting on a prompt it shows?
I wasn't saying filter by Valid. I was saying sort by it.

If X is a valid name, sort it higher in the list. If X is not a valid name, leave it in the normal alphabetical spot.
But doesn't "Valid" normally filter the options? I feel it'd be confusing to make that property sometimes do sort and sometimes do filter. Better to introduce a new script keyword named "Sort" with the same types of inputs as "Valid".
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.43 or 1.6.0

Postby friarsol » 04 Aug 2015, 14:57

drdev wrote:But doesn't "Valid" normally filter the options? I feel it'd be confusing to make that property sometimes do sort and sometimes do filter. Better to introduce a new script keyword named "Sort" with the same types of inputs as "Valid".
I.. think we are mostly agreeing and you aren't understanding me? It doesn't make that much difference, I was mostly saying if we can use Valid to sort all the "Priority" names higher than we should since it will allow us to reuse that code. Of course the actual name of the script key would be it's own thing, it would just hook into the hasProperty portion of the code that already exists and is well defined. Honestly, I don't even know if we can, since hasProperty is for game objects, and we might just have a list of strings.


Now that I'm thinking about it, maybe a partial filter is fine anyway:

Sorting Algo | Open
SortByNameCard(PriorityFilter, fullList) {
List a = generateFilteredInCards(fullList, PriorityFilter)
List b = generateRemainingCards(fullList, a)
a.sort()
b.sort()
return a + b;
}



Similarly, it might be nice to show Library searches in an sorted by alpha list too. Since the first popup screen already takes care of "seeing the library in order" (just in case you are looking at your opponent's deck after they did some library manipulation), but I know each time I'm searching my library for something it'd be much easier to find things if it was sortable. (Not suggesting you should do any or all of these things, it's just reminding me of other things I've thought of/seen)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Forge version 1.5.43 or 1.6.0

Postby Chris H. » 14 Aug 2015, 18:57

Chris H. wrote:Tentative target release date: August 14 2015.
 
Everything worked out OK today. =D>
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 32 guests


Who is online

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

Login Form