Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • dmath010/supersonicai
1 result
Show changes
Commits on Source (281)
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: ForContinuationAndIndentation
...
## Issue summary
[Put a detailed description of the issue here.]
## System information
- [Operating system]
- [Python version]
- [Gym Retro version]
\ No newline at end of file
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
*.dylib
*.dll
*.o
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# dotenv
.env
# virtualenv
venv/
ENV/
# Spyder project settings
.spyderproject
# Rope project settings
.ropeproject
# Emacs #
#########
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
.elc
auto-save-list
tramp
.\#*
# PyCharm
*.idea
.DS_Store
# CMake
CMakeFiles
CMakeCache.txt
CTestTestfile.cmake
/Makefile
cmake_*.cmake
install_manifest.txt
# CPack
_CPack_Packages
CPack*Config.cmake
*.dmg
*.tar.*
*.deb
*.rpm
# Build products
tests/test-*
lib*.a
*.app
*_autogen
*.capnp.*
retro/cores/*-version
retro/cores/*.json
retro/VERSION.txt
# Test stuff
Temporary
*.mkv
*.search
git:
depth: false
cache:
- ccache
- directories:
- $HOME/roms/
language: cpp # Needed for ccache
env:
- PYVER=3.6
- PYVER=3.7
- PYVER=3.8
os:
- linux
- osx
services:
- docker
osx_image: xcode9.4 # OS X 10.13
matrix:
include:
- os: linux
env:
- CROSS=win64
- PYVER=3.6
- os: linux
env:
- CROSS=win64
- PYVER=3.7
- os: linux
env:
- CROSS=win64
- PYVER=3.8
before_script:
- mkdir -p $HOME/roms
script:
- |
if [ -n "$CROSS" ]; then
TAG=$CROSS
else
TAG=$TRAVIS_OS_NAME
fi
TAG=${TAG}-v2
- >
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
docker run
--env PYVER="$PYVER"
--env CROSS="$CROSS"
--env TRAVIS_OS_NAME="$TRAVIS_OS_NAME"
--env TRAVIS_TAG="$TRAVIS_TAG"
--env TRAVIS_BRANCH="$TRAVIS_BRANCH"
--env TRAVIS_PULL_REQUEST="$TRAVIS_PULL_REQUEST"
--env GOOGLE_APPLICATION_CREDENTIALS_DATA="$GOOGLE_APPLICATION_CREDENTIALS_DATA"
--volume /home/travis/build/openai/retro:/root/code/retro
--volume /home/travis/.ccache:/root/.ccache
--workdir /root/code/retro
openai/retro-build:$TAG
python travis.py;
fi
- |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update > /dev/null
brew install qt5 capnp lua@5.1 ccache
curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash miniconda.sh -b
export PATH=/usr/local/opt/ccache/libexec:$HOME/miniconda3/bin:$PATH
hash -r
conda create -y -q -n venv python=$PYVER pip
source activate venv
pip install wheel google-auth google-cloud-storage pytest
python travis.py
fi
# Changelog
## 0.8.0
* add python 3.8 support
* drop python 3.5 due to build issues on windows
## 0.7.1
* fix discrete and multi-discrete action space filtering
* fix random printfs when making environments
* data fixes for AeroStar-GameBoy, ChaseHQII-Genesis, Geimos-Nes, MagicalTaruruutoKun-Genesis, KanshakudamaNageKantarouNoToukaidouGojuusanTsugi-Nes, TigerHeli-Nes (may change reward for these games, mostly these are bug fixes)
# python 3.5 compatibility fix (thanks @kieran-lemayai!)
* fix for new pyglet minor version that breaks backward compatibility (thanks @fsimond!)
* json parsing fix (thanks @eaplatanios!)
* minor memory leak fix (thanks @eaplatanios!)
## 0.7.0
* move some buggy games from the `stable` integrations folder to `experimental`
* minor bug fixes including fixes to a few game scenarios
* more docs
* add ability to use arbitrary additional integration directories
* integration UI searches for current Python's Gym Retro data directory
* import script can now accept files in addition to directories
* you can now use RAM observations by sending `obs_type=retro.Observations.RAM` to `retro.make`
* update Atari 2600 emulator
## 0.6.0
* add cores for GB/C, GBA, GG, NES, SMS, SNES, TurboGrafx
* add integration UI and searching
* add basic scenario access to Lua
* improve testing tooling
* multi-agent support
* cleaned up API:
* everything involving data, e.g. game and state listing, file lookup and data path handling, has been moved into retro.data
* importing retro.data.experiment or retro.data.contrib includes additional games and data that may not be as well-tested
* retro.ACTIONS_* and retro.STATE_* have been replaced with retro.Actions.* and retro.State.* enums
* retro.data.GameData objects no longer need an associated RetroEmulator object, though some functionality will not work
* add screen cropping
* added RetroEnv.get_action_meaning to describe the correlation between actions and buttons
* fixed d-pad action filtering so e.g. UP+DOWN+LEFT reduces to LEFT instead of NOOP
* add parallelism, lossless videos, info dict, disabling audio and numpy action dumping to playback_movies
* update LuaJIT to 2.1.0-beta3
## 0.5.6
* fix generating corrupted bk2s
* reliabilty fixes and minor enhancements to playback_movies
## 0.5.5
* allow Atari height to be different per game
* update pybind11 dependency
* add parallelism, lossless videos, info dict and numpy action dumping to playback_movies
* fix crashes with TensorFlow
## 0.5.4
* improved Windows support
* refreshed Python memory access
* build manylinux1-compatible wheels
* minor documentation fixes
* minor fixes to playback_movie script
* update Atari 2600 emulator
## 0.5.3
* fix Lua on Windows
* add Windows support to import.sega_classics
* only use system libzip if compatible
## 0.5.2
* initial public release
cmake_minimum_required(VERSION 3.2)
if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
find_package(Git QUIET)
find_package(PythonInterp REQUIRED)
file(READ "${CMAKE_SOURCE_DIR}/VERSION" PROJECT_VERSION)
string(REGEX REPLACE "\n$" "" PROJECT_VERSION "${PROJECT_VERSION}")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "$CMAKE_SOURCE_DIR}/VERSION")
project("Gym Retro" VERSION ${PROJECT_VERSION})
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_MACOSX_DEPLOYMENT_TARGET 10.7)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers -fvisibility=hidden")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mssse3")
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
option(BUILD_TESTS "Should tests be built" ON)
option(BUILD_UI "Should integration UI be built" OFF)
option(BUILD_LUAJIT "Should static LuaJIT be used instead of system Lua" ON)
option(BUILD_MANYLINUX "Should use static libraries compatible with manylinux1" OFF)
set(BUILD_PYTHON ON CACHE BOOL "Build Python module")
mark_as_advanced(BUILD_PYTHON)
if(BUILD_PYTHON)
find_package(PythonLibs REQUIRED)
endif()
if(WIN32 OR BUILD_MANYLINUX)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
find_package(ZLIB REQUIRED)
find_package(PkgConfig)
if(NOT BUILD_MANYLINUX)
# CapnProto requires a newer kernel than manylinux1 provides
find_package(CapnProto QUIET)
endif()
pkg_search_module(LIBZIP QUIET libzip)
if(NOT BUILD_LUAJIT)
find_package(Lua 5.1 EXACT REQUIRED)
set(LUA_INCLUDE_DIRS "${LUA_INCLUDE_DIR}")
else()
set(LUA_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/third-party/luajit/src")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(LUA_FLAGS ${LUA_FLAGS} CC=${CMAKE_C_COMPILER} LDFLAGS=-mmacosx-version-min=10.7)
set(LUA_CFLAGS -mmacosx-version-min=10.7)
endif()
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
set(LUA_FLAGS ${LUA_FLAGS} "CFLAGS=-fPIC -DLUAJIT_ENABLE_GC64 ${LUA_CFLAGS}")
endif()
if(CMAKE_CROSSCOMPILING)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
set(BITS 64)
else()
set(BITS 32)
endif()
set(LUA_FLAGS ${LUA_FLAGS} "HOST_CC=gcc -m${BITS}" CROSS="${cross_prefix}" TARGET_SYS="${CMAKE_SYSTEM_NAME}")
endif()
set(LUA_LIBRARY "${LUA_INCLUDE_DIRS}/libluajit.a")
add_custom_command(OUTPUT "${LUA_LIBRARY}"
COMMAND $(MAKE) ${LUA_FLAGS} libluajit.a
WORKING_DIRECTORY "${LUA_INCLUDE_DIRS}")
add_custom_target(clean-luajit
COMMAND $(MAKE) clean
WORKING_DIRECTORY "${LUA_INCLUDE_DIRS}")
endif()
if(NOT WIN32)
set(PYEXT_SUFFIX ".so" CACHE STRING "Suffix for Python extension modules")
else()
set(PYEXT_SUFFIX ".pyd" CACHE STRING "Suffix for Python extension modules" FORCE)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(STATIC_LDFLAGS "-static-libstdc++ -Wl,--exclude-libs,ALL")
endif()
set(PYLIB_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" CACHE PATH "Build directory that contains retro module")
file(MAKE_DIRECTORY "${PYLIB_DIRECTORY}/retro/cores")
set(CORES)
set(COREINFO)
set(CORE_TARGETS)
function(add_core PLATFORM CORE_NAME)
set(TARGET_NAME ${CORE_NAME}_libretro${CMAKE_SHARED_LIBRARY_SUFFIX})
get_filename_component(TARGET_PATH "${PYLIB_DIRECTORY}/retro/cores/${TARGET_NAME}" ABSOLUTE)
list(APPEND CORES "${TARGET_PATH}")
list(APPEND COREINFO "${CMAKE_CURRENT_SOURCE_DIR}/retro/cores/${CORE_NAME}.json")
set(CORES "${CORES}" PARENT_SCOPE)
set(COREINFO "${COREINFO}" PARENT_SCOPE)
set(SUBDIR)
if(EXISTS "cores/${PLATFORM}/Makefile.libretro")
set(MAKEFILE Makefile.libretro)
elseif(EXISTS "cores/${PLATFORM}/Makefile")
set(MAKEFILE Makefile)
elseif(EXISTS "cores/${PLATFORM}/libretro/Makefile")
set(MAKEFILE Makefile)
set(SUBDIR libretro)
else()
message(FATAL_ERROR "Could not find Makefile.")
endif()
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/retro/cores/${CORE_NAME}-version"
COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_SOURCE_DIR}/retro/cores/${CORE_NAME}-version")
if(WIN32)
set(LIBRETRO_PLATFORM platform=win)
endif()
set(CORE_LDFLAGS "-w ${STATIC_LDFLAGS}")
set(CORE_CFLAGS "-w")
set(CORE_CXXFLAGS "-w")
if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
set(CORE_LDFLAGS "${CORE_LDFLAGS} ${STATIC_LDFLAGS}")
endif()
if(NOT WIN32)
set(CORE_FPIC_FLAGS "-fPIC")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(CORE_FPIC_FLAGS "${CORE_FPIC_FLAGS} -mmacosx-version-min=10.7 -stdlib=libc++")
endif()
add_custom_command(OUTPUT "${TARGET_PATH}"
COMMAND ${CMAKE_COMMAND} -E env CFLAGS=${CORE_CFLAGS} CXXFLAGS=${CORE_CXXFLAGS} LDFLAGS=${CORE_LDFLAGS} $(MAKE) -f ${MAKEFILE} CC="${CMAKE_C_COMPILER}" CXX="${CMAKE_CXX_COMPILER}" fpic=${CORE_FPIC_FLAGS} ${LIBRETRO_PLATFORM}
COMMAND ${CMAKE_COMMAND} -E copy "${CORE_NAME}_libretro*" "${TARGET_PATH}"
WORKING_DIRECTORY "cores/${PLATFORM}/${SUBDIR}"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/retro/cores/${CORE_NAME}-version")
unset(CORE_LDFLAGS)
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/retro/cores/${CORE_NAME}.json"
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cores/${PLATFORM}.json" "${CMAKE_CURRENT_SOURCE_DIR}/retro/cores/${CORE_NAME}.json"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/retro/cores/${CORE_NAME}-version")
add_custom_target(${PLATFORM} ALL DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/retro/cores/${CORE_NAME}-version" "${CMAKE_CURRENT_SOURCE_DIR}/retro/cores/${CORE_NAME}.json" "${TARGET_PATH}")
list(APPEND CORE_TARGETS "${PLATFORM}")
set(CORE_TARGETS "${CORE_TARGETS}" PARENT_SCOPE)
add_custom_target(clean-${PLATFORM}
COMMAND $(MAKE) -f ${MAKEFILE} clean
COMMAND ${CMAKE_COMMAND} -E remove "${TARGET_PATH}"
WORKING_DIRECTORY "cores/${PLATFORM}/${SUBDIR}")
endfunction()
add_core(snes snes9x)
add_core(genesis genesis_plus_gx)
add_core(nes fceumm)
add_core(atari2600 stella)
add_core(gb gambatte)
add_core(gba mgba)
add_core(pce mednafen_pce_fast)
set(CLEAN_CORES)
foreach(CORE IN LISTS CORE_TARGETS)
list(APPEND CLEAN_CORES "clean-${CORE}")
endforeach()
add_custom_target(clean-cores DEPENDS ${CLEAN_CORES})
add_custom_target(cores DEPENDS ${CORE_TARGETS})
unset(CLEAN_CORES)
if(CMAKE_CROSSCOMPILING)
find_program(CAPNP_EXECUTABLE capnp)
find_program(CAPNPC_CXX_EXECUTABLE capnpc-c++)
endif()
if(NOT CapnProto_FOUND AND NOT BUILD_MANYLINUX)
if (NOT CMAKE_CROSSCOMPILING OR CAPNP_EXECUTABLE)
set(CapnProto_FOUND ON)
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
if(CAPNP_EXECUTABLE)
set(CAPNP_LITE ON)
endif()
set(CAPNP_INCLUDE_DIRECTORY third-party/capnproto/c++/src)
add_subdirectory(third-party/capnproto/c++)
endif()
endif()
if(CapnProto_FOUND)
add_definitions(-DUSE_CAPNP)
if(CAPNP_LIB_CAPNP)
add_library(CapnProto::capnp SHARED IMPORTED)
add_library(CapnProto::kj SHARED IMPORTED)
set_target_properties(CapnProto::kj PROPERTIES IMPORTED_LOCATION "${CAPNP_LIB_KJ}")
set_target_properties(CapnProto::capnp PROPERTIES
IMPORTED_LOCATION "${CAPNP_LIB_CAPNP}"
INTERFACE_LINK_LIBRARIES CapnProto::kj)
endif()
if(CMAKE_CROSSCOMPILING)
if(TARGET CapnProto::capnp_tool)
set_target_properties(CapnProto::capnp_tool PROPERTIES IMPORTED_LOCATION "${CAPNP_EXECUTABLE}")
endif()
if(TARGET CapnProto::capnpc_cpp)
set_target_properties(CapnProto::capnpc_cpp PROPERTIES IMPORTED_LOCATION "${CAPNPC_CXX_EXECUTABLE}")
endif()
endif()
else()
message(WARNING "Could not find CapnProto, disabling search save/load")
endif()
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(BUILD_STATIC_LIBS ON CACHE BOOL "" FORCE)
if(LIBZIP_FOUND AND NOT LIBZIP_VERSION VERSION_LESS 1.0.0)
include_directories(${LIBZIP_INCLUDE_DIRS})
link_directories(${LIBZIP_LIBRARY_DIRS})
else()
set(LIBZIP_LIBRARIES zip)
add_subdirectory(third-party/libzip)
include_directories(third-party/libzip third-party/libzip/lib)
endif()
include_directories(${LUA_INCLUDE_DIRS})
add_library(retro-base STATIC
src/coreinfo.cpp
src/data.cpp
src/emulator.cpp
src/imageops.cpp
src/memory.cpp
src/movie.cpp
src/movie-bk2.cpp
src/movie-fm2.cpp
src/script.cpp
src/script-lua.cpp
src/search.cpp
src/utils.cpp
src/zipfile.cpp
${LUA_LIBRARY})
target_link_libraries(retro-base ${ZLIB_LIBRARY} ${LIBZIP_LIBRARIES} ${LUA_LIBRARY} ${LUA_LIBRRAY})
add_dependencies(retro-base ${CORE_TARGETS})
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(retro-base dl)
endif()
if(CapnProto_FOUND)
capnp_generate_cpp(CAPNP_SRC CAPNP_H src/serialize.capnp)
add_library(retro-capnp STATIC ${CAPNP_SRC} src/data-capnp.cpp)
target_link_libraries(retro-capnp retro-base CapnProto::capnp)
endif()
include_directories(src retro third-party/pybind11/include third-party third-party/gtest/googletest/include ${PYTHON_INCLUDE_DIRS})
if(BUILD_PYTHON)
add_library(retro SHARED src/retro.cpp)
set_target_properties(retro PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${PYLIB_DIRECTORY}/retro"
RUNTIME_OUTPUT_DIRECTORY "${PYLIB_DIRECTORY}/retro"
OUTPUT_NAME _retro
PREFIX ""
SUFFIX ${PYEXT_SUFFIX})
if(APPLE)
set(PYBIND_LIBS "-undefined dynamic_lookup")
elseif(WIN32)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
add_definitions(-DMS_WIN64)
endif()
set(PYBIND_LIBS "${PYTHON_LIBRARY}")
endif()
target_link_libraries(retro retro-base ${PYBIND_LIBS} ${STATIC_LDFLAGS})
endif()
if(BUILD_TESTS)
enable_testing()
add_subdirectory(third-party/gtest/googlemock)
add_subdirectory(tests)
endif()
if(BUILD_UI)
add_subdirectory(src/ui)
endif()
execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/setup.py --version OUTPUT_VARIABLE CPACK_PACKAGE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CPACK_PACKAGE_VENDOR OpenAI)
set(CPACK_ZIP_COMPONENT_INSTALL ON)
if(APPLE)
set(CPACK_GENERATOR DragNDrop)
elseif(WIN32)
set(CPACK_GENERATOR ZIP)
endif()
set(CPACK_COMPONENTS_ALL gym-retro-integration)
include(CPack)
# Gym Retro Contribution Guidelines
At this time we are currently accepting the current forms of contributions:
- Bug reports in either the core functionality or game integrations
- Pull requests for core functionality bug fixes
Notably, we are not accepting these forms of contributions:
- New game integrations
- New features
This may change in the future.
In the meantime if you wish to integrate new games you are more than welcome to maintain unofficial repositories of additional games.
## Issue reports
Please include the following information in your issue reports:
- Operating system
- Python version
- Gym Retro version or git commit
- A detailed description of the issue
## Code contributions
Please try to adhere to the existing code style. There is a linter script included at `scripts/lint.sh`.
### Python
Gym Retro is written in a [PEP 8-compliant code style](https://www.python.org/dev/peps/pep-0008/) (minus the line length restriction). Please make sure to maintain this style in any contributions.
### C++
There is a `.clang-format` file that documents as best as possible the code style for Gym Retro. Please make sure to follow it.
\ No newline at end of file
The MIT License
Copyright (c) 2017-2018 OpenAI (http://openai.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
This diff is collapsed.
recursive-include third-party **
recursive-include cores **
global-exclude .git* .*.yml *.o *.a *.dylib *.so *.dll
exclude travis.py retro/VERSION.txt
recursive-exclude retro/cores *-version
**Status:** Maintenance (expect bug fixes and minor updates)
# Gym Retro
Gym Retro lets you turn classic video games into [Gym](https://gym.openai.com/) environments for reinforcement learning and comes with integrations for ~1000 games. It uses various emulators that support the [Libretro API](https://www.libretro.com/index.php/api/), making it fairly easy to add new emulators.
Supported platforms:
- Windows 7, 8, 10
- macOS 10.13 (High Sierra), 10.14 (Mojave)
- Linux (manylinux1)
CPU with `SSSE3` or better
Supported Pythons:
- 3.6
- 3.7
- 3.8
Each game integration has files listing memory locations for in-game variables, reward functions based on those variables, episode end conditions, savestates at the beginning of levels and a file containing hashes of ROMs that work with these files.
Please note that ROMs are not included and you must obtain them yourself. Most ROM hashes are sourced from their respective No-Intro SHA-1 sums.
# Documentation
Documentation is available at https://retro.readthedocs.io/en/latest/
You should probably start with the [Getting Started Guide](https://retro.readthedocs.io/en/latest/getting_started.html).
# Contributing
[See CONTRIBUTING.md](https://github.com/openai/retro/blob/master/CONTRIBUTING.md)
# Changelog
[See CHANGES.md](https://github.com/openai/retro/blob/master/CHANGES.md)
# Emulated Systems
- Atari
- Atari2600 (via Stella)
- NEC
- TurboGrafx-16/PC Engine (via Mednafen/Beetle PCE Fast)
- Nintendo
- Game Boy/Game Boy Color (via gambatte)
- Game Boy Advance (via mGBA)
- Nintendo Entertainment System (via FCEUmm)
- Super Nintendo Entertainment System (via Snes9x)
- Sega
- GameGear (via Genesis Plus GX)
- Genesis/Mega Drive (via Genesis Plus GX)
- Master System (via Genesis Plus GX)
See [LICENSES.md](https://github.com/openai/retro/blob/master/LICENSES.md) for information on the licenses of the individual cores.
# Included ROMs
The following non-commercial ROMs are included with Gym Retro for testing purposes:
- [the 128 sine-dot](http://www.pouet.net/prod.php?which=2762) by Anthrox
- [Sega Tween](https://pdroms.de/files/gamegear/sega-tween) by Ben Ryves
- [Happy 10!](http://www.pouet.net/prod.php?which=52716) by Blind IO
- [512-Colour Test Demo](https://pdroms.de/files/pcengine/512-colour-test-demo) by Chris Covell
- [Dekadrive](http://www.pouet.net/prod.php?which=67142) by Dekadence
- [Automaton](https://pdroms.de/files/atari2600/automaton-minigame-compo-2003) by Derek Ledbetter
- [Fire](http://privat.bahnhof.se/wb800787/gb/demo/64/) by dox
- [FamiCON intro](http://www.pouet.net/prod.php?which=53497) by dr88
- [Airstriker](https://pdroms.de/genesis/airstriker-v1-50-genesis-game) by Electrokinesis
- [Lost Marbles](https://pdroms.de/files/gameboyadvance/lost-marbles) by Vantage
# Citation
Please cite using the following BibTeX entry:
```
@article{nichol2018retro,
title={Gotta Learn Fast: A New Benchmark for Generalization in RL},
author={Nichol, Alex and Pfau, Vicki and Hesse, Christopher and Klimov, Oleg and Schulman, John},
journal={arXiv preprint arXiv:1804.03720},
year={2018}
}
```
0.8.0
import pytest
import retro.data
inttypes = {
'exp': retro.data.Integrations.EXPERIMENTAL_ONLY,
'contrib': retro.data.Integrations.CONTRIB_ONLY,
}
def pytest_collection_modifyitems(items):
def test(*args, **kwargs):
print(kwargs)
return False
for item in items:
if item.originalname in ('test_load', 'test_rom', 'test_state', 'test_hash'):
for key in item.keywords.keys():
if '[' + key + ']' not in item.nodeid:
continue
game = key.split('_')
gamename = '%s-%s' % (game[0], game[1])
try:
retro.data.get_romfile_path(gamename, inttypes[game[2]] if len(game) > 2 else retro.data.Integrations.STABLE)
except (FileNotFoundError, KeyError):
item.add_marker(pytest.mark.skip)
{
"Atari2600": {
"lib": "stella",
"ext": ["a26"],
"rambase": 128,
"keybinds": ["Z", null, "TAB", "ENTER", "UP", "DOWN", "LEFT", "RIGHT"],
"buttons": ["BUTTON", null, "SELECT", "RESET", "UP", "DOWN", "LEFT", "RIGHT"],
"actions": [
[[], ["UP"], ["DOWN"]],
[[], ["LEFT"], ["RIGHT"]],
[[], ["BUTTON"]]
]
}
}
# Xcode
*.DS_Store
*/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!OpenEmu.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
*.o
*.bc
*.js
*.json
.npmignore
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = https://github.com/libretro/stella-libretro.git
branch = b0b63615fc2c7a30470fc1ac31ffdc18fdf4518b
commit = b0b63615fc2c7a30470fc1ac31ffdc18fdf4518b
parent = 72f0e18a9feb16f0975c90ed50bc82e8ccad5907
method = rebase
cmdver = 0.4.0
language: generic
os: linux
dist: trusty
sudo: required
addons:
apt:
packages:
- g++-7
sources:
- ubuntu-toolchain-r-test
env:
global:
- CORE=stella
- COMPILER_NAME=gcc CXX=g++-7 CC=gcc-7
matrix:
- PLATFORM=linux_x64
- PLATFORM=ngc
- PLATFORM=wii
- PLATFORM=wiiu
before_script:
- pwd
- mkdir -p ~/bin
- ln -s /usr/bin/gcc-7 ~/bin/gcc
- ln -s /usr/bin/g++-7 ~/bin/g++
- ln -s /usr/bin/cpp-7 ~/bin/cpp
- export PATH=~/bin:$PATH
- ls -l ~/bin
- echo $PATH
- g++-7 --version
- g++ --version
script:
- cd ~/
- git clone --depth=50 https://github.com/libretro/libretro-super
- cd libretro-super/travis
- ./build.sh
This diff is collapsed.
LIBRETRO_COMM_DIR = $(CORE_DIR)/../libretro-common
INCFLAGS := -I. -I$(CORE_DIR) -I$(CORE_DIR)/src -I$(CORE_DIR)/stubs -I$(CORE_DIR)/src/emucore -I$(CORE_DIR)/src/common -I$(CORE_DIR)/src/gui
ifneq (,$(findstring msvc2003,$(platform)))
INCFLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc
endif
SOURCES_CXX := $(CORE_DIR)/src/common/Base.cxx \
$(CORE_DIR)/src/common/SoundSDL.cxx \
$(CORE_DIR)/src/emucore/AtariVox.cxx \
$(CORE_DIR)/src/emucore/Booster.cxx \
$(CORE_DIR)/src/emucore/Cart.cxx \
$(CORE_DIR)/src/emucore/Cart0840.cxx \
$(CORE_DIR)/src/emucore/Cart2K.cxx \
$(CORE_DIR)/src/emucore/Cart3E.cxx \
$(CORE_DIR)/src/emucore/Cart3F.cxx \
$(CORE_DIR)/src/emucore/Cart4A50.cxx \
$(CORE_DIR)/src/emucore/Cart4K.cxx \
$(CORE_DIR)/src/emucore/Cart4KSC.cxx \
$(CORE_DIR)/src/emucore/CartAR.cxx \
$(CORE_DIR)/src/emucore/CartBF.cxx \
$(CORE_DIR)/src/emucore/CartBFSC.cxx \
$(CORE_DIR)/src/emucore/CartCM.cxx \
$(CORE_DIR)/src/emucore/CartCTY.cxx \
$(CORE_DIR)/src/emucore/CartCV.cxx \
$(CORE_DIR)/src/emucore/CartDF.cxx \
$(CORE_DIR)/src/emucore/CartDFSC.cxx \
$(CORE_DIR)/src/emucore/CartDPC.cxx \
$(CORE_DIR)/src/emucore/CartDPCPlus.cxx \
$(CORE_DIR)/src/emucore/CartE0.cxx \
$(CORE_DIR)/src/emucore/CartE7.cxx \
$(CORE_DIR)/src/emucore/CartEF.cxx \
$(CORE_DIR)/src/emucore/CartEFSC.cxx \
$(CORE_DIR)/src/emucore/CartF0.cxx \
$(CORE_DIR)/src/emucore/CartF4.cxx \
$(CORE_DIR)/src/emucore/CartF4SC.cxx \
$(CORE_DIR)/src/emucore/CartF6.cxx \
$(CORE_DIR)/src/emucore/CartF6SC.cxx \
$(CORE_DIR)/src/emucore/CartF8.cxx \
$(CORE_DIR)/src/emucore/CartF8SC.cxx \
$(CORE_DIR)/src/emucore/CartFA.cxx \
$(CORE_DIR)/src/emucore/CartFA2.cxx \
$(CORE_DIR)/src/emucore/CartFE.cxx \
$(CORE_DIR)/src/emucore/CartMC.cxx \
$(CORE_DIR)/src/emucore/CartSB.cxx \
$(CORE_DIR)/src/emucore/CartUA.cxx \
$(CORE_DIR)/src/emucore/CartX07.cxx \
$(CORE_DIR)/src/emucore/CompuMate.cxx \
$(CORE_DIR)/src/emucore/Console.cxx \
$(CORE_DIR)/src/emucore/Control.cxx \
$(CORE_DIR)/src/emucore/Driving.cxx \
$(CORE_DIR)/src/emucore/Genesis.cxx \
$(CORE_DIR)/src/emucore/Joystick.cxx \
$(CORE_DIR)/src/emucore/Keyboard.cxx \
$(CORE_DIR)/src/emucore/KidVid.cxx \
$(CORE_DIR)/src/emucore/M6502.cxx \
$(CORE_DIR)/src/emucore/M6532.cxx \
$(CORE_DIR)/src/emucore/MD5.cxx \
$(CORE_DIR)/src/emucore/MindLink.cxx \
$(CORE_DIR)/src/emucore/MT24LC256.cxx \
$(CORE_DIR)/src/emucore/NullDev.cxx \
$(CORE_DIR)/src/emucore/Paddles.cxx \
$(CORE_DIR)/src/emucore/Props.cxx \
$(CORE_DIR)/src/emucore/PropsSet.cxx \
$(CORE_DIR)/src/emucore/Random.cxx \
$(CORE_DIR)/src/emucore/SaveKey.cxx \
$(CORE_DIR)/src/emucore/Serializer.cxx \
$(CORE_DIR)/src/emucore/Settings.cxx \
$(CORE_DIR)/src/emucore/StateManager.cxx \
$(CORE_DIR)/src/emucore/Switches.cxx \
$(CORE_DIR)/src/emucore/System.cxx \
$(CORE_DIR)/src/emucore/Thumbulator.cxx \
$(CORE_DIR)/src/emucore/TIA.cxx \
$(CORE_DIR)/src/emucore/TIASnd.cxx \
$(CORE_DIR)/src/emucore/TIATables.cxx \
$(CORE_DIR)/src/emucore/TrackBall.cxx \
$(LIBRETRO_DIR)/libretro.cxx
stella-libretro
========================
Port of Stella to libretro.
\ No newline at end of file