Asynchronous Actor-Critic Agents (A3C) for a fake game
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
players
README.md
__init__.py
characters.py
engine.py
env.py
main.py
run.py
utils.py

README.md

Asynchronous Actor-Critic Agents (A3C) For A Fake Game

Introduction & Disclaimer

This is a sample training framework of applying Asynchronous Actor-Critic Agents (A3C) to a fake game.

Originally it is used in a real game research in Rayark Inc., Taiwan.

However, due to the confidential issue, engine and numerical parameters cannot be provided.

Instead, a fake engine and fake parameters are provided.

Usage

How to run the code

Simply execute run.py.

In run.py, you can change some flags and arguments.

Note that if you are training the model by Asynchronous Actor-Critic Agents (A3C) algorithm, remember to switch to CPU-version tensorflow.

Flags

  • [--train]: Train mode.
  • [--A3C_train]: Train by Asynchronous Actor-Critic Agents (A3C) algorithm.
  • [--test]: Test mode. Play games and record the results.
  • [--record]: Record mode. Play games and record some of the games as well as their results.
  • [--verbose]: Display information during running or not.

Note that one of the flags among [--train], [--A3C_train], [--test] and [--record] must be assigned.

Args

  • [--main_player]: Your main player. (Default: 'RL_player')
  • [--other_players]: Other players. (Default: 'random_player')
  • [--game_prob]: Probability of choosing each "other players." (Default: uniform distribution)
  • [--num_games]: Number of games. (Default: 100)
  • [--output]: Name of the result output file. (Default: None)
  • [--job-dir]: This argument is used by GCP.

How To Add a New Player

  1. Create a directory for your player.

  2. Create a file named player.py in the directory.

  3. Make sure there is a class named Player which inherits an abstract class AbstractPlayer from player.

  4. Implement functions in AbstractPlayer correctly. For details of functions in AbstractPlayer, please refer to player.py.

  5. That's it! Now your player can join in the game!