Page 1 of 1

Duels of the Planeswalkers - programming commentary

PostPosted: 17 Jun 2009, 17:30
by Rob Cashwalker
On wizards' site, today's feature article is written by the lead programmer. He mentions a few interesting things about how they had to take shortcuts in Magic to either make their programming easier or to make the game play easier.

http://www.wizards.com/magic/magazine/a ... eature/43c

Re: Duels of the Planeswalkers - programming commentary

PostPosted: 17 Jun 2009, 20:07
by Snacko
There are so many shortcoming just to get the game out in the open.

Their design goals meet a casual player needs, but anything more advanced is crippled, like no hybrid mana (MTGForge didn't have mana pool since recently ;))

I suppose they end up with many vanilla creatures and very simple spells even thou a long development cycle (2 years with 40 people)

Re: Duels of the Planeswalkers - programming commentary

PostPosted: 17 Jun 2009, 23:18
by juzamjedi
I know very little of Lua other than (I think) it is the language used in WOW. But I wonder why there use several levels of code for something as simple as granting flying to a creature (Flying + GiveFlying?)

I definitely give props to them for taking on the challenge of text-changing cards. I have not seen that before, has anyone else done this?..

Lastly I laughed out loud when I read this :lol:
Fortunately, Wizards never asked us to implement Shahrazad ....

Re: Duels of the Planeswalkers - programming commentary

PostPosted: 18 Jun 2009, 00:15
by frwololo
juzamjedi wrote:I know very little of Lua other than (I think) it is the language used in WOW. But I wonder why there use several levels of code for something as simple as granting flying to a creature (Flying + GiveFlying?)
I guess they aim at flexibility to add more cards and rules in the future...

Re: Duels of the Planeswalkers - programming commentary

PostPosted: 18 Jun 2009, 01:41
by BlackMamba
I like how they split the UI code from the engine code (as it should be!). I'm certainly glad I did it for Mox.

I'm eager to see how they did AI since I'm knee deep in AI right now.

Re: Duels of the Planeswalkers - programming commentary

PostPosted: 22 Jun 2009, 16:48
by juzamjedi
Here is the follow up article with discussion over the AI: http://www.wizards.com/Magic/Magazine/Article.aspx?x=mtg/daily/feature/44

The tips and tricks that they used for optimizing the AI are very interesting. Yet even with all the tricks employed they could not look ahead to the next full turn to calculate the value of keeping back blockers. Admittedly I have never tried coding an AI for Magic, but it struck me as pretty crazy that there are so many branches to evaluate :!:

Re: Duels of the Planeswalkers - programming commentary

PostPosted: 25 Jun 2009, 05:50
by Marek14
I wonder if there would be anything to gain from Monte Carlo method - i.e. make a sequence of few random moves, make many, many of them, and then look which one has the best results... It wouldn't be smart, but it wouldn't probably be exactly stupid either?

Re: Duels of the Planeswalkers - programming commentary

PostPosted: 25 Jun 2009, 14:32
by juzamjedi
I think the problem with this approach starts rearing its head when you look at the number of possible moves. Or at least that was my take when reading the article.

Perhaps it would be a good exercise to actually lay out a reasonable board position and evaluate how many decisions exist with this brute force approach? (A good AI would need to include some reasonable ability to estimate cards in opponent's hand without outright cheating.)

I would predict that the Monte Carlo implementation would have one nice side effect: there would be the occasional random, silly decision due to the AI not going through enough scenarios in his head (like real life Magic :D )

Re: Duels of the Planeswalkers - programming commentary

PostPosted: 26 Jun 2009, 01:24
by frwololo
Marek14 wrote:I wonder if there would be anything to gain from Monte Carlo method - i.e. make a sequence of few random moves, make many, many of them, and then look which one has the best results... It wouldn't be smart, but it wouldn't probably be exactly stupid either?
Well, that's pretty much what they do, except in a clever way (minmax + alpha beta pruning).
Both methods have the same issue: it is very difficult to analyze if the result is good or not (evaluation function is difficult to write).