Reinforcement learning (RL) is a type of machine learning where an agent learns to make decisions by interacting with an environment in order to maximize cumulative rewards. The agent takes actions, observes the outcomes, and adjusts its behavior based on rewards or penalties received.

image.png

This is the workflow of Deep Reinforcement Learning, basically, it still uses RL workflow, but we are using Neural Networks instead of tables.

The more details about the workflow will be discussed at the end of this pages, but for now we’ll continue on how to use NeuralNet DRL.

Running a Deep RL Component

First of all, add this component to a game object. Add Component> NeuralNet Pro > DeepRL Component

image.png

after it’s attached, you need to setup the hyperparameter, you can read this article about hyperparameters

Hyperparameter General

Hyperparameter Deep Reinforcement Learning

Assumed you’ve done configuring the hyperparameter, you need to setup the code now.

First of all, we need to define the environment, in this example, I’ll use a balancing ball example

image.png

In this script, we will spawn a ball, in a random position and a random start velocity.

Now we create a agent class that will balance the ball. Create a class for the agent, inherit from the RLAgent class.