Farama-Foundation / Procgen2

Fast and procedurally generated side-scroller-game-like graphical environments (formerly Procgen)
MIT License
28 stars 6 forks source link

how do we install this and is it compatible yet with gymnasium? #13

Closed davidireland3 closed 1 year ago

222464 commented 1 year ago

Hi, it is compatible with Gymnasium, but ProcGen2 is still under development. Currently there are 7 games implemented (as of 8/31/23). If you would like to try them at this stage, you can do so by compiling all the games by navigating to the root directory of the project and running:

mkdir build
cd build
cmake ..
make

For Linux. If on Windows, it's easiest to use the CMake-GUI.

You can then try the games as shown in game_test.py. This will all be made nicer in the future, with a pypi package. For now you need to create a CEnv and point it at a shared object for a game (which the previous commands will have built).

KzZheng commented 7 months ago

Games require SDL3, but libsdl-org hasn't released the stable version of SDL3 yet. Should we use the development version?

222464 commented 7 months ago

Games require SDL3, but libsdl-org hasn't released the stable version of SDL3 yet. Should we use the development version?

Yes, it should work with the latest development version: github link

bhatiaabhinav commented 7 months ago

@222464, I Installed both SDL3 and SDL3_image using command sudo cmake -S . -B build && sudo cmake --build build && sudo cmake --install build from the respective root directories.

Now, cmake.. works successfully in the build folder, as per your instructions. But make leads to error:

[  1%] Building CXX object games/coinrun/CMakeFiles/CoinRun.dir/coinrun.cpp.o
In file included from /home/abhinav/workspace/Procgen2/games/coinrun/common_assets.h:5,
                 from /home/abhinav/workspace/Procgen2/games/coinrun/common_components.h:4,
                 from /home/abhinav/workspace/Procgen2/games/coinrun/tilemap.h:3,
                 from /home/abhinav/workspace/Procgen2/games/coinrun/coinrun.cpp:6:
/home/abhinav/workspace/Procgen2/games/coinrun/renderer.h:4:10: fatal error: SDL3/SDL_image.h: No such file or directory
    4 | #include <SDL3/SDL_image.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [games/coinrun/CMakeFiles/CoinRun.dir/build.make:76: games/coinrun/CMakeFiles/CoinRun.dir/coinrun.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:206: games/coinrun/CMakeFiles/CoinRun.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

How do I fix this?

bhatiaabhinav commented 7 months ago

@222464, Ok the error got resolved. I found that /usr/local/include/SDL3_image/SDL_image.h existed but /usr/local/include/SDL3/SDL_image.h did not. Doing sudo ln -s /usr/local/include/SDL3_image/SDL_image.h /usr/local/include/SDL3/SDL_image.h solved the problem.