超级马里奥兄弟为openai健身房

gym-zelda-1的Python项目详细描述


健身房-ZELDA-1

BuildStatusPackageVersionPythonVersionStableFormatLicense

传说中的OpenAI Gym环境 任天堂娱乐系统上的Zelda(即Zelda 1),基于 nes-py模拟器。

安装

gym-zelda-1的首选安装位置是pip

pip install gym-zelda-1

用法

Python

在尝试创建环境之前,必须导入gym_zelda_1。 这是因为健身房环境是在运行时注册的。默认情况下, gym_zelda_1环境使用完整的NES操作空间256 离散动作。为了限制这种情况,gym_zelda_1.actions提供 一个名为MOVEMENT(20个离散操作)的操作列表,用于 nes_py.wrappers.JoypadSpace包装。

fromnes_py.wrappersimportJoypadSpaceimportgym_zelda_1fromgym_zelda_1.actionsimportMOVEMENTenv=gym_zelda_1.make('Zelda1-v0')env=JoypadSpace(env,MOVEMENT)done=Trueforstepinrange(5000):ifdone:state=env.reset()state,reward,done,info=env.step(env.action_space.sample())env.render()env.close()

注意:gym_zelda_1.make只是gym.make的别名 方便。

注意:删除训练代码中对render的调用 加速。

命令行

gym_zelda_1具有用于播放的命令行界面 使用键盘或均匀随机移动的环境。

gym_zelda_1 -m <`human` or `random`>

步骤

关于step方法返回的奖励和信息的信息。

奖励功能

待办事项:奖励功能是一项正在进行的复杂工作。

info字典

step方法返回的info字典包含以下内容 按键:

KeyTypeDescription
^{}^{}The current level Link is in (0 for overworld)
^{}^{}Link's x position in the screen (from the left)
^{}^{}Link's y position in the screen (from the top)
^{}^{}Link's direction as one of {"N", "S", "E", "W"}
^{}^{}Whether Link has candled the current room
^{}^{}The signal playing through pulse 1
^{}^{}The signal playing through pulse 2
^{}^{}The number of enemies killed
^{}^{}The number of times Link has died
^{}^{}The kind of sword Link has
^{}^{}The number of bombs in Link's inventory
^{}^{}The kind of arrows in Link's inventory
^{}^{}Whether Link has the bow in his inventory
^{}^{}The type of candle in Link's inventory
^{}^{}Whether Link has the whistle in his inventory
^{}^{}Whether Link has food in his inventory
^{}^{}The type of potion in Link's inventory
^{}^{}Whether Link has the magic rod in his inventory
^{}^{}Whether Link has the raft in his inventory
^{}^{}Whether Link has the magic book in his inventory
^{}^{}The type of ring in Link's inventory
^{}^{}Whether Link has the step ladder in his inventory
^{}^{}Whether Link has the magic key in his inventory
^{}^{}Whether Link has the power bracelet in his inventory
^{}^{}Whether Link has the letter in his inventory
^{}^{}Whether the clock is possessed
^{}^{}The number of rupess Link has collected
^{}^{}The number of keys in Link's inventory
^{}^{}The number of heart containers that Link has
^{}^{}The number of remaining health Link has
^{}^{}Whether Link has the boomerang in his inventory
^{}^{}Whether Link has the magic boomerang in his inventory
^{}^{}Whether Link has the magic shield in his inventory
^{}^{}The maximum number of bombs Link can carry

引文

如果你在研究中使用它,请引用gym-zelda-1

@misc{gym-zelda-1,
  author = {Christian Kauten},
  title = {{The Legend of Zelda} for {OpenAI Gym}},
  year = {2019},
  publisher = {GitHub},
  howpublished = {\url{https://github.com/Kautenja/gym-zelda-1}},
}

参考文献

以下参考资料有助于本项目的建设。

  1. The Legend of Zelda: RAM Mapdata crystal rom黑客攻击
  2. The Legend of Zelda: Memory Addressesnes黑客。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Android使用两个后台服务错误   解压缩HTTPInputStream时,java GZIPInputStream过早关闭   javax和javax的区别是什么。网ssl。密钥库和服务器。ssl。为SpringBoot应用程序指定密钥库时的密钥库属性   java生成两个JPanel,而我只需要一个   java深度链接从play store安装应用程序时获取数据   java 安卓应用程序在退出时未正确释放蓝牙   java正确使用setCellValueFactory   java开放JdbcTemplate连接处于只读模式?   使用Spring MVC创建服务时发生java错误   JavaFX获取安装在计算机中的特定应用程序的版本   SecureRandom的安全问题:PRNG在java 1.5中不一致   windows我可以创建一个独立的。带Inno设置的Java应用程序的exe安装程序?   如何使用JavaServlet下载csv文件?   java从生成的缓冲图像中添加图像作为jasper中的数据记录?   java日期和时间解析