Page 3 of 3

Re: Forge version 1.5.38

PostPosted: 04 May 2015, 18:32
by KrazyTheFox
serrasmurf wrote:Exactly, fat packs and the like are fine, but initial pools currently never have duplicates
I actually added that exact feature alongside the abovementioned changes. Hit the "allow duplicate cards" checkbox when creating your quest (it's on the load/new quest menu, not the pop-up) and you'll potentially get duplicates. It defaults to unchecked so the behavior won't change for people unexpectedly.

When I get home I can elaborate on the way the starting pools are now generated if anyone wants me to. It now does a lot of work to get you what you want and keep things you might not want out.

Edit: This is the current algorithm for picking your starting pool using the balanced distribution:
Filters:
Code: Select all
for (i = [0..99]) {

    if (i < colorBiasPreference) {

        if (i % 8 == 0 && colorless not in preferred colors && includeArtifacts) {
            add an artifact filter
        } else if (i % 5 == 0) {
           
            if (only colorless selected && Phyrexian limit not reached) {
                if (Phyrexian cost cards in the selected sets) {
                    add a Phyrexian mana cost filter
                    continue
                }
            }

            if (multicolored cards in selected sets and colors && multicolor limit not reached) {
                add multicolor-only filter
            } else {
                add card-has-color filter //Still allows multi-colored cards
            }

        } else {
            add mono-color filter
        }

    } else {
        if (i % 6 == 0) {
            add multicolor-only filter
        } else {
            add mono-color filter
        }
    }

}

Card Selection:
Code: Select all
shuffle filters list

allowedMisses = (number of filters + 4) * number of cards needed

while (need more cards && allowedMisses > 0) {
   
    if (filters remaining) {
        pick next filter
        try 10 times to pick a card using that filter from the selected sets/rarities
    }

    if (no card selected) {
        try another filter 10 times
        if (no card selected) {
            continue to next card without generating one
        }
    } else {
        if (card not in starting pool || allow duplicate cards) {
            add card to starting pool
        } else {
            allowedMisses--
        }
    }

}

return starting pool
I'm open to suggestions to change these around if need be. These also do a bit more work than is listed here when determining things; I thought I'd leave that out of the above pseudocode, though.

Re: Forge version 1.5.38

PostPosted: 04 May 2015, 23:49
by drdev
KrazyTheFox wrote:With the recent reports of quest saves getting corrupted on save, I've committed a change that now creates a backup of quest files before saving them. Only one backup will be kept and that will be overwritten the next time the quest is saved. This should keep people from completely losing quests. They're in the same location as the regular quest save except with a ".bak" extension.
So sadly I learned the hard way that this change completely broke Quest Mode for the Android app, as you used the java.nio library that isn't available on Android.

I've gone ahead and committed r29345 to fix this issue by using a new FileUtil.copyFile function I wrote.

Re: Forge version 1.5.38

PostPosted: 05 May 2015, 00:08
by KrazyTheFox
drdev wrote:
KrazyTheFox wrote:With the recent reports of quest saves getting corrupted on save, I've committed a change that now creates a backup of quest files before saving them. Only one backup will be kept and that will be overwritten the next time the quest is saved. This should keep people from completely losing quests. They're in the same location as the regular quest save except with a ".bak" extension.
So sadly I learned the hard way that this change completely broke Quest Mode for the Android app, as you used the java.nio library that isn't available on Android.

I've gone ahead and committed r29345 to fix this issue by using a new FileUtil.copyFile function I wrote.
Ah, whoops. I'd checked this one before I made the change but it appears my source was incorrect. Thanks for the fix.

Re: Forge version 1.5.38

PostPosted: 05 May 2015, 00:37
by drdev
So after releasing a working Android build for quests, I realized that there's a couple problems with the new quest creation functionality.

1. You have to scroll quite a bit to view and configure all the settings.
2. Creating a new quest on the Main World seems to hang the app. There are no errors, and creating a quest on a smaller world like Ravnica works fine, so I'm assuming it's just a performance issue with the new algorithm for generating the starting pool or something.

Krazy, can you look into addressing these issues, particularly the performance one?

Re: Forge version 1.5.38

PostPosted: 05 May 2015, 00:40
by KrazyTheFox
drdev wrote:1. You have to scroll quite a bit to view and configure all the settings.
I'm not really sure how to address this one. More options == more space, but I'll think on it a while and see if I can find a better way to do it.

drdev wrote:Krazy, can you look into addressing these issues, particularly the performance one?
Yep, I'll look into it. I'll see if I can get my android builds working again to give it some proper testing. Interesting that larger pools are hanging; smaller pools have been less performant during my testing.

Re: Forge version 1.5.38

PostPosted: 05 May 2015, 03:06
by friarsol
Can someone familiar with the CardView stuff look at the following issues:

1) Morph/Face down cards leak their color. When a Morph spell is cast (or cards are otherwise flipped face down), the card view isn't updated appropriately and you can see what color the base card is.

2) Animated triggers from the DTK sieges (Palace Siege etc) aren't displayed in the card detail panel. I know how that system used to work, but I can't figure out what's going on with these CardViews and how to properly get these types of triggers to show up.

3) When choosing the Generic Choice of Palace Siege, the CardDetailText Pane stops showing it's oracle text as soon as the Generic Choice popup happens. It used to continue showing it while this choice is being made. This is useful, since otherwise unless you've memorized the spell, it's a crapshoot which half you want.

Re: Forge version 1.5.38

PostPosted: 05 May 2015, 10:00
by serrasmurf
Hi Krazy,
I started some quests in the latest snapshot (29347), thnx for the duplicate option!
2 issues:
- I would expect that the colours i check are the colours i get, but they are the ones excluded
- I would expect the colours to be totally excluded, but instead i still get a couple of them (Not an issue but a bit counterintuitive)
I would also expect that the choice of balanced/random/surprise me is done over the colours I selected, but instead balanced is the only option linked with colour selection. I guess that makes sense too.
Would it make sense to have "multicolour" as a separate selection option?
KR

Re: Forge version 1.5.38

PostPosted: 05 May 2015, 12:03
by KrazyTheFox
serrasmurf wrote:Hi Krazy,
I started some quests in the latest snapshot (29347), thnx for the duplicate option!
2 issues:
- I would expect that the colours i check are the colours i get, but they are the ones excluded
- I would expect the colours to be totally excluded, but instead i still get a couple of them (Not an issue but a bit counterintuitive)
I would also expect that the choice of balanced/random/surprise me is done over the colours I selected, but instead balanced is the only option linked with colour selection. I guess that makes sense too.
Would it make sense to have "multicolour" as a separate selection option?
KR
You'll need to update your color bias option. It's probably still a 1-10 value, where now it's 1-100. The number is the percentage of your pool your selected colors will occupy. I think I've figured out a good way to reset that automatically but won't be able to do that til after work.


I've looked at some of the performance problems on android and it does seem a bit slow. I can't find an android device that's slow enough to cause problems, but I should be able to attempt some optimization.

Re: Forge version 1.5.38

PostPosted: 06 May 2015, 09:21
by elcnesh
friarsol wrote:Can someone familiar with the CardView stuff look at the following issues:

1) Morph/Face down cards leak their color. When a Morph spell is cast (or cards are otherwise flipped face down), the card view isn't updated appropriately and you can see what color the base card is.

2) Animated triggers from the DTK sieges (Palace Siege etc) aren't displayed in the card detail panel. I know how that system used to work, but I can't figure out what's going on with these CardViews and how to properly get these types of triggers to show up.

3) When choosing the Generic Choice of Palace Siege, the CardDetailText Pane stops showing it's oracle text as soon as the Generic Choice popup happens. It used to continue showing it while this choice is being made. This is useful, since otherwise unless you've memorized the spell, it's a crapshoot which half you want.
Added them to my shortlist of things to fix in the GUI :)