It is currently 19 Sep 2018, 22:13
   
Text Size

Duels of the Planeswalkers - programming commentary

General Discussion of the Intricacies

Moderator: CCGHQ Admins

Duels of the Planeswalkers - programming commentary

Postby Rob Cashwalker » 17 Jun 2009, 17:30

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
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: Duels of the Planeswalkers - programming commentary

Postby Snacko » 17 Jun 2009, 20:07

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)
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 73 times

Re: Duels of the Planeswalkers - programming commentary

Postby juzamjedi » 17 Jun 2009, 23:18

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 ....
juzamjedi
Tester
 
Posts: 573
Joined: 13 Nov 2008, 08:35
Has thanked: 6 times
Been thanked: 8 times

Re: Duels of the Planeswalkers - programming commentary

Postby frwololo » 18 Jun 2009, 00:15

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...
frwololo
DEVELOPER
 
Posts: 265
Joined: 21 Jun 2008, 04:33
Has thanked: 0 time
Been thanked: 3 times

Re: Duels of the Planeswalkers - programming commentary

Postby BlackMamba » 18 Jun 2009, 01:41

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.
BlackMamba
 
Posts: 23
Joined: 17 Sep 2008, 01:24
Has thanked: 0 time
Been thanked: 0 time

Re: Duels of the Planeswalkers - programming commentary

Postby juzamjedi » 22 Jun 2009, 16:48

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 :!:
juzamjedi
Tester
 
Posts: 573
Joined: 13 Nov 2008, 08:35
Has thanked: 6 times
Been thanked: 8 times

Re: Duels of the Planeswalkers - programming commentary

Postby Marek14 » 25 Jun 2009, 05:50

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?
Marek14
Tester
 
Posts: 2628
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 254 times

Re: Duels of the Planeswalkers - programming commentary

Postby juzamjedi » 25 Jun 2009, 14:32

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 )
juzamjedi
Tester
 
Posts: 573
Joined: 13 Nov 2008, 08:35
Has thanked: 6 times
Been thanked: 8 times

Re: Duels of the Planeswalkers - programming commentary

Postby frwololo » 26 Jun 2009, 01:24

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).
frwololo
DEVELOPER
 
Posts: 265
Joined: 21 Jun 2008, 04:33
Has thanked: 0 time
Been thanked: 3 times


Return to Magic Rules Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (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 1 guest

Login Form