超级马里奥兄弟为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 Google Billing Library:QueryPurchaseAsync:取消购买的订阅资源未返回   java转换列表mapsturct中的单个对象   java简单算法。我做不好   包含集合的@ManyToMany映射的java JPA2持久性   在Java中序列化和反序列化对象时发生BuffereImage错误   java使用ui:param传递值并在backingbean中访问它们   java从应用程序读取配置。yml至POJO列表地图   java中在while循环外部调用文件值   java如何与来自不同类的UI交互   java如何在jTable中显示2D数组?   在Java 8中,类为什么不从接口继承默认方法?   java类。getAnnotation和getAnnotations无法正常工作   java处理pagertabstrip上的触摸事件   java GWT和struts2异常   用Java解析HTTP查询字符串   java这段代码SQL注入安全吗?