Reinforcement Learning - How to teach an agent to play my game?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By TheR2D2

I love video games and always wanted to make games. So I got started with Godot and I’m loving it. I am also trying to get my hands dirty in Reinforcement learning so I thought it would be a good idea to make a small 2d level and teach an agent to play the level.

I’ve created the level now but I don’t know how to train an agent to play the game. In other words; how to convert the level to a reinforcement learning problem. If you have tried this before or have an idea, just a high level one, please help me out. Thank you for reading this post!

what do you mean “teach an agent to play the game.” Is the agent the player, or a bot?

Millard | 2020-05-09 16:30

Why not both? An agent is a simulated player learning how to play the game.

A112Studio | 2020-05-09 17:39

:bust_in_silhouette: Reply From: A112Studio

Maybe the reward should depend on proximity to the level goal? The closer the agent gets, the higher the reward.

Thank you for your reply! Yes, ideally that should be my reward and I should punish the agent for staying long in the level. But how do I train my agent to play the game? I mean how or where do I plug my agent to play the game? I just know the concept of Reinforcement learning but have no idea how to implement it in this scenario. Your inputs would be much appreciated!

TheR2D2 | 2020-05-11 18:40