Joust¶

此环境是 Atari 环境 的一部分。请先阅读该页面以获取一般信息。
导入 |
|
---|---|
动作空间 (Actions) |
离散 |
Parallel API |
是 |
手动控制 |
否 |
智能体 (Agents) |
|
智能体 (Agents) |
2 |
动作形状 (Action Shape) |
(1,) |
动作值 (Action Values) |
[0,17] |
观察形状 (Observation Shape) |
(210, 160, 3) |
观察值 (Observation Values) |
(0,255) |
在一个残酷的世界中,通过得分来玩的混合总和游戏。细致的定位、时机把握和控制至关重要,同时也要注意你的对手。
在 Joust 中,当你处于对手和 NPC 上方时击中他们即可得分。如果你在他们下方,你会损失一条生命。在游戏中,有各种波次,包含不同的敌人和不同的得分系统。然而,预计每波你可以获得大约 3000 分。
环境参数¶
环境参数适用于所有 Atari 环境,并在 Atari 基本文档 中描述。
动作空间¶
在任何给定回合中,智能体可以从 18 种动作中选择一种。
动作 (Action) |
行为 (Behavior) |
---|---|
0 |
无操作 |
1 |
射击 |
2 |
向上移动 |
3 |
向右移动 |
4 |
向左移动 |
5 |
向下移动 |
6 |
向右上移动 |
7 |
向左上移动 |
8 |
向右下移动 |
9 |
向左下移动 |
10 |
向上射击 |
11 |
向右射击 |
12 |
向左射击 |
13 |
向下射击 |
14 |
向右上射击 |
15 |
向左上射击 |
16 |
向右下射击 |
17 |
向左下射击 |
版本历史¶
v3: 最小动作空间 (1.18.0)
v2: 整个 API 的重大变更 (1.4.0)
v1: 修复了所有环境处理过早死亡的方式 (1.3.0)
v0: 初版发布 (1.0.0)
用法¶
AEC¶
from pettingzoo.atari import joust_v3
env = joust_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()
Parallel¶
from pettingzoo.atari import joust_v3
env = joust_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()