Embedding intelligence into games using Reinforcement Learning

1 0
  • 0 Collaborators

The project discusses how to build intelligent games, which can alter gameplay and environment in real-time to provide captivating game experience to players using reinforcement learning ...learn more

Project status: Under Development

Artificial Intelligence

Code Samples [1]Links [1]

Overview / Usage

The hot topic in today's market is to build intelligent games which are capable of changing story-line and gameplay in real-time, to provide captivating experience to the gamers. Such games can make the gameplay more challenging and captivate the player's interest.

The project focuses on building such games using state of the art deep learning techniques. The project tracks the game environment in real-time, recording the game's environment and makes a prediction to make the game more interesting.

Methodology / Approach

The project uses Open AI's game agent 'Cart-Pole v0' as a game agent and tries to reach the goal of balancing a pole on a cart.

Game rules:

The goal of the game is to balance a freely moving pole on a cart. The player loses the game if the poll falls more than +15 or -15 degrees from its initial position. To player can balance the pole by moving the cart to left or right.

Approach:

To train a neural network, a significant amount of data is needed. The first step of the AI is to generate the training data. For this, the game is run randomly for up to 10,000 episodes, recording the information like velocity at its tip, the velocity of the cart, angle etc. are collected along with the actions(0 or 1) from the environment.

Once the data is collected, the second step is to design a neural network which works using the reinforcement learning and to train on the data.

The model is designed with 5 hidden layers with 128, 256, 512, 256 and 128 nodes in hidden layers and an input layer and an output layer. Once the required data is collected, the next step is to use the data and train the network.

The final step is to use real-time game data and predict an action. The action predicted is then performed in the game. and the process is continued till the game's goal is met or till it fails.

Frameworks used:

The AI is developed using the Open gym framework which provides game environments and also several game agents. The model is developed using 'tflearn' framework (a tensorflow based deep learning library).

Technologies Used

Lets lay out the tools used for this project.

IDE to design and develop the AI:

IntelliJ PyCharm

Frameworks and Libraries:

Numpy, Scipy, Tensorflow-gpu, Tflearn and Anaconda distribution as package manager.

OS:

Ubuntu 17.04 LTS

Hardware used:

The project is not very resource consuming at this stage. So, Nvidia GEFORCE GTX 950 is sufficient to execute the project. In the future versions, there is highly likely that a better GPU is needed.

Repository

https://github.com/sudheerExperiments/CartPole-v0_AI

Comments (0)