How to define observation space for flappy bird game using OpenAI Gymnasium

I’m new to ML and creating a reinforcement learning bot for my flappy bird game. I’m not sure how to define a proper observation space since the observation space will vary.

For my observation data I’m returning a tuple of all X-Y positions of each obstacle(see image).
However the amount of obstacles on screen can vary between 1-20. So the tuple I’m returning for my observation can vary in length. I’m not sure how I can implement that in my observation space.

The observation space I currently chose to use:

observation_space = gym.spaces.Box(-np.inf, np.inf,shape=(2,),dtype=np.float32)

But I’m pretty sure that wont help

Processing img hbe25a0synwc1…

submitted by /u/pubGGWP
[link] [comments]

Leave a Reply

The Future Is A.I. !
To top
en_USEnglish