Emtombed: 合作版¶

此环境是 Atari 环境 的一部分。请先阅读该页面以获取一般信息。
导入 |
|
---|---|
动作 |
离散 |
并行 API |
是 |
手动控制 |
否 |
智能体 |
|
智能体 |
2 |
动作形状 |
(1,) |
动作值 |
[0,17] |
观察形状 |
(210, 160, 3) |
观察值 |
(0,255) |
平均总奖励 |
6.23 |
Entombed 的合作版本是一款探索游戏,你需要与队友合作尽可能深入迷宫。
你们俩都需要快速向下 navigating 一个不断生成的迷宫,而你们只能看到一部分。如果你被困住,你就输了。请注意,你很容易发现自己身处死胡同,只能通过使用稀有道具逃脱。如果玩家通过使用这些道具互相帮助,他们就能坚持更久。请注意,最佳协调要求智能体位于地图的对侧,因为道具出现在一侧或另一侧,但可用于打破两侧的墙壁(破坏是对称的,影响屏幕的两半)。此外,周围潜伏着危险的僵尸需要避开。
奖励被设计成与单人模式奖励相同。具体来说,一个 entombed 关卡被分为 5 个不可见的区域。在更改区域后或重置关卡后,你会立即获得奖励。请注意,这意味着当你失去一条生命时会获得奖励,因为它重置了关卡,但当你失去最后一条生命时则不会,因为游戏在关卡未重置的情况下就终止了。
环境参数¶
环境参数对所有 Atari 环境通用,并在基础 Atari 文档中进行了描述。
动作空间¶
在任何回合中,一个智能体都可以从 18 种动作中选择一种。
动作 |
行为 |
---|---|
0 |
无操作 |
1 |
开火 |
2 |
向上移动 |
3 |
向右移动 |
4 |
向左移动 |
5 |
向下移动 |
6 |
向上向右移动 |
7 |
向上向左移动 |
8 |
向下向右移动 |
9 |
向下向左移动 |
10 |
向上开火 |
11 |
向右开火 |
12 |
向左开火 |
13 |
向下开火 |
14 |
向上向右开火 |
15 |
向上向左开火 |
16 |
向下向右开火 |
17 |
向下向左开火 |
版本历史¶
v3: 最小动作空间 (1.18.0)
v2: 整个 API 的重大变更,修复了 Entombed 奖励 (1.4.0)
v1: 修复了所有环境处理过早死亡的方式 (1.3.0)
v0: 初始版本发布 (1.0.0)
用法¶
AEC¶
from pettingzoo.atari import entombed_cooperative_v3
env = entombed_cooperative_v3.env(render_mode="human")
env.reset(seed=42)
for agent in env.agent_iter():
observation, reward, termination, truncation, info = env.last()
if termination or truncation:
action = None
else:
# this is where you would insert your policy
action = env.action_space(agent).sample()
env.step(action)
env.close()
并行¶
from pettingzoo.atari import entombed_cooperative_v3
env = entombed_cooperative_v3.parallel_env(render_mode="human")
observations, infos = env.reset()
while env.agents:
# this is where you would insert your policy
actions = {agent: env.action_space(agent).sample() for agent in env.agents}
observations, rewards, terminations, truncations, infos = env.step(actions)
env.close()