SlideShare a Scribd company logo
Term paper presentation, Artificial Intelligence class, 2009




  Development of an Artificial Player
       for Connect-(4|n) game
                    Alessandro Manfredi
                          256479
The Connect-(4|n) game
• Implementation of game dynamics with
  dynamic board size and required connections
  for the game to be won.

• Different playing modes
  • Human vs Human
  • Human vs AI
  • Simulations: AI vs AI
        (Useful to obtain wide range of moves computed by
        the algorithm as possible input for an automatic
        learning tool, or just to cache precomputed moves)
Mini-Max Algorithm

• Implementations in PHP and Java
• Game dynamics are implemented as a PHP script
• An external Java jar is used to compute moves
  • Chance to train or precompute moves outside
    the actual game simulations (?)
connectMinimax usage

$ java -jar connectMinimax.jar
    <rows> <columns> <connections> <depth-limit>
           <heuristic-exp> <board-dump> <player>

   <rows>            # Board rows
   <columns>         # Board columns
   <connections>     # Required connections to win
   <depth-limit>     tree depth limit
   <heuristic-exp>   Heuristic exponent
   <board-dump>      Game state representation
   <player>          Player for which compute the move
Mini-Max for non-perfect decisions
 • Need an heuristic
 • Evaluation of game state or evaluation of possible
   further moves?

 • Incremental evaluation: estimate value of chances
   opened by a move

   • NB: a winning move has an infinite (positive)
      evaluation

   • NB: moves which bring to (even slightly) better
      game states must have a relevant surplus of
      evaluation
Moves’ Heuristic
• Consider the 4 dimensions
  separately

• For each, consider any
  window including the move

• For each window available to
  be completed, sum player’s
  pieces raised to the
  parametric heuristic exponent

• The evaluation of a move is
  the sum of all these
  components
Improvements

• Raise tree depth
    • Better results, longer time to wait for each
       non-precomputed move :(

• Max depth can be increased as the game moves on
  (less possibilities to compute)

    • Time to wait almost not affected
• Alfa-Beta Pruning
Results and future dev.
• AI beats Human in 60-65% of cases.
 • NB: Initial player is pseudo-random

• Time-to-wait is still too long: 17-19 sec.
• How about a machine learning tool trained with
  the move computation component?

 • A classifier ( Decision-Tree ?)
 • Neural network ( Multilayer perceptron with
    backpropagation ?)

More Related Content

PDF
NVIDIA GeForce RTX Launch Event
PPTX
Player Traversal Mechanics in the Vast World of Horizon Zero Dawn
PDF
【Unity道場】新しいPrefabワークフロー入門
PPTX
Bit flipping attack on aes cbc - ashutosh ahelleya
PDF
Unity道場08「絵づくりの基礎」ライティング虎の巻
PPTX
[Mmlab seminar 2016] deep learning for human pose estimation
PDF
トラブルから理解するHyper vの基礎
PPTX
Putting the AI Back Into Air: Navigating the Air Space of Horizon Zero Dawn
NVIDIA GeForce RTX Launch Event
Player Traversal Mechanics in the Vast World of Horizon Zero Dawn
【Unity道場】新しいPrefabワークフロー入門
Bit flipping attack on aes cbc - ashutosh ahelleya
Unity道場08「絵づくりの基礎」ライティング虎の巻
[Mmlab seminar 2016] deep learning for human pose estimation
トラブルから理解するHyper vの基礎
Putting the AI Back Into Air: Navigating the Air Space of Horizon Zero Dawn

What's hot (20)

PDF
リアルタイムコマンドバトルのゲームで PlayFab を使ってみた
PDF
Scalability for All: Unreal Engine* 4 with Intel
PDF
【Unity道場】初心者のためのゲームジャムの心得
PDF
Unreal Open Day 2017 UE4 for Mobile: The Future of High Quality Mobile Games
PPTX
Horizon Zero Dawn: A Game Design Post-Mortem
PDF
2022 COMP4010 Lecture4: AR Interaction
PDF
Yolo v2 ai_tech_20190421
PDF
2022 COMP4010 Lecture 6: Designing AR Systems
PDF
Halo2 におけるHFSM(階層型有限状態マシン) 【ビヘイビアツリー解説】
PDF
alphorm.com - Formation Linux LPIC-1/Comptia Linux+
PPTX
Software Engineering- Engineering Practice
PPTX
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
PDF
COMP 4010 Lecture3: Human Perception
PDF
COMP 4010: Lecture 4 - 3D User Interfaces for VR
PDF
Mobilenetv1 v2 slide
PPTX
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
PDF
COMP 4010: Lecture2 VR Technology
PPTX
mssao presentation
PDF
2022 COMP4010 Lecture3: AR Technology
PDF
Visual Studio 拡張機能の作り方
リアルタイムコマンドバトルのゲームで PlayFab を使ってみた
Scalability for All: Unreal Engine* 4 with Intel
【Unity道場】初心者のためのゲームジャムの心得
Unreal Open Day 2017 UE4 for Mobile: The Future of High Quality Mobile Games
Horizon Zero Dawn: A Game Design Post-Mortem
2022 COMP4010 Lecture4: AR Interaction
Yolo v2 ai_tech_20190421
2022 COMP4010 Lecture 6: Designing AR Systems
Halo2 におけるHFSM(階層型有限状態マシン) 【ビヘイビアツリー解説】
alphorm.com - Formation Linux LPIC-1/Comptia Linux+
Software Engineering- Engineering Practice
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
COMP 4010 Lecture3: Human Perception
COMP 4010: Lecture 4 - 3D User Interfaces for VR
Mobilenetv1 v2 slide
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
COMP 4010: Lecture2 VR Technology
mssao presentation
2022 COMP4010 Lecture3: AR Technology
Visual Studio 拡張機能の作り方
Ad

Similar to Connect (4|n) (20)

PPTX
Supersize your production pipe enjmin 2013 v1.1 hd
PPTX
Gdc gameplay replication in acu with videos
PPTX
Maximize Your Production Effort (English)
PDF
De Re PlayStation Vita
PDF
Supersize Your Production Pipe
PDF
Chess Engine
PDF
J-Fall 2017 - AI Self-learning Game Playing
PDF
This was a triumph: Evolving intelligent bots for videogames. And for Science.
PDF
Understanding and improving games through machine learning - Natasha Latysheva
PDF
Ibm's deep blue chess grandmaster chips
PPTX
98 374 Lesson 04-slides
PPTX
Behind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
PDF
Videogame Optimization
PDF
ARISE
KEY
Easter presentation
PDF
Creating Casual Games for Windows 8
PDF
Lecture 02: Layered Architecture of Game Engine | GAMES104 - Modern Game Engi...
PPTX
Game engines and Their Influence in Game Design
PDF
Designing a pragmatic back-end service for mobile games
PDF
Unreal Ahmedabad Meetup Hosted by 300Minds.pdf
Supersize your production pipe enjmin 2013 v1.1 hd
Gdc gameplay replication in acu with videos
Maximize Your Production Effort (English)
De Re PlayStation Vita
Supersize Your Production Pipe
Chess Engine
J-Fall 2017 - AI Self-learning Game Playing
This was a triumph: Evolving intelligent bots for videogames. And for Science.
Understanding and improving games through machine learning - Natasha Latysheva
Ibm's deep blue chess grandmaster chips
98 374 Lesson 04-slides
Behind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
Videogame Optimization
ARISE
Easter presentation
Creating Casual Games for Windows 8
Lecture 02: Layered Architecture of Game Engine | GAMES104 - Modern Game Engi...
Game engines and Their Influence in Game Design
Designing a pragmatic back-end service for mobile games
Unreal Ahmedabad Meetup Hosted by 300Minds.pdf
Ad

More from Alessandro Manfredi (9)

PDF
Hey Cloud, it’s the user calling, he says he wants the security back
KEY
WhyMCA HappyHour - EUHackathon Part II
PDF
LUG - Ricompilazione kernel
PDF
LUG - Logical volumes management
PDF
LUG - Install Fest 2008
KEY
Find me a roof!
KEY
Advanced Shell Scripting
KEY
ExAlg Overview
PDF
The "vi" Text Editor
Hey Cloud, it’s the user calling, he says he wants the security back
WhyMCA HappyHour - EUHackathon Part II
LUG - Ricompilazione kernel
LUG - Logical volumes management
LUG - Install Fest 2008
Find me a roof!
Advanced Shell Scripting
ExAlg Overview
The "vi" Text Editor

Recently uploaded (20)

PDF
project resource management chapter-09.pdf
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
The various Industrial Revolutions .pptx
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPT
What is a Computer? Input Devices /output devices
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Architecture types and enterprise applications.pdf
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
A novel scalable deep ensemble learning framework for big data classification...
project resource management chapter-09.pdf
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
A comparative study of natural language inference in Swahili using monolingua...
The various Industrial Revolutions .pptx
O2C Customer Invoices to Receipt V15A.pptx
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Web App vs Mobile App What Should You Build First.pdf
Hindi spoken digit analysis for native and non-native speakers
OMC Textile Division Presentation 2021.pptx
Assigned Numbers - 2025 - Bluetooth® Document
What is a Computer? Input Devices /output devices
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Getting Started with Data Integration: FME Form 101
Final SEM Unit 1 for mit wpu at pune .pptx
cloud_computing_Infrastucture_as_cloud_p
Architecture types and enterprise applications.pdf
NewMind AI Weekly Chronicles – August ’25 Week III
A novel scalable deep ensemble learning framework for big data classification...

Connect (4|n)

  • 1. Term paper presentation, Artificial Intelligence class, 2009 Development of an Artificial Player for Connect-(4|n) game Alessandro Manfredi 256479
  • 2. The Connect-(4|n) game • Implementation of game dynamics with dynamic board size and required connections for the game to be won. • Different playing modes • Human vs Human • Human vs AI • Simulations: AI vs AI (Useful to obtain wide range of moves computed by the algorithm as possible input for an automatic learning tool, or just to cache precomputed moves)
  • 3. Mini-Max Algorithm • Implementations in PHP and Java • Game dynamics are implemented as a PHP script • An external Java jar is used to compute moves • Chance to train or precompute moves outside the actual game simulations (?)
  • 4. connectMinimax usage $ java -jar connectMinimax.jar <rows> <columns> <connections> <depth-limit> <heuristic-exp> <board-dump> <player> <rows> # Board rows <columns> # Board columns <connections> # Required connections to win <depth-limit> tree depth limit <heuristic-exp> Heuristic exponent <board-dump> Game state representation <player> Player for which compute the move
  • 5. Mini-Max for non-perfect decisions • Need an heuristic • Evaluation of game state or evaluation of possible further moves? • Incremental evaluation: estimate value of chances opened by a move • NB: a winning move has an infinite (positive) evaluation • NB: moves which bring to (even slightly) better game states must have a relevant surplus of evaluation
  • 6. Moves’ Heuristic • Consider the 4 dimensions separately • For each, consider any window including the move • For each window available to be completed, sum player’s pieces raised to the parametric heuristic exponent • The evaluation of a move is the sum of all these components
  • 7. Improvements • Raise tree depth • Better results, longer time to wait for each non-precomputed move :( • Max depth can be increased as the game moves on (less possibilities to compute) • Time to wait almost not affected • Alfa-Beta Pruning
  • 8. Results and future dev. • AI beats Human in 60-65% of cases. • NB: Initial player is pseudo-random • Time-to-wait is still too long: 17-19 sec. • How about a machine learning tool trained with the move computation component? • A classifier ( Decision-Tree ?) • Neural network ( Multilayer perceptron with backpropagation ?)