0

I am trying to learn how to build an AI model with a ROM game. The issue is that the environment doesn't start. I get no errors with the code below but also I get no game-playing :-)

Here is what I have done

  1. I have imported the rom using the instructions provided here (no errors)
  2. I am running the code with the latest python and Jupyter Lab
  3. I wanted to use this, but since the article was written, so I started from scratch with the code below
  4. I am not clear if I should use Gym or Gymnasium package, which seems to have replaced Gym
  5. I managed to make it run (with a different code snippet) but then I couldn't control the game like done here.
import gym
    
from ale_py import ALEInterface
ale = ALEInterface()
    
from ale_py.roms import KungFuMaster
ale.loadROM(KungFuMaster)
    
env = gym.make('ALE/KungFuMaster-v5',
               obs_type='rgb',  # ram | rgb | grayscale
               frameskip=4,  # frame skip
               mode=None,  # game mode
               difficulty=None,  # game difficulty
               repeat_action_probability=0.25, # Sticky action probability
               full_action_space=False,  # Use all actions
               render_mode="human"  # None | human | rgb_array
           )
    
env.close()

amok
  • 1,736
  • 4
  • 20
  • 41

0 Answers0