It is currently 19 Apr 2024, 22:41
   
Text Size

Forge version 1.5.38

Post MTG Forge Related Programming Questions Here

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

Re: Forge version 1.5.38

Postby KrazyTheFox » 04 May 2015, 18:32

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.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Forge version 1.5.38

Postby drdev » 04 May 2015, 23:49

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.
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.38

Postby KrazyTheFox » 05 May 2015, 00:08

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.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Forge version 1.5.38

Postby drdev » 05 May 2015, 00:37

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?
drdev
Programmer
 
Posts: 1958
Joined: 27 Jul 2013, 02:07
Has thanked: 189 times
Been thanked: 565 times

Re: Forge version 1.5.38

Postby KrazyTheFox » 05 May 2015, 00:40

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.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Forge version 1.5.38

Postby friarsol » 05 May 2015, 03:06

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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Forge version 1.5.38

Postby serrasmurf » 05 May 2015, 10:00

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
serrasmurf
 
Posts: 316
Joined: 30 Jan 2010, 14:09
Location: The Netherlands
Has thanked: 3 times
Been thanked: 18 times

Re: Forge version 1.5.38

Postby KrazyTheFox » 05 May 2015, 12:03

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.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Forge version 1.5.38

Postby elcnesh » 06 May 2015, 09:21

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 :)
elcnesh
 
Posts: 290
Joined: 16 May 2014, 15:11
Location: Netherlands
Has thanked: 34 times
Been thanked: 92 times

Previous

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 76 guests


Who is online

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

Login Form