Coder Social home page Coder Social logo

game-face2face-ai's Introduction

game-face2face-ai

An AI engine implemented in Java for playing a 2 person Card game The Game: Face to Face

Approach

The game uses UCT Based Monte Carlo Tree search (MCTS) approach to decide on the best moves (card placements) for each iteration.

Stages of MCTS approach:

  • Selection : From the root node, the child with best UCT value is chosen for exploration.
  • Expansion : Once the promising node is selected in the previous stage, it is expanded based on the custom rule based engine, which generates an list of possible child nodes corresponding to different possible moves.
  • Simulation : For each of the possible children generated in the previous stage, a game is simulated between the Rule engine based player vs Random player. And the result simulated game is noted.
  • Backpropagation : Based on the result obtained from the previous stage, the winscore and visit count is updated for each of nodes propagating until the parent node.

Running the game

Please clone the repository and build it using maven clean package. Add the jar game-face2face-ai.jar and the-game-f2f-engine.jar to the class paths and the Run the code using the below snippet as reference.

import de.upb.isml.thegamef2f.engine.board.Game;

import de.upb.isml.thegamef2f.engine.player.Player;

import de.upb.isml.thegamef2f.engine.player.RandomPlayer;

import de.upb.mlseminar.mymcts.montecarlo.*;

  1. Initialize the player A

    Player playerA = new InformedMonteCarloPlayer("playerA");

  2. Initialize the player B (In this case we are using Random Player as player B, but can be any of the other player)

    Player playerB = new RandomPlayer("playerB");

  3. Start the game simulation

     Game game = new Game(playerA, playerB,i);
     Player winner = game.simulate();
     game.getHistory().printHistory();
    

game-face2face-ai's People

Contributors

guruprasads7 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.