Hi,
I’m practicing to implement my own environment with Farama Gymnasium and PyGame,
the source code is available here.
I implemented physics and a policy gradient method from the lesson: Hands on - Hugging Face Deep RL Course
The same code is capable of solving a cart pole problem.
But I’m struggling with making an agent to move a racket to catch a ball.
The environment:
- a ball is thrown from left to right with some initial velocity
- on the right side of the game field there is a racket that can move up or down
- the reward is assigned when the ball hits the opposite side of the field. +10 if it hits the racket, -10 if it misses
I’m using a network with one hidden layer.
After the training, the platform either goes up or to the bottom and stays there.
My idea was that it learns the concept of gravity and a parabolic curve, or at least tries to follow the Y-coordinate of the ball,
but that doesn’t happen.
Do you have any hints on how to tune my parameters or reward function?
Any help is appreciated.