超级马里奥兄弟为openai健身房
gym-zelda-1的Python项目详细描述
健身房-ZELDA-1
传说中的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
字典包含以下内容
按键:
Key | Type | Description |
---|---|---|
^{ | ^{ | 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}}, }
参考文献
以下参考资料有助于本项目的建设。
- The Legend of Zelda: RAM Map。data crystal rom黑客攻击。
- The Legend of Zelda: Memory Addresses。nes黑客。