Discovering openings and their balance in competitive RTS gaming. An approach with sequential...

24
An approach with sequen1al pa3ern mining G. Bosc, M. Kaytoue , C. Raïssi, J.5F. Boulicaut Machine Learning and Data Mining for Sports AnalyCcs, MLSA@ECML/PKDD 2013 workshop, 27 September 2013, Praha, Czech Republic

description

Electronic sport, or e-sport, denotes the extreme practice of video games where so-called cyber-athletes compete in world-wide tournaments. As for any sport, such professionals are surrounded by sponsors and practice within professional teams. These professional games are even broadcast by commentators over specialized TV channels. {\sc StarCraft II} (Blizzard Entertainment) is one of the most competitive video game and has now its own world-wide players ranking system (based on the well-known ELO system) and annual world cup competition series (WCS) with a US\$1.6 millions prize pool for the year 2013. Each match between two opponents can be recorded as an exhaustive and noisy sequence of actions. Analyzing these sequences yields an important outcome for game strategy prediction and in-depth game understanding. In this work we report a preliminary study on StarCraft II professional players strategies' discovery based on sequential pattern mining.

Transcript of Discovering openings and their balance in competitive RTS gaming. An approach with sequential...

Page 1: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

An#approach#with#sequen1al#pa3ern#mining#

!G.!Bosc,!M.!Kaytoue,!C.!Raïssi,!J.5F.!Boulicaut!

Machine!Learning!and!Data!Mining!for!Sports!AnalyCcs,!MLSA@ECML/PKDD!2013!workshop,!27!September!2013,!Praha,!Czech!Republic!

Page 2: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

o !Anyone,'any)me,'anywhere,'…'any$what!o !Flourishing'video'game'industry!

O WORLD!OF!WARCRAFT!(2004)!aXracted!millions!of!gamers,!US!20$/month/user!O GRAND!THEFT!AUTO!!V!(2013)!:!!US!200!M$!budget,!US!800!M$!sells!in!24h!O CANDY!CRUSH!SAGA:!45!M!users,!15!M!users!acCve!every!days!O WATCH!DOGS!(2013),!and!many!others,!being!adapted!to!cinema!!

o !A!context!revealing!the!former!niched!compe))ve'gaming'

2'

Page 3: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

A!new!markeCng!landscape!!

Entering!in!popular!culture!

!

A!sport?!!

Page 4: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

o Professional'&'amateurs!(coaches,!teams,!fanclubs,!streaming)!

o Tournaments!(commentators,!sponsors)!$BLIZZARD$WCS$2013:#$1.6#million#USD##DOTA$2#The$interna<onal$Aug.$2013:$$2.2#millions#USD#

o AXracCng!industrials,!sponsors!:!5!Sept.!2013:!Samsung!in!the!process!to!form!a!Pro!Team!!(300~500K!$)!5!Intel,!Nvidia,!…!community!managers!

o Followed!in!great!numbers,!more!and!more!are!making!a!living!of!it!

G.!Bosc!et!al.!5!Machine!Learning!and!Data!Mining!for!Sports!AnalyCcs,!ECML/PKDD!2013!workshop,!27!September!2013,!Prague,!Czech!Republic! 4'

Page 5: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

Main!Principes!of!RTS!games!

Build!orders!openings!

Strategy!balancing!!

Page 6: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

o A!map,!aerial!view!(like!gmap)!

o 2'players!in!command!(1v1)!

o Controls!units!and!building!o Economy'Gather!resources!o Produc)on'and'technology'Construct!new!buildings!

o Training!combat!units!from!buildings!

o Order!to!explore!the!map!

!!!(fog!of!war)!o Order!to!aBack!an!enemy!

o Winning'condi)on':!opponent!resigns!or!has!no!more!forces!!

6'

Page 7: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

!  Can!operate!fast'mul)Fdecisions'making'process'in'uncertain'environment'!  Mul)Ftasking'(macro,!micro,!several!fronts,!Cmings,!scouCng…)!

!  Velocity!(200!to!400!clicks/Key!pressed!per!minute)!!  Decisions'!Rock/Paper/Scissors!principle,!army!composiCon,!aXacks,!…!

!  Uncertainty'under!a!fog!of!war!!  Ac)ons'may'fail'misclicks!

'It'requires'strategies,'training,'metaFgaming,'etc.'

7'

AutomaCc!discovery!of!build!orders!openings!!A!challenge!for!game!editors!and!(pro)5gamers!

Page 8: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

Data'as'traces'of'interac)on''Sequen)al'paBern'mining'''Build'order'opening'discovery'''Balance'of''an'opening'

Page 9: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

9'

!  A!series!of!)mestamped!acCons!of!different!types!for!both!players!

Page 10: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

•  'Sequence!a!series!of!events!from!an!alphabet!

•  !Sequence'database!a!set!of!sequences!•  'Frequent'sequen)al'paBern'an!arbitrary!sequence!more!general!than!(supported!by)!a!given!proporCon!of!the!database!

•  E.g.!sejng!minimal!support!to!75%!•  <acc>!is!frequent!•  <a{bc}a>!is!not!frequent!

10'

id' sequence'1! <a{abc}{ac}d{cf}>!

2! <{ad}c{bc}{ae}>!

3! <{ef}{ab}{df}cb>!

4! <eg{af}cbc>!

Page 11: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

•  !How'to'turn'replays'files'to'sequences!!•  Events?!•  Windows!of!Cme?!•  One!or!two!players?!

•  !How'to'validate'extracted'paBerns''•  Measuring!the!balance!of!the!strategy?!

•  !How'to'analyze'the'results'•  Search!&!Sort!&!Filter!•  PaXerns!to!be!re5used!for!various!task!

SC2!replays!

Sequence!Database!

Frequent!PaXerns!

Openings!balance!

11'

Page 12: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

!  A!sequence!is!a!series'of'windows'of!)me'composed'of'ac)ons'done!by!both!players!To!differenCate!players,!events!are!tagged!as!winner'(success)'or'looser'(fail)'(1v1!situaCon)!

!  Events/Ac)ons!!are!elements!of!

12'

Page 13: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

! Given!a!frequent!sequenCal!paXern!extract!with!a!FPM!algorithm!

!  !its!dual!represent!the!reversed!scenario,!where!the!!winner!would!have!lost!

! And!then!

13'

Page 14: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

•  !Takes'values'in'

•  !Equilibrium'

•  !UnFbalanced'strategy'

!

•  'Mirror'strategy'

14'

Page 15: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

!  A'naïve'approach'

o  Mining'step:!Extract!all!frequent!sequenCal!paXerns!with!a!known!algorithm!(e.g.!PrefixSpan)!

o  PostFprocessing'step:!count!how!many!Cmes!the!dual!of!each!paXern!appears!in!the!base!

!!!!!!!!!!!!!!!!Not!!scalable !!

!  A'more'elaborated'approach'

o  Mining'step:!Extract!all!frequent!sequenCal!paXerns!with!a!know!algorithm!(e.g.!PrefixSpan)!

o  PostFprocessing'step:!Take!advantage!of!the!tree!data5structure!of!the!extracted!paXerns!

!Faster!computaCon!of!the!balance!!Avoid!redundant!paXerns!

15'

More$technical$and$algorithmic$details$in$the$proceedings$

Page 16: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

Dataset!

QuanCtaCve!results!

QualitaCve!results!!

Page 17: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

o  !RestricCng!371$267$SC2'replays'harvested!on!several!dedicated!websites!

o  !90'768'games'(1v1!only,!APM>200,!Master/Grandmaster)!

G.!Bosc!et!al.!5!Machine!Learning!and!Data!Mining!for!Sports!AnalyCcs,!ECML/PKDD!2013!workshop,!27!September!2013,!Prague,!Czech!Republic! 17'

APM

Time (min)

Count replays

Time (min)

% Actions

Time (min)

Page 18: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

o One!!sequence!database!for!each!matchFup!(PvsP,!PvsT,!PvsZ,!TvsZ,!TvsT,!ZvsZ)!

o  ‘buildForders’!acCons!

o Windows!of!Cme!set!to!30!seconds!

18'

Page 19: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

19'

Page 20: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

'

Top'frequent'paBerns'are'more'balanced''They'should'represent'balanced'and'wellFknown'openings'

20'

Page 21: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

Well'known'openings,'broken'strategies,'unFdiversity'in'mirror'matchups,'etc.''

21'

Forge!Expand

!

• 9:!Pylon!• 14:!Forge!• 17:!Nexus!• 17:!Pylon!• 18:!Gateway!• 18:!Photon!Cannon!• 18:!Assimilator!x2! 15

151!Bu

ild!

• 12:!Barracks!• 13:!Refinery!• 17:!Refinery!• 18:!Factory!• 20:!TechbLab!• 22:!Starport!

4!gates! • 9:!Pylon!

• 12:!Gateway!• 14:!Assimilator!• 15:!Pylon!• 17:!CyberneCcs!pCore!• 22:!Warpgate!• 24:!Gateway!px3!• 26:!Pylon!!• 26:!Assimilator!

minSupp:#5%#3148#pa3erns#

balance(s)=0.59$

minSupp:#5%#400#pa3erns#

balance(s)=0.46$

minSupp:#5%#591#pa3erns#

balance(s)=0.52$

Leveraged'by'Blizzard!(Queen!range+,!Supply!before!barracks)!!

balance(s)#<#0.6$balance(s)#>#0.6$$!

!

Page 22: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.
Page 23: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

DataFmining'o  Emerging$paNern$mining:#items!are!labelled,!not!the!sequence!!itself!o  Scalability:#CompuCng!the!balance!measure!double!the!execuCon!Cme!in!worst!cases!

o  Other$applica<ons:#two!agents!compete!for!a!resource,!one!succeed!while!the!other!fails!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!(sport!analyCcs,!AI,!planning,!…)!

Video'game'analy)cs'and'EFSport'o  Balance!is!one!of!the!hoXest!issue!in!the!E5Sport!scene!o  Service#that!can!help!pro5gamers!and!their!team!to!prepare!match!(e.g.!azer!a!SQL!query!on!replays)!o  Non!professional!entertainment'

Perspec)ves'o  PaXerns!to!be!re5used!as!‘knowledge!unit’!for!other!tasks,!e.g.!real5Cme!winning!predicCon!

o  CompuCng!balance!during!the!mining!step!and!improving!specific!pruning!strategies!o  New!dimensions!to!characterize!emerging!paXerns:!!This#strategy#is#unbalanced#in#map#x#during#season#y#for#player#z#

23'

Page 24: Discovering openings and their balance in competitive RTS gaming. An approach with sequential pattern mining.

An#approach#with#sequen1al#pa3ern#mining#

!G.!Bosc,!M.!Kaytoue,!C.!Raïssi,!J.5F.!Boulicaut!

Machine!Learning!and!Data!Mining!for!Sports!AnalyCcs,!MLSA@ECML/PKDD!2013!workshop,!27!September!2013,!Praha,!Czech!Republic!

Source!code,!dataset!and!quesCons!hXp://liris.cnrs.fr/mehdi.kaytoue!