SlideShare a Scribd company logo
1 of 8
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

What's hot

54024405 project-report-banking-management-system
54024405 project-report-banking-management-system54024405 project-report-banking-management-system
54024405 project-report-banking-management-system
nancs
 

What's hot (20)

Student result management system
Student result management systemStudent result management system
Student result management system
 
Mini Project on Data Encryption & Decryption in JAVA
Mini Project on Data Encryption & Decryption in JAVAMini Project on Data Encryption & Decryption in JAVA
Mini Project on Data Encryption & Decryption in JAVA
 
Full report on blood bank management system
Full report on  blood bank management systemFull report on  blood bank management system
Full report on blood bank management system
 
Programming Languages used in AI
Programming Languages used in AIProgramming Languages used in AI
Programming Languages used in AI
 
srs for railway reservation system
 srs for railway reservation system srs for railway reservation system
srs for railway reservation system
 
Blood Bank Management System
Blood Bank Management SystemBlood Bank Management System
Blood Bank Management System
 
SRS on Online Blood Bank Managment system...
SRS on Online Blood Bank Managment system... SRS on Online Blood Bank Managment system...
SRS on Online Blood Bank Managment system...
 
java mini project for college students
java mini project for college students java mini project for college students
java mini project for college students
 
Hostel Management system Report
Hostel Management system ReportHostel Management system Report
Hostel Management system Report
 
SRS on blood bank
SRS on blood bankSRS on blood bank
SRS on blood bank
 
54024405 project-report-banking-management-system
54024405 project-report-banking-management-system54024405 project-report-banking-management-system
54024405 project-report-banking-management-system
 
Student Management System
Student Management System Student Management System
Student Management System
 
Student information system
Student information systemStudent information system
Student information system
 
E learning project report (Yashraj Nigam)
E learning project report (Yashraj Nigam)E learning project report (Yashraj Nigam)
E learning project report (Yashraj Nigam)
 
Online examination system
Online examination systemOnline examination system
Online examination system
 
Hotel management synopsis
Hotel management synopsisHotel management synopsis
Hotel management synopsis
 
Sign language recognizer
Sign language recognizerSign language recognizer
Sign language recognizer
 
Banking Management System Project
Banking Management System ProjectBanking Management System Project
Banking Management System Project
 
Banking Management System Project documentation
Banking Management System Project documentationBanking Management System Project documentation
Banking Management System Project documentation
 
Final ppt
Final pptFinal ppt
Final ppt
 

Similar to Connect (4|n)

Supersize your production pipe enjmin 2013 v1.1 hd
Supersize your production pipe    enjmin 2013 v1.1 hdSupersize your production pipe    enjmin 2013 v1.1 hd
Supersize your production pipe enjmin 2013 v1.1 hd
slantsixgames
 
Easter presentation
Easter presentationEaster presentation
Easter presentation
GertThijs
 
Game engines and Their Influence in Game Design
Game engines and Their Influence in Game DesignGame engines and Their Influence in Game Design
Game engines and Their Influence in Game Design
Prashant Warrier
 

Similar to Connect (4|n) (20)

Supersize your production pipe enjmin 2013 v1.1 hd
Supersize your production pipe    enjmin 2013 v1.1 hdSupersize your production pipe    enjmin 2013 v1.1 hd
Supersize your production pipe enjmin 2013 v1.1 hd
 
Gdc gameplay replication in acu with videos
Gdc   gameplay replication in acu with videosGdc   gameplay replication in acu with videos
Gdc gameplay replication in acu with videos
 
Maximize Your Production Effort (English)
Maximize Your Production Effort (English)Maximize Your Production Effort (English)
Maximize Your Production Effort (English)
 
De Re PlayStation Vita
De Re PlayStation VitaDe Re PlayStation Vita
De Re PlayStation Vita
 
Supersize Your Production Pipe
Supersize Your Production PipeSupersize Your Production Pipe
Supersize Your Production Pipe
 
Chess Engine
Chess EngineChess Engine
Chess Engine
 
J-Fall 2017 - AI Self-learning Game Playing
J-Fall 2017 - AI Self-learning Game PlayingJ-Fall 2017 - AI Self-learning Game Playing
J-Fall 2017 - AI Self-learning Game Playing
 
This was a triumph: Evolving intelligent bots for videogames. And for Science.
This was a triumph: Evolving intelligent bots for videogames. And for Science. This was a triumph: Evolving intelligent bots for videogames. And for Science.
This was a triumph: Evolving intelligent bots for videogames. And for Science.
 
Understanding and improving games through machine learning - Natasha Latysheva
Understanding and improving games through machine learning - Natasha LatyshevaUnderstanding and improving games through machine learning - Natasha Latysheva
Understanding and improving games through machine learning - Natasha Latysheva
 
Ibm's deep blue chess grandmaster chips
Ibm's deep blue chess grandmaster chipsIbm's deep blue chess grandmaster chips
Ibm's deep blue chess grandmaster chips
 
98 374 Lesson 04-slides
98 374 Lesson 04-slides98 374 Lesson 04-slides
98 374 Lesson 04-slides
 
Behind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
Behind the Scenes: Deploying a Low-Latency Multiplayer Game GloballyBehind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
Behind the Scenes: Deploying a Low-Latency Multiplayer Game Globally
 
Videogame Optimization
Videogame OptimizationVideogame Optimization
Videogame Optimization
 
ARISE
ARISEARISE
ARISE
 
Easter presentation
Easter presentationEaster presentation
Easter presentation
 
Creating Casual Games for Windows 8
Creating Casual Games for Windows 8Creating Casual Games for Windows 8
Creating Casual Games for Windows 8
 
Lecture 02: Layered Architecture of Game Engine | GAMES104 - Modern Game Engi...
Lecture 02: Layered Architecture of Game Engine | GAMES104 - Modern Game Engi...Lecture 02: Layered Architecture of Game Engine | GAMES104 - Modern Game Engi...
Lecture 02: Layered Architecture of Game Engine | GAMES104 - Modern Game Engi...
 
Game engines and Their Influence in Game Design
Game engines and Their Influence in Game DesignGame engines and Their Influence in Game Design
Game engines and Their Influence in Game Design
 
Designing a pragmatic back-end service for mobile games
Designing a pragmatic back-end service for mobile gamesDesigning a pragmatic back-end service for mobile games
Designing a pragmatic back-end service for mobile games
 
Long Lin at AI Frontiers : AI in Gaming
Long Lin at AI Frontiers : AI in GamingLong Lin at AI Frontiers : AI in Gaming
Long Lin at AI Frontiers : AI in Gaming
 

More from Alessandro Manfredi

LUG - Logical volumes management
LUG - Logical volumes managementLUG - Logical volumes management
LUG - Logical volumes management
Alessandro Manfredi
 

More from Alessandro Manfredi (9)

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

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

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 ?)