<s>
Magic	B-Language
:	I-Language
The	I-Language
Gathering	I-Language
–	I-Language
Duels	I-Language
of	I-Language
the	I-Language
Planeswalkers	I-Language
is	O
a	O
video	O
game	O
based	O
on	O
the	O
popular	O
collectible	O
card	O
game	O
of	B-Application
the	I-Application
same	I-Application
name	I-Application
,	O
published	O
by	O
Wizards	O
of	O
the	O
Coast	O
.	O
</s>
<s>
The	O
core	O
game	O
follows	O
the	O
standard	O
rules	O
of	O
the	O
collectible	O
card	O
game	O
Magic	B-Application
:	I-Application
The	I-Application
Gathering	I-Application
;	O
each	O
player	O
has	O
a	O
deck	O
of	O
cards	O
consisting	O
of	O
lands	O
and	O
spells	O
.	O
</s>
<s>
Players	O
can	O
play	O
in	O
both	O
casual	O
and	O
ranked	O
competitive	O
games	O
over	O
Xbox	B-Operating_System
Live	O
against	O
up	O
to	O
three	O
opponents	O
.	O
</s>
<s>
Due	O
to	O
the	O
nature	O
of	O
Magic'''s	O
gameplay	O
,	O
in	O
which	O
any	O
card	O
can	O
override	O
the	O
game	O
's	O
core	O
rules	O
,	O
Duels	O
was	O
developed	O
using	O
a	O
combination	O
of	O
C++	B-Language
for	O
the	O
core	O
engine	O
and	O
the	O
Lua	B-Language
scripting	I-Language
language	I-Language
,	O
wrapped	O
in	O
XML	B-Protocol
,	O
to	O
provide	O
logic	O
for	O
specific	O
cards	O
.	O
</s>
<s>
The	O
game	O
's	O
interface	O
was	O
kept	O
separate	O
from	O
the	O
development	O
of	O
the	O
engine	O
,	O
and	O
instead	O
structured	O
in	O
a	O
client	B-Operating_System
–	I-Operating_System
server	I-Operating_System
fashion	O
,	O
with	O
the	O
interface	O
as	O
the	O
client	O
.	O
</s>
<s>
The	O
game	O
's	O
artificial	B-Application
intelligence	I-Application
(	O
AI	B-Application
)	O
is	O
based	O
on	O
creating	O
a	O
multistep	O
"	O
lookahead	O
"	O
decision	B-Algorithm
tree	I-Algorithm
from	O
the	O
current	O
state	O
of	O
the	O
board	O
,	O
evaluating	O
possible	O
known	O
moves	O
by	O
its	O
opponents	O
,	O
scoring	O
the	O
current	O
and	O
resulting	O
situations	O
both	O
positively	O
and	O
negatively	O
,	O
and	O
then	O
selecting	O
the	O
option	O
with	O
the	O
highest	O
score	O
.	O
</s>
<s>
The	B-Application
artificial	I-Application
intelligence	I-Application
utilizes	O
threading	B-Operating_System
to	O
run	O
the	O
main	O
intelligence	O
algorithm	O
alongside	O
three	O
"	O
sub-contractors	O
"	O
that	O
evaluate	O
the	O
possible	O
future	O
states	O
and	O
report	O
back	O
to	O
the	O
main	O
algorithm	O
.	O
</s>
<s>
Each	O
of	O
these	O
instances	O
of	O
the	O
AI	B-Application
uses	O
a	O
special	O
engine	O
that	O
both	O
implements	O
the	O
rules	O
of	O
Magic	O
,	O
while	O
also	O
providing	O
"	O
undo	O
"	O
actions	O
so	O
that	O
they	O
may	O
explore	O
up	O
and	O
down	O
the	O
decision	B-Algorithm
tree	I-Algorithm
.	O
</s>
<s>
When	O
the	O
player	O
makes	O
an	O
action	O
,	O
the	O
AI	B-Application
threads	B-Operating_System
are	O
interrupted	O
and	O
brought	O
to	O
the	O
same	O
state	O
as	O
the	O
game	O
,	O
then	O
continue	O
processing	O
,	O
in	O
some	O
cases	O
,	O
reusing	O
existing	O
branches	O
on	O
the	O
decision	B-Algorithm
tree	I-Algorithm
that	O
match	O
with	O
the	O
player	O
's	O
selection	O
.	O
</s>
<s>
The	O
AI	B-Application
itself	O
does	O
not	O
employ	O
any	O
strategy	O
in	O
terms	O
of	O
strong	O
card	O
combinations	O
,	O
but	O
instead	O
,	O
when	O
such	O
combinations	O
improve	O
the	O
computer	O
's	O
situation	O
,	O
the	O
chances	O
of	O
playing	O
these	O
combinations	O
will	O
"	O
ripple	O
"	O
back	O
through	O
the	O
decision	B-Algorithm
tree	I-Algorithm
.	O
</s>
<s>
In	O
this	O
manner	O
,	O
the	O
computer	B-Application
AI	I-Application
will	O
play	O
one	O
card	O
of	O
such	O
a	O
combination	O
should	O
it	O
be	O
the	O
best	O
choice	O
at	O
that	O
time	O
,	O
and	O
follow	O
up	O
with	O
the	O
second	O
card	O
of	O
the	O
combination	O
should	O
that	O
option	O
still	O
remain	O
the	O
best	O
after	O
any	O
other	O
player	O
actions	O
.	O
</s>
<s>
In	O
order	O
to	O
simplify	O
the	O
task	O
of	O
forward	O
evaluation	O
,	O
the	O
lookahead	O
algorithm	O
was	O
optimized	O
in	O
several	O
ways	O
,	O
considering	O
"	O
the	O
idea	O
that	O
the	O
AI	B-Application
needs	O
to	O
be	O
excellent	O
99%	O
of	O
the	O
time	O
,	O
even	O
if	O
it	O
's	O
at	O
the	O
cost	O
of	O
being	O
sub-optimal	O
that	O
other	O
1%	O
"	O
.	O
</s>
<s>
As	O
a	O
result	O
of	O
these	O
means	O
of	O
programming	O
the	O
AI	B-Application
,	O
it	O
was	O
noted	O
that	O
the	O
computer	O
opponents	O
may	O
exhibit	O
behavior	O
not	O
found	O
by	O
typical	O
Magic	O
players	O
,	O
such	O
as	O
not	O
holding	O
back	O
attackers	O
to	O
act	O
as	O
blockers	O
for	O
the	O
opponent	O
's	O
turn	O
,	O
though	O
as	O
noted	O
by	O
the	O
developers	O
,	O
such	O
aggressive	O
play	O
is	O
generally	O
a	O
winning	O
strategy	O
for	O
the	O
computer	O
.	O
</s>
<s>
The	O
AI	B-Application
also	O
does	O
not	O
have	O
any	O
special	O
knowledge	O
of	O
the	O
constructed	O
decks	O
itself	O
or	O
what	O
cards	O
an	O
opponent	O
might	O
have	O
given	O
the	O
visible	O
cards	O
in	O
play	O
;	O
again	O
,	O
the	O
developers	O
noted	O
that	O
approach	O
can	O
sometimes	O
work	O
better	O
instead	O
of	O
contemplating	O
"	O
big	O
and	O
clever	O
"	O
plans	O
.	O
</s>
<s>
The	O
developers	O
noted	O
that	O
they	O
observed	O
unusual	O
but	O
effective	O
strategies	O
from	O
working	O
with	O
the	O
AI	B-Application
that	O
they	O
were	O
not	O
aware	O
of	O
before	O
,	O
primarily	O
based	O
on	O
the	O
timing	O
of	O
playing	O
certain	O
cards	O
and	O
effects	O
.	O
</s>
<s>
The	B-Operating_System
PS3	I-Operating_System
version	O
of	O
the	O
game	O
was	O
released	O
on	O
November	O
23	O
,	O
2010	O
.	O
</s>
<s>
The	O
release	O
date	O
for	O
the	O
Xbox	B-Device
Live	I-Device
Arcade	I-Device
version	O
was	O
December	O
29	O
,	O
2010	O
.	O
</s>
<s>
A	O
sequel	O
to	O
Duels	B-Language
of	I-Language
the	I-Language
Planeswalkers	I-Language
,	O
titled	O
Magic	B-Device
:	I-Device
The	I-Device
Gathering	I-Device
–	I-Device
Duels	I-Device
of	I-Device
the	I-Device
Planeswalkers	I-Device
2012	I-Device
,	O
was	O
released	O
on	O
June	O
15	O
,	O
2011	O
for	O
Microsoft	B-Application
Windows	I-Application
,	O
Xbox	B-Operating_System
360	I-Operating_System
,	O
and	O
PlayStation	B-Operating_System
3	I-Operating_System
.	O
</s>
<s>
SalesDuels''	O
,	O
in	O
its	O
first	O
five	O
weeks	O
of	O
release	O
on	O
the	O
Xbox	B-Operating_System
Live	O
Marketplace	O
,	O
had	O
been	O
downloaded	O
over	O
440,000	O
times	O
and	O
has	O
had	O
170,000	O
full	O
game	O
purchases	O
,	O
a	O
turnover	O
percentage	O
that	O
is	O
generally	O
higher	O
than	O
most	O
other	O
digital	O
downloads	O
.	O
</s>
<s>
The	O
game	O
also	O
remains	O
on	O
the	O
top	O
ten	O
played	O
Xbox	B-Operating_System
Live	O
titles	O
,	O
with	O
it	O
being	O
the	O
top-ranked	O
title	O
for	O
the	O
first	O
two	O
weeks	O
of	O
release	O
.	O
</s>
<s>
By	O
January	O
2011	O
,	O
more	O
than	O
500,000	O
units	O
of	O
the	O
game	O
have	O
been	O
sold	O
on	O
the	O
Xbox	B-Operating_System
Live	O
Marketplace	O
.	O
</s>
