← 所有文章

游戏世界模型笔记:动作条件与内部状态

用游戏角色移动的例子说明世界模型如何根据历史画面和用户动作预测下一帧,并介绍动作嵌入、视频 token 和游戏内部状态的记录方式。

普通Video Generation:

Prompt→VideoPrompt \rightarrow Video

World Model需要:

Video History+Action→Future VideoVideo\ History + Action \rightarrow Future\ Video

1. Example

假设当前:

1
2
3
4
Player Position:
(10, 5, 2)
Camera Direction:
North

用户:

1
Action = W

真实游戏引擎可能产生:

1
2
Position:
(10, 6, 2)

画面也变化。

因此训练数据可以是:

(ot,at,ot+1)(o_t, a_t, o_{t+1})

比如:

1
2
3
Frame 100
W
Frame 101

继续:

1
2
3
Frame 101
Mouse Left
Frame 102

于是训练集:

D={(ot,at,ot+1)}t=1ND = \left\{(o_t, a_t, o_{t+1})\right\}_{t=1}^{N}

2. Action 怎么放进模型

一个最简单的思想:

假设 Action:

1
2
3
4
5
6
7
W
A
S
D
Space
Mouse_X
Mouse_Y

全部先转成:

Action EmbeddingAction\ Embedding

例如:

at→etaa_t \rightarrow e_t^a

然后和 Video Tokens 一起送进 Transformer:

[Video Tokens;Action Tokens][Video\ Tokens; Action\ Tokens]

3. 游戏数据里的Internal State

只有 RGB frame,模型看到:

ObservationObservation

但很多真实世界状态可能无法直接从像素确定。

例如:

1
2
3
4
5
6
7
8
Player position
Camera pose
Velocity
HP
Object ID
Collision state
NPC state
Inventory

这些是:

Game Internal State

因此数据可以更加完整地记录:

(ot,st,at,ot+1,st+1)(o_t, s_t, a_t, o_{t+1}, s_{t+1})

其中:

sts_t

代表 internal state。