nadavbh12 / Retro-Learning-Environment

The Retro Learning Environment (RLE) -- a learning framework for AI
Other
184 stars 40 forks source link

SDL interface not displaying game screen with display_screen set to True #20

Closed piquirez closed 7 years ago

piquirez commented 7 years ago

Hi I get the following output which includes the score outputs from the game, but although display_screen and USE_SDL are set to true no game screen is returned

tim:~/Downloads/Retro-Learning-Environment/doc/examples$ python python_example.py ../../roms/classic_kong.smc snes ../../snes9x2010/snes9x2010_libretro.so R.L.E: Retro Learning Environment (version 1.1.1) [Based upon the Arcade Learning Environment (A.L.E)] [Powered by LibRetro] Use -help for help screen. [inf] Frontend supports RGB565 - will use that instead of XRGB1555. Sound buffer size: 128000 (32000 samples) Core loaded [inf] No ROM file header found. Map_LoROMMap PPU.RenderSub = 1 PPU.FullClipping = 1 Settings.Transparency = 1 Settings.SpeedhackGameID = 0 PPU.SFXSpeedupHack = 0 coldata_update_screen = 1 [inf] "Classic Kong Complete0" [checksum ok] LoROM, 2Mbits, ROM, NTSC, SRAM:0Kbits, ID:SNES, CRC32:8FA368BE Running ROM file... Random seed is 123 Episode 0 ended with score: 1600 Episode 1 ended with score: 300 Episode 2 ended with score: 400 Episode 3 ended with score: 300 Episode 4 ended with score: 200 Episode 5 ended with score: 400 Episode 6 ended with score: 300 Episode 7 ended with score: 2100 Episode 8 ended with score: 200 Episode 9 ended with score: 300

nadavbh12 commented 7 years ago

Try verifying that SDL is indeed on by adding a print into an SDL ifdef. Have you installed all SDL dependencies?

piquirez commented 7 years ago

Hi, many thanks for your reply. We've been trying to make the screen display work without success. Here is the steps we've followed:

  1. Using Virtual Box to install a fresh Ubuntu 16.04 (64-bit)

  2. Ran sudo apt-get install git

  3. Ran git clone https://github.com/nadavbh12/Retro-Learning-Environment

  4. Ran sudo apt-get install libsdl1.2-dev libsdl-gfx1.2-dev libsdl-image1.2-dev cmake

  5. Ran the below as per instructions

mkdir build && cd build cmake -DUSE_SDL=ON -DBUILD_EXAMPLES=ON .. make -j 4 pip install rle-python-interface

  1. Modified doc/examples/python_example.py line 24 (this was an undocumented step in the instructions): USE_SDL = False to.. USE_SDL = True

  2. Ran doc/examples/python python_example.py ../../roms/classic_kong.smc snes The game played but was only outputting the score to the console.

  3. Just to make sure we were doing it correctly, we also tried installing https://github.com/mgbellemare/Arcade-Learning-Environment

  4. We followed the instructions, repeated step 6 above (USE_SDL = True) and then ran doc/examples/python_example.py roms/space_invaders.bin It ran perfectly and did display the game to X windows

  5. We then thought it might be Donkey Kong, so we ran the following in RLE:

doc/examples/python_example.py roms/space_invaders.bin atari

However it said:

R.L.E: Retro Learning Environment (version 1.1.1) [Based upon the Arcade Learning Environment (A.L.E)] [Powered by LibRetro] Use -help for help screen. Core loaded Running ROM file... Random seed is 123 ERROR: ../../roms/space_invaders.bin ROM file name is invalid. Rename the ROM so it is underscore separated. For example: super_mario_world.sfc

Any thoughts? Your help would be greatly appreciated. We can now get started with the ALE but it would be great if we could test our AI on some SNES games. Kind regards, Felipe

nadavbh12 commented 7 years ago

The problem is that you're installing RLE from pypi rather than from your local repository.

If you wish to work with Python and view the screen with SDL, you should edit setup.py and add the USE_SDL=ON flag, then run pip install . without the make steps.

Another, probably better, option is to use a Python image viewer or use the gym-rle repository which we recently finished creating.