SlideShare une entreprise Scribd logo
1  sur  13
Télécharger pour lire hors ligne
GAGNER AUX TCG GRÂCE
À L’INFORMATIQUE
Hearthstone, Magic, et autres Yu-gi-oh! : que
peut-on résoudre avec du code
Gary « Tolki » Mialaret
Introduction
• Qui suis-je ?
• Ex consultant chez Octo Technology
• Actuellement Associate Producer chez Ubisoft
• Auteur pour Wizards of the Coast
• Commentateur de tournois eSports et youtubeur
• Magic, LoL, Starcraft 2
• Contenu régulier sur ogaming.tv de 2012 à 2014
• Blogueur débutant (tolkicasts.com)
TCG ?
• Trading Cards Game
• Regroupe en vrai tous les jeux de cartes
• Hearthstone (pas de trade)
• Netrunner (distribution non aléatoire des cartes)
• Point commun
• Structure de tour
• Système de resource
• Tirage aléatoire de cartes d’un deck
Pourquoi coder ?
• Répondre à des questions « simples »
• Combien de terrains jouer à Magic ?
• Comment tuer le plus vite avec un deck agressif ?
• Y répondre analytiquement
• HYPGEOMDIST(succès attendus; nombre de tirages; nombre de
succès; taille de la population)
• Calcul : avoir 2+ terrains en main plus de 90% du temps
• Jouer 26 terrains sur 60 cartes
• Contraire à l’expérience
Pourquoi coder ?
• Les décisions de jeu commencent très tôt
• Mulligan
• Objectifs (X terrains) atteints plus facilement
• À Magic : chaque mulligan a une carte de moins
• À Hearthstone : on peut mulligan une fois quelques cartes
• Influence forte et compliquée à représenter
• Modélisation informatique puis simulation !
• Inspiration : Frank Karsten sur channelfireball.com
Exemple 1 : terrains à Magic
• Deck agressif
• Majorité de cartes à 1 et 2 manas
• Veut absolument son deuxième terrain pour le « tempo »
• Question : combien de terrains jouer au minimum ?
• Règle de Mulligan
• Mulligan toutes les mains avec 0, 1, 5, 6, 7 terrains si on a 7 cartes,
0, 5, 6 sinon
Exemple 1 : terrains à Magic
• Code :
• Création d’un objet Deck pour simuler le tas de cartes
• Un champ pour représenter les types de cartes (dans notre cas, on a
terrain et non-terrain : 2 types)
• Création d’un objet Hand pour simuler la main du joueur
• Défini en abstract la fonction Boolean mulliganCheck() qui dépend de
notre problème
• Simulation de 100.000 mains pour chaque quantité de terrains (de
10 à 30)
• Combien de mains correspondent à notre contrainte (2 terrains) ?
• À partir de quelle quantité a-t-on 90% de chance de réussite ?
Exemple 1 : terrains à Magic
• Résultats :
• Il nous faut au grand minimum 19 terrains. Avec nos règles, on
mulligan X% des mains
• Si l’on change notre contrainte à 3 terrains (avec des règles
adaptées), on se retrouve à « devoir » en jouer 29 !
• Définition des besoins = cruciale
Exemple 2 : le meilleur deck aggro
• Faisons un deck à Magic dont le but est de tuer le plus
efficacement possible sans adversaire (goldfish)
Exemple 2 : le meilleur deck aggro
• Différences :
• Structure de tour
• Logique de jeu
• 5 classes de cartes
• Méthode :
• Jouer 100.000 parties avec chaque configuration possible
• Regarder à quel tour moyen l’on gagne
• Affinement en étudiant notre premier résultat et ses variations
Exemple 2 : le meilleur deck aggro
• Notre deck « parfait » contient :
• 16 créatures à 1 mana
• 11 créatures à 2 manas
• 13 sorts de dégâts directs
• 20 terrains
• cohérent avec notre première simulation !
• Article complet :
• http://www.channelfireball.com/articles/frank-analysis-finding-the-
optimal-aggro-deck-via-computer-simulation/
• S’en sert pour en retirer une règle de mulligan
• Regarde le kill moyen de la main (grâce à l’expérience)
• S’il est plus lent qu’une main avec X-1 cartes : mulligan
Conclusion
• On peut analyser des systèmes « inhabituels » avec un
peu de code et beaucoup de suppositions
• Il faut poser les bonnes questions, et comprendre ce que
signifie les réponses
• La vérité est ailleurs
• Guidelines != règles
• On peut aller beaucoup plus loin !
• Algorithmes évolutionnistes pour Starcraft 2 et les bases de mana
à Magic
• Là où l’énumération n’est pas envisageable
• Implémenter les algos avec des vraies cartes et règles de jeu
QUESTIONS ?
@TolkiCasts
Tolkicasts.com
fb.com/tolkicasts

Contenu connexe

En vedette

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...Palo Alto Software
 

En vedette (20)

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
 

Gagner aux TCG grâce à l'informatique

  • 1. GAGNER AUX TCG GRÂCE À L’INFORMATIQUE Hearthstone, Magic, et autres Yu-gi-oh! : que peut-on résoudre avec du code Gary « Tolki » Mialaret
  • 2. Introduction • Qui suis-je ? • Ex consultant chez Octo Technology • Actuellement Associate Producer chez Ubisoft • Auteur pour Wizards of the Coast • Commentateur de tournois eSports et youtubeur • Magic, LoL, Starcraft 2 • Contenu régulier sur ogaming.tv de 2012 à 2014 • Blogueur débutant (tolkicasts.com)
  • 3. TCG ? • Trading Cards Game • Regroupe en vrai tous les jeux de cartes • Hearthstone (pas de trade) • Netrunner (distribution non aléatoire des cartes) • Point commun • Structure de tour • Système de resource • Tirage aléatoire de cartes d’un deck
  • 4. Pourquoi coder ? • Répondre à des questions « simples » • Combien de terrains jouer à Magic ? • Comment tuer le plus vite avec un deck agressif ? • Y répondre analytiquement • HYPGEOMDIST(succès attendus; nombre de tirages; nombre de succès; taille de la population) • Calcul : avoir 2+ terrains en main plus de 90% du temps • Jouer 26 terrains sur 60 cartes • Contraire à l’expérience
  • 5. Pourquoi coder ? • Les décisions de jeu commencent très tôt • Mulligan • Objectifs (X terrains) atteints plus facilement • À Magic : chaque mulligan a une carte de moins • À Hearthstone : on peut mulligan une fois quelques cartes • Influence forte et compliquée à représenter • Modélisation informatique puis simulation ! • Inspiration : Frank Karsten sur channelfireball.com
  • 6. Exemple 1 : terrains à Magic • Deck agressif • Majorité de cartes à 1 et 2 manas • Veut absolument son deuxième terrain pour le « tempo » • Question : combien de terrains jouer au minimum ? • Règle de Mulligan • Mulligan toutes les mains avec 0, 1, 5, 6, 7 terrains si on a 7 cartes, 0, 5, 6 sinon
  • 7. Exemple 1 : terrains à Magic • Code : • Création d’un objet Deck pour simuler le tas de cartes • Un champ pour représenter les types de cartes (dans notre cas, on a terrain et non-terrain : 2 types) • Création d’un objet Hand pour simuler la main du joueur • Défini en abstract la fonction Boolean mulliganCheck() qui dépend de notre problème • Simulation de 100.000 mains pour chaque quantité de terrains (de 10 à 30) • Combien de mains correspondent à notre contrainte (2 terrains) ? • À partir de quelle quantité a-t-on 90% de chance de réussite ?
  • 8. Exemple 1 : terrains à Magic • Résultats : • Il nous faut au grand minimum 19 terrains. Avec nos règles, on mulligan X% des mains • Si l’on change notre contrainte à 3 terrains (avec des règles adaptées), on se retrouve à « devoir » en jouer 29 ! • Définition des besoins = cruciale
  • 9. Exemple 2 : le meilleur deck aggro • Faisons un deck à Magic dont le but est de tuer le plus efficacement possible sans adversaire (goldfish)
  • 10. Exemple 2 : le meilleur deck aggro • Différences : • Structure de tour • Logique de jeu • 5 classes de cartes • Méthode : • Jouer 100.000 parties avec chaque configuration possible • Regarder à quel tour moyen l’on gagne • Affinement en étudiant notre premier résultat et ses variations
  • 11. Exemple 2 : le meilleur deck aggro • Notre deck « parfait » contient : • 16 créatures à 1 mana • 11 créatures à 2 manas • 13 sorts de dégâts directs • 20 terrains • cohérent avec notre première simulation ! • Article complet : • http://www.channelfireball.com/articles/frank-analysis-finding-the- optimal-aggro-deck-via-computer-simulation/ • S’en sert pour en retirer une règle de mulligan • Regarde le kill moyen de la main (grâce à l’expérience) • S’il est plus lent qu’une main avec X-1 cartes : mulligan
  • 12. Conclusion • On peut analyser des systèmes « inhabituels » avec un peu de code et beaucoup de suppositions • Il faut poser les bonnes questions, et comprendre ce que signifie les réponses • La vérité est ailleurs • Guidelines != règles • On peut aller beaucoup plus loin ! • Algorithmes évolutionnistes pour Starcraft 2 et les bases de mana à Magic • Là où l’énumération n’est pas envisageable • Implémenter les algos avec des vraies cartes et règles de jeu

Notes de l'éditeur

  1. « En 2013, j’ai eu accès à la béta d’Hearthstone, et comme toute personne censée, je me suis remis à Magic »