Giter VIP home page Giter VIP logo

fightingai's Introduction

FightingAI

Note: including code for both training and testing!

AI Solutions for Fighting Game Based on Traditional Reinforcement Learning Algorithms

Two traditional reinforcement algorithms Q-learning and Monte Carlo

Introduction of Fighting Game AI Competition:http://www.ice.ci.ritsumei.ac.jp/~ftgaic/index.htm

[Paper] [DemoVideo] [Project Page]

Contents

  1. Environment Setup
  2. Code structure

Environment setup

This code has been tested on Window 10, Python 3.7

  • Clone the repository
git clone https://github.com/TongRu/FightingAI.git
  • Install OpenJDK (java environment)

    1. Download the installation package for window from https://jdk.java.net/14/

    2. Unzip it to a fixed path, such as D:\jdk-14.0.1

    3. Add java program to system path: Right-click to open My Computer → Properties → Advanced System Settings → open the environment variables → edit and create a new path "D:\jdk-14.0.1\bin" in the user variable -Path

    4. whether java is successfully installed: open the cmd command window and enter “java -version” to display java information.

    if you apply the code in in Linux, please directly execute the following instructions to install OpenJDK

    $ sudo apt-get install openjdk-8-jre
    
  • Setup python environment

conda create -n FightingAI python
source activate FightingAI
pip install gym
pip install py4j
pip install port_for
pip install opencv-python

Code-structure

.\fightingice_env.py: starting code of the Fighting Game Platform;

.\data\ai\MctsAi.jar: Opponent bot based on java env;

.\train-MC.py: code for training traditional Q-learning algorithm;

.\train-QLearning.py: code for training traditional MC algorithm;

.\train-ImprovedQL.py: code for training improved Q-learning algorithm;

.\test-MC.py: code for testing traditional Q-learning algorithm;

.\test-QLearning.py: code for testing traditional MC algorithm;

.\test-ImprovedQL.py: code for testing improved Q-learning algorithm.

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.