Skip to content Skip to sidebar Skip to footer

Pygame And Open Ai Implementation

Me and my classmate have decided to try and implement and AI agent into our own game. My friend have done most of the code, based on previous projects, and I was wondering how PyGa

Solution 1:

PyGame and OpenAI-Gym work together fine. I can't comment on the game code you posted, that's up to you really. If the game works it works.

But to create an AI agent with PyGame you need to first convert your environment into a Gym environment. This can be done by following this guide.

Afterwards you can use an RL library to implement your agent. My recommendation is Stable-Baselines which is a great fork off of openai-baselines that's a lot easier to work with.

If you want something as reference for your assignment maybe check out this little project I did a while ago. I created a rendition of the BlockDude game and converted it to OpenAI Gym. I then used stable-baselines on it in this colab notebook.

Post a Comment for "Pygame And Open Ai Implementation"