It is currently 16 Apr 2024, 18:59
   
Text Size

"Far Unlocks" patch

Post MTG Forge Related Programming Questions Here

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

"Far Unlocks" patch

Postby Seravy » 30 Jun 2017, 15:29

Adds two quest options.

"Allow Far Unlocks" allows the player to unlock any set, regardless of distance.

"Unlock Distance Multiplier" is a multipler that gets applied for each step the set is further away, starting after the fifth.

For example, if it's at the default of 1.25, that means, the first five sets on the list will have the default cost. The sixth costs 1.25 times more. The seventh costs 1.25^2 more, the next 1.25^3 and so on, the multiplier is capped at 500 to prevent overflow, but if there is demand for higher (default card price data has some crazy numbers, you can actually expect to be able pay the 2 million for the 500x multiplier), it can easily be changed to a different number before adding the patch.

It's important to note that the order in the window counts. This means if you already did some "far" unlocks, your list might put sets you'd expect to be cheap at a high price. Why? Because with 3 distant sets, there are 3 times as many sets at a "near" distance to you, that get put in front of your intended set. So when doing far unlocks, keep that in mind and don't expect the set that was 5th on your list to stay there. It might get pushed down by another 5 or even more slots, as sets close to your new unlock are added to it.
Attachments
FarUnlocks.txt
(8.23 KiB) Downloaded 265 times
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: "Far Unlocks" patch

Postby Agetian » 01 Jul 2017, 05:10

This is a good patch to integrate! I will integrate it as soon as we resolve the following:

Can you please comment on why you are replacing all calls to getFormat with calls to getMainFormat? Basically, what this means is that you're always getting all the sets from the entire history of Magic, even if the quest world specifies otherwise. Have you tested your patch in the Quest Worlds mode (when you're not playing in the Main world, but in one of the other worlds)? What happens if you have Allow Far Unlocks disabled, and are playing one of the Worlds? Will it still provide you with an option to unlock every single set, despite the fact you're playing on a set-limited plane? (this shouldn't happen IMO, see below)

Ideally, in my opinion, your change should not affect anything in the Worlds mode in case the user opts out (Allow Far Unlocks == 0), and it should only list sets from the list defined in the World even if Allow Far Unlocks is enabled (== 1), since Quest Worlds are meant to be limited to the subset of cards available in the sets defined for that particular Quest World. I think in the original game, Unlock Sets is disabled completely for the Worlds, which makes sense since you're meant to travel to other worlds if you want cards from other sets, and each World is meant to be a more or less self-contained format with predefined (and already unlocked) sets. It's probably best to make it stay that way, but your change in QuestUtil apparently makes it possible to unlock sets even in the Worlds mode?... At the very least, it should be a separate toggleable option, disabled by default.

Anyhow, that's my $0.02. More opinions are welcome here.

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

Re: "Far Unlocks" patch

Postby Rooger » 01 Jul 2017, 06:10

What about creating tickets for traveling or something more lore friendly like Spark Points :D . One kind of currency that you could earn as reward and/or buy in the bazaar that allows you to travel to diferent worlds, each world with a diferent price based on the overall value of cards it provides. These tickets could be treated as a key to the city (one time purchase unlocks world), just like a plane ticket (buy one, travel on time) or you could have some kind of discount the more times you travel to a specific world...
This might be a really dumb ideia but i think that limiting access to worlds is a good thing (if its an optional feature that is) because you wont fall so easily to the temptation to just make a resonably working deck, jump into Beta World and make yourself rich by getting all those moxes in the booster pack rewards eheh
Rooger
 
Posts: 88
Joined: 06 Jan 2013, 06:59
Has thanked: 44 times
Been thanked: 35 times

Re: "Far Unlocks" patch

Postby Seravy » 01 Jul 2017, 09:26

Have you tested your patch in the Quest Worlds mode (when you're not playing in the Main world, but in one of the other worlds)?
It's the reason explained in the patch topic about quest worlds (which does this for the entire system). My philosophy is that locked sets should never be awarded to the player, even if they are part of the current world.
I was outright unable to play quest worlds because they kept giving me cards from sets I haven't yet earned.

...wait, those are supposed to be in the "unlock while in worlds" patch posted in the other thread, weird. I'm confused. Maybe I didn't revert after making that one and it got into this too? Is there a way to subtract one patch for another? If yes, try that, subtract the UnlockinWorlds.txt from this.

Default game behavior is the Unlock button being disabled while in worlds btw., that unlock patch is meant to change that. (as unlocks in worlds do make sense if the main world sets are enforced everywhere, but only then)
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times

Re: "Far Unlocks" patch

Postby Agetian » 01 Jul 2017, 10:09

Ah, alright, I'll take a look! I'm assuming then that, this being a distinct submission, it doesn't have to have those changes that make changes to the Worlds mode. :)

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

Re: "Far Unlocks" patch

Postby Agetian » 01 Jul 2017, 11:06

This patch has been accepted upstream :) Will look at the other two submissions a bit later ;) Thanks for your contribution!

Btw, a pro tip: Since formatting is obviously a downside in your code, make sure you use "Format the source" / "Source -> Format" / whatever assisted code formatting tool is available in your IDE, it'll generally do a pretty good job auto-formatting the code for you :)

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

Re: "Far Unlocks" patch

Postby Seravy » 06 Jul 2017, 09:09

Agetian wrote:Btw, a pro tip: Since formatting is obviously a downside in your code, make sure you use "Format the source" / "Source -> Format" / whatever assisted code formatting tool is available in your IDE, it'll generally do a pretty good job auto-formatting the code for you :)

- Agetian
Oh cool, finally found it. I'll try to keep in mind to use that for future patches.
Seravy
 
Posts: 363
Joined: 26 Oct 2016, 21:23
Has thanked: 5 times
Been thanked: 27 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 52 guests


Who is online

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

Login Form