It is currently 25 May 2017, 04:50
   
Text Size

Puzzle Mode

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, moomarc, Chris H., DennisBergkamp, Rob Cashwalker, friarsol, CCGHQ Admins

Puzzle Mode

Postby friarsol » 20 Mar 2017, 21:44

So i had some free time this weekend to work on a project that had been on my to do list forever. It's not 100% done but it's definitely at the point where i can commit an initial version soonish.

If anyone remembers those old puzzles from inside duelist magazine, it's basically that ability baked into forge. If anyone has a good compilation of puzzles and/ or they are willing to transcribe puzzles please let me know
friarsol
Global Moderator
 
Posts: 7047
Joined: 15 May 2010, 04:20
Has thanked: 225 times
Been thanked: 838 times

Re: Puzzle Mode

Postby Indigo Dragon » 21 Mar 2017, 08:16

Coincidentally, "Possibility Storm" just started up, posting puzzles (hopefully) weekly.
You can check them out here https://www.patreon.com/mtgpuzzles.
Their subreddit also has a couple more https://www.reddit.com/r/mtgpuzzles/.
Ctrl+C, Ctrl+V
User avatar
Indigo Dragon
 
Posts: 77
Joined: 11 May 2016, 10:18
Location: Australia
Has thanked: 43 times
Been thanked: 38 times

Re: Puzzle Mode

Postby Agetian » 22 Mar 2017, 08:05

Ah, this is really great! :) I've been willing to do something like that for quite a while by now, but sadly couldn't find the time to get to the implementation stage. Glad to hear you're doing it! I'll see if I can contribute after the initial commit in any meaningful way in my current time frame. :) Best of luck!

- Agetian
Agetian
Programmer
 
Posts: 2573
Joined: 14 Mar 2011, 05:58
Has thanked: 507 times
Been thanked: 315 times

Re: Puzzle Mode

Postby Bog Wraith » 31 Mar 2017, 03:03

I refer you to something I did here 6 years ago:


viewtopic.php?f=77&t=3488


viewtopic.php?f=62&t=3287


viewforum.php?f=79


viewforum.php?f=77


Let me know what you think, Sol.
'Twas in the bogs of Cannelbrae
My mate did meet an early grave
'Twas nothing left for us to save
In the peat-filled bogs of Cannelbrae.
User avatar
Bog Wraith
Global Mod 1 (Ret)
 
Posts: 1031
Joined: 28 May 2008, 22:40
Location: Shandalar
Has thanked: 331 times
Been thanked: 143 times

Re: Puzzle Mode

Postby friarsol » 01 Apr 2017, 01:35

Oh nice. The ultimate goal is to have a "Solve" Mode and a "Create" Mode. To start only the Solve mode will be available, but eventually I'll pull together the other Mode where basically you get to set the current board state, and the goal of the puzzle, disabling all of the "Magic engine" aspects of Forge. And letting you have a "toolbar" of sorts, that is basically the same as what are dev tools do.

I'm currently using the Game State Load/Save to save out states then drop them into a Puzzle file.
friarsol
Global Moderator
 
Posts: 7047
Joined: 15 May 2010, 04:20
Has thanked: 225 times
Been thanked: 838 times

Re: Puzzle Mode

Postby Bog Wraith » 01 Apr 2017, 02:38

Ok, I look forward to this very much.

I moved recently so I'm not sure where my Duelist Magazines are, but I have every one of them. Somewhere, I also have a book that Rosewater put out collecting these puzzles. They are of course based on old sets from the past, but they are awesome still to this day.

Let me know if you need any of these Sol, and I will hunt for them when I can.

Gathering Magic has been doing puzzles from more current sets as well as from some in the past. They have been doing this for a number of years now so there are a ton to choose from.

http://www.gatheringmagic.com/category/puzzles/
'Twas in the bogs of Cannelbrae
My mate did meet an early grave
'Twas nothing left for us to save
In the peat-filled bogs of Cannelbrae.
User avatar
Bog Wraith
Global Mod 1 (Ret)
 
Posts: 1031
Joined: 28 May 2008, 22:40
Location: Shandalar
Has thanked: 331 times
Been thanked: 143 times

Re: Puzzle Mode

Postby Xitax » 01 Apr 2017, 17:04

Would like to help with puzzle compilation when this is testable :)
Xitax
 
Posts: 757
Joined: 16 May 2010, 17:19
Has thanked: 111 times
Been thanked: 88 times

Re: Puzzle Mode

Postby bink » 07 Apr 2017, 04:20

Don't know how I missed this. Thank you for pointing me here after I made a post on the same subject. If I can help in anyway please let me know. A bunch of puzzles can be found here.
http://www.gatheringmagic.com/category/puzzles/
User avatar
bink
 
Posts: 28
Joined: 18 Nov 2015, 22:08
Has thanked: 10 times
Been thanked: 15 times

Re: Puzzle Mode

Postby Voda » 07 Apr 2017, 08:55

Is there any way we can start working on some Puzzles' implementation ? Like, is setting up some game states all we can do at the moment or do you think of any other work we could do in advance ?

Also, did you think of how we are going to share solutions with puzzles ?
User avatar
Voda
 
Posts: 21
Joined: 01 Feb 2017, 10:34
Has thanked: 9 times
Been thanked: 5 times

Re: Puzzle Mode

Postby friarsol » 08 Apr 2017, 15:21

Right now the puzzles are just enhanced Game State files. I'll continue to improve to game state, since right now there's a bunch of limiting factors, trying to keep it as backwards compatible as possible..

Here is one of my test puzzles:

Code: Select all
[metadata]
Name:Possibility Storm #1
URL:https://i.redd.it/wws1h03gy7ky.png
Goal:Win
Turns:1
[state]
ActivePlayer=Human
ActivePhase=Main1
HumanLife=20
AILife=9
HumanPlay=Key to the City; Ravenous Intruder; Ruinous Gremlin; Island; Island; Island; Island; Island; Mountain; Mountain
HumanHand=Welcome to the Fold; Chilling Grasp; Flame Lash; Confirm Suspicions
AIPlay=Workshop Assistant; Thriving Ibex
friarsol
Global Moderator
 
Posts: 7047
Joined: 15 May 2010, 04:20
Has thanked: 225 times
Been thanked: 838 times

Re: Puzzle Mode

Postby bink » 08 Apr 2017, 18:29

I just became a patron of Possibility Storms puzzles.

I'm actually working on puzzle 2 for Forge. So far I have found the easiest way is to make a deck with all the cards needed for the puzzle in it. Start a new game with both players set to human, both playing the same deck with the puzzle cards and have deck conformance turned off. Then use dev mode to get everything in the right place and ready for our first main phase. Finally save the state and try to solve the puzzle.

So far I have found this the easiest way. Previously I was tutoring for every card with both players having a deck of only basic land. It got the job done but took forever. Sol I hope you find away to get Puzzle mode integrated into Forge. It would be amazing. Unfortunately I do not posses the skill set to complete such a task.
User avatar
bink
 
Posts: 28
Joined: 18 Nov 2015, 22:08
Has thanked: 10 times
Been thanked: 15 times

Re: Puzzle Mode

Postby Xitax » 08 Apr 2017, 20:46

friarsol wrote:Right now the puzzles are just enhanced Game State files. I'll continue to improve to game state, since right now there's a bunch of limiting factors, trying to keep it as backwards compatible as possible..
If you can figure out a way to add counters or attach permanents it would be at least 90% of the way there. I haven't seen many puzzles where the goal wasn't to win and the player wasn't already on the ropes, so normal Forge play works for those.
Xitax
 
Posts: 757
Joined: 16 May 2010, 17:19
Has thanked: 111 times
Been thanked: 88 times

Re: Puzzle Mode

Postby friarsol » 08 Apr 2017, 21:28

bink wrote:I just became a patron of Possibility Storms puzzles.

I'm actually working on puzzle 2 for Forge. So far I have found the easiest way is to make a deck with all the cards needed for the puzzle in it. Start a new game with both players set to human, both playing the same deck with the puzzle cards and have deck conformance turned off. Then use dev mode to get everything in the right place and ready for our first main phase. Finally save the state and try to solve the puzzle.

So far I have found this the easiest way. Previously I was tutoring for every card with both players having a deck of only basic land. It got the job done but took forever. Sol I hope you find away to get Puzzle mode integrated into Forge. It would be amazing. Unfortunately I do not posses the skill set to complete such a task.
Yea, I actually have puzzle #2 scripted too, but there was some weirdness with the Planeswalker counters. Hadn't gotten time to fix it yet.

Depending on the contents, it's probably fastest to just handtype the game state file, then build a deck then do all the dev tools shenanigans. As I mentioned, the goal is to have a create mode, that doesn't run the actual engine, let's you set whatever turn you need. And let's you go find whatever cards you want and add them to whatever zone you need. I committed what I had so it'll be in the next snapshot build, but definitely consider it still a work in progress. Create mode isn't started at all yet, but solve mode should work.

Xitax wrote:If you can figure out a way to add counters or attach permanents it would be at least 90% of the way there. I haven't seen many puzzles where the goal wasn't to win and the player wasn't already on the ropes, so normal Forge play works for those.
Adding counters to permanents supposedly was already there, I made it bit more generic so it might work for players too. Attaching permanents is definitely tricky.

If there's limitations to what the AI should be doing, I might add certain cards to the puzzle so it can't happen "AI won't activate XYZ ability" etc.
friarsol
Global Moderator
 
Posts: 7047
Joined: 15 May 2010, 04:20
Has thanked: 225 times
Been thanked: 838 times

Re: Puzzle Mode

Postby bink » 09 Apr 2017, 01:11

I just discovered when dumping game a state if both players are set to human a java script error occurs. So much for making easy states. Looks like you method is better Sol.
User avatar
bink
 
Posts: 28
Joined: 18 Nov 2015, 22:08
Has thanked: 10 times
Been thanked: 15 times

Re: Puzzle Mode

Postby friarsol » 09 Apr 2017, 02:13

bink wrote:I just discovered when dumping game a state if both players are set to human a java script error occurs. So much for making easy states. Looks like you method is better Sol.
Yea Game States are very restrictive unfortunately. It's not that big of a deal to make one player an AI and still use the dev tools, but you have to be careful as you do it.
friarsol
Global Moderator
 
Posts: 7047
Joined: 15 May 2010, 04:20
Has thanked: 225 times
Been thanked: 838 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 2 guests


Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 2 guests

Login Form