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

Quest Mode Drafting

Post MTG Forge Related Programming Questions Here

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

Quest Mode Drafting

Postby KrazyTheFox » 27 May 2014, 19:33

I've made some good progress on a proof of concept for quest drafting. I can now start a draft, pick cards, and they all get added to your quest collection (as well as the "deck" itself. I'm also fairly sure where I need to change things to get at least randomized drafts working in quest mode. I should have this ready for testing within the week for those of you who use snapshot builds.

My current thinking on the mode is to have something similar to the challenges menu where it lists 3 possible tournaments, where one is changed every 5 wins in regular duel mode.

The available tournaments are generated from the current quest's unlocked sets. Booster configurations within the sets are also randomized (you might get RAV/RAV/DIS or DIS/DIS/DIS).

The price of the tournament is calculated from the cost of the lands + the price of the three booster packs + an entry fee for prizes.

Once you join a tournament, you are immediately brought to the drafting screen and once you've picked your cards, you get to build your deck. The deck remains un-editable for the remainder of the tournament and once it's over, the deck will be added to your regular quest deck section.

The tournament itself is set up as a single elimination bracket with prizes for placing 3rd/4th, 2nd, and 1st. Prizes would be credits and booster packs with the occasional "promotional" card.

Before I get too far along in implementing this, I'd like to know if you guys have any suggestions.

-----


To-Do List:
Code: Select all
[X]  Add button to edit deck during tournament, remove restriction, make sure deck abides by restrictions before playing any games
[X]  Add image for deck building view
[X]  Add method for determining final placement of player
[X]  Add tokens to unlock new drafts at will
[X]  Add tournament rotations (rewrite calculations)
[X]  Allow tournament to continue if interrupted before game is played
[X]  Change "Leave Tournament" to "Collect Prizes and End Tournament"
[X]  Closing game tab can concede for AI. Shouldn't allow this to happen. (CMatchUI at the bottom)
[X]  Confirm action on leaving tournament (And tell player if they have matches left to play)
[X]  Confirm action on submitting deck
[X]  Confirm leaving game on match quit, notify player it will forfeit
[X]  Disable start draft when clicked and succeeds, re-enable once done drafting and draft is removed
[X]  Disable start match button when clicked, re-enable once matches empty
[X]  Ensure that the draft is removed when quitting during the drafting process. No (easy) scumming!
[X]  Ensure tournament gets removed on age 0
[X]  Finish deck modification screen
[X]  Fix ante
[X]  Give the initial tournament view the correct behavior
[X]  Hiding the overlay per normal ends up with broken UI for the next overlay displayed (Cannot replicate)
[X]  Limit small sets per draft to 1 booster
[X]  Prize Calculation and Awarding
[X]  Restructure tournament view
[X]  Rewrite "end tournament" code in CSubmenuQuestDraft
[X]  Switching loaded quest changes which screen is displayed (is working as intended currently?)
[X]  Track tournament placement count in quest achievements. (Wins/Losses by place)
[X]  Update end of match button with better wording
[X]  Add to changes.txt
Last edited by KrazyTheFox on 06 Jun 2014, 07:38, edited 11 times in total.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Quest Mode Drafting

Postby friarsol » 27 May 2014, 19:46

Well I bet a lot of people will like this, and it definitely paves the way for other things is too.

How does an immutable deck interact with Ante? Is Ante just overridden to off for the duration of the tournament (probably the easiest way to handle it)? I already have code in there for this for the Sorin vs Tibalt challenge.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Quest Mode Drafting

Postby lazylockie » 27 May 2014, 19:48

sounds really exciting! I just think that it doesn't make much sense adding a cost for lands. Wouldn't it be better if it used lands from your own pool? In real life drafts/sealed it's common for each player to bring their own basic lands.

I guess single elimination is the way to go for now, since there are so many rules to implement a round robin.

also, how are you going to handle the sets? sets from different blocks would be near impossible to draft. for instance, if you are playing with unrestricted card pool, would you get something like (THS / LRW / 5DN) or (THS / BNG / JOU)?
lazylockie
 
Posts: 508
Joined: 13 Jul 2010, 22:44
Has thanked: 74 times
Been thanked: 15 times

Re: Quest Mode Drafting

Postby KrazyTheFox » 27 May 2014, 20:44

friarsol wrote:How does an immutable deck interact with Ante? Is Ante just overridden to off for the duration of the tournament (probably the easiest way to handle it)? I already have code in there for this for the Sorin vs Tibalt challenge.
That's exactly how I was going to handle it. I'll definitely look at the code you already have, which should speed things along nicely.

lazylockie wrote:I just think that it doesn't make much sense adding a cost for lands. Wouldn't it be better if it used lands from your own pool? In real life drafts/sealed it's common for each player to bring their own basic lands.
It would, but the problem is managing the card pools. It's far easier to not have to pull cards out of regular quest mode (not to mention making sure you don't break an existing quest mode deck) and just supply a few more. Similarly, I'll be making sure the drafted cards don't actually appear in your quest mode card pool before the tournament has ended so that you don't ante or sell a card that's in your draft deck.

lazylockie wrote:I guess single elimination is the way to go for now, since there are so many rules to implement a round robin.
I did consider doing a round robin style tournament and perhaps I'll implement it in the future, but I felt the more structured tournament style would feel a little more exciting (lose once and you lose all) and it'd set it apart as its own game mode rather than being just draft mode in quest mode.

Here's a mockup of the interface so far and it'll probably change dramatically:
TournamentInterface2.jpg
TournamentInterface.jpg


lazylockie wrote:also, how are you going to handle the sets? sets from different blocks would be near impossible to draft. for instance, if you are playing with unrestricted card pool, would you get something like (THS / LRW / 5DN) or (THS / BNG / JOU)?
I'm not entirely sure how I'll handle set selection yet. Right now it has the exact same menu you get when you start a regular draft game. I'll have to think up as many possible scenarios as I can for quest selections and figure out what works best for it. My current thoughts are that it'd first try to pick a complete block, then a core set, then a single set. If none of those are found, then it'd probably default to a full card pool of your unlocked sets.

I'm also considering adding an option to allow drafts for sets that aren't unlocked yet if "Allow unlock of additional editions" is selected. Then you could grab cards from sets you don't have yet, but not on a regular basis.



Edit: Immutable decks are in, working, and are completely separate from all other deck storage. This is going surprisingly well. :D

Edit 2: Deck picking and management fully implemented! Can now start a new draft, pick cards, build a deck, edit the deck, then end the "tournament" to put the cards into your quest pool. I'm changing the way the tournament starts. Since it's possible to create an illegal deck, I'm going to let you edit the deck multiple times before starting the tournament. You won't be able to proceed past the building stage until you have a legal deck (or have legality enforcement off) and after that point the deck will be immutable. This may very well take much less time than I had anticipated.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Quest Mode Drafting

Postby KrazyTheFox » 29 May 2014, 02:44

Spent today doing all the super important backend stuff, such as loading, generating, and saving tournament events. I also started re-writing all the GUI stuff I hacked together to be dedicated to quest mode drafting instead of just having it be copied and pasted over from the duels and challenges menus.

It doesn't look like much, but the structure is now in place to build features upon:
TournamentSelection.jpg


That screenshot is of a Lorwyn/Alara only quest. It demonstrates random blocks, sets, and boosters. It's basically the regular draft mode block selections randomized.

I'm hoping to have this working enough by Friday evening that I can commit it for testing.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Quest Mode Drafting

Postby KrazyTheFox » 30 May 2014, 04:44

A lot of work went into finishing up the draft picking portion of the UI. This part is nearly finished, just a few more things to do behind the scenes to make sure everything's working the way it should.
TournamentInterface.jpg


I've also added the part of the menu that lets you edit your deck further before committing the final version for the tournament. Not much to say about this as it's exactly what it looks like. It'll get some aesthetic treatment, but I'm fairly sure it's otherwise complete.
TournamentInterface2.jpg


The game now generates randomized starting positions for the tournament. I've added in the final UI to start matches from that represents this. You can now start a match against your first opponent (in this case, against AI Deck #1). I haven't programmed beyond the first match yet, but I'll more than likely get the rest of the matches programmed by tomorrow evening. However, the important first steps have been taken to actually play a game and the first match works well. This screen is in need of a lot of touching up, but I haven't settled on a layout enough to start doing more than is already there yet. I'll probably wait until the rest of the mode is fully functional before prettying things up.
TournamentInterface3.jpg


I'm looking forward to committing a working version of the draft tournaments tomorrow (provided adapting older save files doesn't end up being too difficult).
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Quest Mode Drafting

Postby KrazyTheFox » 30 May 2014, 20:51

I'm almost done getting the basic features working so that it can be test played, but this leaves me with a couple questions:

1. What should prizes be? Right now I'm thinking...
- 0 wins: Nothing!
- 1 win: Nothing!
- 2 wins: 1/4 prize pool as booster packs
- 3 wins: 1/2 prize pool as both booster packs and credits + immediately available draft to replace the one just played

2. Should the player be awarded/penalized for game wins/losses (+/- credits)? I'm on the fence with this one. You already lose credits for just joining the draft in the first place and win credits for, well, winning.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Quest Mode Drafting

Postby KrazyTheFox » 31 May 2014, 06:08

Almost there.

I've got everything in place to update older save files and got the matches almost working. I've not been able to find a simple way to have the AI play UI-less games yet, so for now you have to watch them play (though it goes much quicker with the 10x speed button).

Unfortunately, I won't have an update ready tonight. There's this annoying bug where the end-of-match overlay doesn't go away when it's an AI vs. AI game last. Then there's this other one where quitting a match (not a game) stops the whole process and doesn't allow you to continue the tournament. Once those two bugs are ironed out I'll be able to post a working (yet not aesthetically pleasing) version.

You can see that AIs are now given random names and this particular tournament is almost over. To speed things along, I conceded my first match and was eliminated.
TournamentInterface.jpg
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Quest Mode Drafting

Postby KrazyTheFox » 31 May 2014, 21:07

Just committed the first working version of the code. There's a few things missing at the moment (such as prizes) and some minor bugs left to iron out before the mode itself is complete. On top of that, the UI still needs a lot of TLC and usability improvements. That said, it should all be playable now and fully compatible with current save files.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Quest Mode Drafting

Postby friarsol » 31 May 2014, 22:14

KrazyTheFox wrote:Just committed the first working version of the code. There's a few things missing at the moment (such as prizes) and some minor bugs left to iron out before the mode itself is complete. On top of that, the UI still needs a lot of TLC and usability improvements. That said, it should all be playable now and fully compatible with current save files.
Between you and drdev, my wife is going to kill me. She already said "Now you're playing Magic on your phone?" this afternoon.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Quest Mode Drafting

Postby friarsol » 01 Jun 2014, 02:38

Ok here's my general feelings:

No standard penalties or bonuses per match. You already paid in, and your bonuses are going to be provided at the end of the tournament. I kinda of think you should be able to edit your deck in between matches (mostly just optimizing cards out that didn't meet your expectations), but if it's too tricky to pull off that's fine. Think more Prerelease limited, than PTQ with deck lists limited.

I know we have hooks to do AI vs AI as a Command Line (as one of the guys in the Quest Decks is doing), you may be able to utilize something like that to skip the AI matches from being forced to display.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Quest Mode Drafting

Postby friarsol » 01 Jun 2014, 02:55

Erg. I got a crash in the middle of a tournament, and had to close Forge. When I come back it looks like I'm in the middle of an Active Tournament (all the other "Games" in my round are clearly awarded winners). But the start button.. doesn't actually do anything when I click on Start.

Figured I'd let you know just in case it wasn't on your list already.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Quest Mode Drafting

Postby KrazyTheFox » 01 Jun 2014, 03:37

friarsol wrote:I kinda of think you should be able to edit your deck in between matches (mostly just optimizing cards out that didn't meet your expectations), but if it's too tricky to pull off that's fine.
It's not all that tricky (I just need to add a button for it), but I do want to make sure everything else is working fine before I go introducing another potential thing to go wrong to the mix.

friarsol wrote:Erg. I got a crash in the middle of a tournament, and had to close Forge. When I come back it looks like I'm in the middle of an Active Tournament (all the other "Games" in my round are clearly awarded winners). But the start button.. doesn't actually do anything when I click on Start.
Yeah, I'm aware of that one. It's on my growing list of things to fix tonight. I'm almost done adding in prizes, so that'll be the first fix once I'm done. You can fix it by unzipping the quest save (it's gzip compression) and editing the standings for that particular draft:
Code: Select all
        <standings>
          <s0>quest_draft_human_place</s0>
          <s1>4</s1>
          <s2>1</s2>
          <s3>5</s3>
          <s4>7</s4>
          <s5>3</s5>
          <s6>6</s6>
          <s7>2</s7>
          <s8>quest_draft_undetermined_place</s8>
          <s9>quest_draft_undetermined_place</s9>
          <s10>quest_draft_undetermined_place</s10>
          <s11>quest_draft_undetermined_place</s11>
          <s12>quest_draft_undetermined_place</s12>
          <s13>quest_draft_undetermined_place</s13>
          <s14>quest_draft_undetermined_place</s14>
        </standings>
The first matches are standings 0-7, the second matches are 8-11, and the third matches are 12-13. If you set the range for whichever set of matches got interrupted to "quest_draft_undetermined_place" it'll let you re-play that set of matches before I upload the fixed version.

All you'd have to do after that is re-compress the quest save using gzip compression.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Quest Mode Drafting

Postby KrazyTheFox » 01 Jun 2014, 05:37

Lots of work done today! Knocked out a pile of bugs and finished the deck editing screen:
TournamentInterface.jpg


The tournament is now able to continue if it's interrupted for some reason. It'll pick up after the last finished match and resume games from there. I've also built in all the prizes (for now), which also means that the entry fee is enforced. The game mode itself is now complete, with just UI enhancements and bug fixes to go!

I'll take a look at removing the UI for AI matches soon, but that might not be something that's easily done. It'll definitely involve digging deeper into the code.
User avatar
KrazyTheFox
Programmer
 
Posts: 725
Joined: 18 Mar 2014, 23:51
Has thanked: 66 times
Been thanked: 226 times

Re: Quest Mode Drafting

Postby Agetian » 01 Jun 2014, 12:33

Really amazing job thus far on Quest Mode Drafting! This really makes the quest mode feel more exciting and varied and brings my favorite game type to the mix of available things to do when questing! Keep it up! :)

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

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 39 guests


Who is online

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

Login Form