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.
How to run the code
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.
[--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
[--record] must be assigned.
[--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
Create a directory for your player.
Create a file named
player.pyin the directory.
Make sure there is a class named
Playerwhich inherits an abstract class
Implement functions in AbstractPlayer correctly. For details of functions in AbstractPlayer, please refer to
That's it! Now your player can join in the game!