12. 参考文献
Predictive Animation Control Using Simulations and Fitted Models.
Ingimar Hólm Guðmundsson, Skubch Hendrik, Fabien Gravot and Yoichiro Miyake
Ambient Interactions: Improving believability by leveraging Rule-based AI
Hendrik Skubch
Logging Visualization in FINAL FANTASY XV
Matthew W. Johnson, Fabien Gravot, Shintaro Minamino, Ingimar Gudmundsson,
Hendrik Skubch, and Miyake Youichiro
Guide to Effective Autogenerated Spatial Queries
Eric Johnson
A Character Decision-Making System for FINAL FANTASY XV by combining
Behavior Trees and State Machines
Youichiro Miyake, Youji Shirakami, Shimokawa Kazuya, Kousuke Namiki, Tomoki,
Komatsu, Tatsuhiro Joudan, Prasertvithyakarn Prasert, Takanori Yokoyama
29. 2 第一次AIブーム(1960年代)
もし A ならば B
もし B ならば C
よって、
もし A ならば C
シンボルによる人工知能
(記号主義)
ニューラルネットによる人工知能
(コネクショニズム)
推論ベース ニューラルネット
誕生
30. 3 第二次AIブーム(1980年代)
IF (A) then B
IF (C) then D
IF (E) then F
IF (G) then H
IF ( I ) then J
シンボルによる人工知能
(記号主義)
ニューラルネットによる人工知能
(コネクショニズム)
ルールベース
新しい学習法=
逆伝搬法
36. Deep Q-Learning
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves,
Ioannis Antonoglou, Daan Wierstra, Martin Riedmiller (DeepMind Technologies)
Playing Atari with Deep Reinforcement Learning
http://www.cs.toronto.edu/~vmnih/docs/dqn.pdf
画面を入力
操作はあらかじめ教える
スコアによる強化学習
38. 学習過程解析
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves,
Ioannis Antonoglou, Daan Wierstra, Martin Riedmiller (DeepMind Technologies)
Playing Atari with Deep Reinforcement Learning
http://www.cs.toronto.edu/~vmnih/docs/dqn.pdf
39. • Pπ ロールアウトポリシー(ロールアウトで討つ手を決める。
Pπ(a|s) sという状態でaを討つ確率)
• Pσ Supervised Learning Network プロの討つ手からその
手を討つ確率を決める。Pσ(a|s)sという状態でaを討つ確
率。
• Pρ 強化学習ネットワーク。Pρ(学習済み)に初期化。
• Vθ(s’) 局面の状態 S’ を見たときに、勝敗の確率を予測
する関数。つまり、勝つか、負けるかを返します。
Mastering the game of Go with deep neural networks and tree search
http://www.nature.com/nature/journal/v529/n7587/full/nature16961.html
https://deepmind.com/research/alphago/
118. メタAI Left 4 Dead の事例
Michael Booth, "The AI Systems of Left 4 Dead," Artificial Intelligence and
Interactive Digital Entertainment Conference at Stanford.
http://www.valvesoftware.com/publications.html
今回は Left 4 Dead の事例を見てみる。
120. メタAI(=AI Director)によるユーザーのリラックス度に応じた敵出現度
ユーザーの緊張度
実際の敵出現数
計算によって
求められた
理想的な敵出現数
Build Up …プレイヤーの緊張度が目標値を超えるまで
敵を出現させ続ける。
Sustain Peak … 緊張度のピークを3-5秒維持するために、
敵の数を維持する。
Peak Fade … 敵の数を最小限へ減少していく。
Relax … プレイヤーたちが安全な領域へ行くまで、30-45秒間、
敵の出現を最小限に維持する。
Michael Booth, "The AI Systems of Left 4 Dead," Artificial Intelligence and Interactive Digital Entertainment Conference at Stanford.
http://www.valvesoftware.com/publications.html
より具体的なアルゴリズム
122. メタAIが作用を行う領域
Michael Booth, "The AI Systems of Left 4 Dead," Artificial Intelligence and Interactive Digital Entertainment Conference at Stanford.
http://www.valvesoftware.com/publications.html
メタAIが作用(敵の生成・
消滅)を行う領域を、
AAS(= Active Area Set) と
言う。
123. メタAIが作用を行う領域
(AAS=Active Area Set)
Michael Booth, "The AI Systems of Left 4 Dead," Artificial Intelligence and Interactive Digital Entertainment Conference at Stanford.
http://www.valvesoftware.com/publications.html
124. メタAIが作用を行う領域
(AAS=Active Area Set)
Michael Booth, "The AI Systems of Left 4 Dead," Artificial Intelligence and Interactive Digital Entertainment Conference at Stanford.
http://www.valvesoftware.com/publications.html
125. 安全な領域までの道のり(Flow Distance)
メタAIはプレイヤー群の経路を
トレースし予測する。
- どこへ来るか
- どこが背面になるか
- どこに向かうか
Michael Booth, "The AI Systems of Left 4 Dead," Artificial Intelligence and Interactive Digital Entertainment Conference at Stanford.
http://www.valvesoftware.com/publications.html
128. 敵出現領域
背後 前方
Michael Booth, "The AI Systems of Left 4 Dead," Artificial Intelligence and Interactive Digital Entertainment Conference at Stanford.
http://www.valvesoftware.com/publications.html
前方と背後のプレイヤー群から見えてない部屋に、
モンスターを発生させる。
129. モンスター・アイテム出現頻度
敵の種類、アイテムの種類ごとに出現頻度が違うが、頻度に応じて発生させる。
高頻度
低頻度
Michael Booth, "The AI Systems of Left 4 Dead," Artificial Intelligence and Interactive Digital Entertainment Conference at Stanford.
http://www.valvesoftware.com/publications.html
Wanderers (高頻度)
Mobs(中頻度)
Special Infected (中頻度)
Bosses (低頻度)
Weapon Caches (低頻度)
Scavenge Items (中頻度)
130. ボス出現アルゴリズム
(1) N体を予想される逃走経路上に配置
(2) 3つの出現イベントパターン
(何もいない、を含む)
(例) Tank, Witch, 何もいない
(3) 同じパターンのくり返しは禁止
(例) Witch, 何もいない、Witch はOK。
Witch, Witch はだめ。
何もいない
Michael Booth, "The AI Systems of Left 4 Dead," Artificial Intelligence and Interactive Digital Entertainment Conference at Stanford.
http://www.valvesoftware.com/publications.html
Tank Witch Witch Tank Witch Tank
131. 具体的なアルゴリズム
(1) 各エリアに、出現数 N を決定する
(2) 出現数Nは予想される逃走経路の長さと
要求される密度によって計算される。
(3) あるエリアがAAS の中に入るとクリー
チャーがN体生成される。
(4) そのエリアがAAS の外に出ると生成が中
止され、クリーチャーは消滅される。
(5) Nはそのエリアがプレイヤーから見えてい
る場合、或いは、プレイヤーがリラックス
モードの場合には、強制的に0になる。
Michael Booth, "The AI Systems of Left 4 Dead," Artificial Intelligence and Interactive Digital Entertainment Conference at Stanford.
http://www.valvesoftware.com/publications.html
135. Procedural Generation in WarFrame
• Warframe ではダンジョンが自動生成される。
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
136. Black Combination in WarFrame
• ブロックを組み合わる
• 完全に零からの生成
ではない。
このような生成のことを
Semi-procedural と言う。
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
139. スタートポイント、出口、目的地の
自動生成
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
140. ヒートマップ(影響マップ)を用いて
ゲーム中にプレイヤーの周囲を自動解析
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
ヒートマップ(影響マップ)とは、対象(ここではプレイヤー)を中心に、位置に温度(影響度)を
与える方法です。距離に応じて減衰します。また時間が経つと、周囲に熱が拡散します。
143. アクティブ・エリアセット(Active Are Set)
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
アクティブ・エリアセットは、プレイヤーの周囲の領域で、
リアルタイムにメタAIがゲームを調整する領域
145. メタAI (AI Director,)による
動的ペース調整
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
146. メタAI(自動適応ペーシング)
メタAI (AI Director,)による
動的ペース調整
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
147. メタAIによる出会うモンスターの数の大域調整
Daniel Brewer, AI Postmortems: Assassin's Creed III, XCOM: Enemy Unknown, and Warframe (GDC2015)
http://www.gdcvault.com/play/1018223/AI-Postmortems-Assassin-s-Creed
プレイヤーのスタート地点から出口までの道のりで、
コンスタントにモンスターと出会うようにする。
185. 戦略位置検出システム
Matthew Jack, Mika Vehkala
Spaces in the Sandbox: Tactical Awareness in Open World Games (GDC2013)
http://www.gdcvault.com/play/1018038/Spaces-in-the-Sandbox-Tactical
186. 戦略位置検出システム
Matthew Jack, Mika Vehkala
Spaces in the Sandbox: Tactical Awareness in Open World Games (GDC2013)
http://www.gdcvault.com/play/1018038/Spaces-in-the-Sandbox-Tactical
187. 戦略位置検出システム
Matthew Jack, Mika Vehkala
Spaces in the Sandbox: Tactical Awareness in Open World Games (GDC2013)
http://www.gdcvault.com/play/1018038/Spaces-in-the-Sandbox-Tactical
188. 戦略位置検出システム
Matthew Jack, Mika Vehkala
Spaces in the Sandbox: Tactical Awareness in Open World Games (GDC2013)
http://www.gdcvault.com/play/1018038/Spaces-in-the-Sandbox-Tactical
189. 戦略位置検出システム
Matthew Jack, Mika Vehkala
Spaces in the Sandbox: Tactical Awareness in Open World Games (GDC2013)
http://www.gdcvault.com/play/1018038/Spaces-in-the-Sandbox-Tactical
190. 戦略位置検出システム
Matthew Jack, Mika Vehkala
Spaces in the Sandbox: Tactical Awareness in Open World Games (GDC2013)
http://www.gdcvault.com/play/1018038/Spaces-in-the-Sandbox-Tactical
206. IF ( 前置宣言文 ) then (後置宣言文)
ルールベース意思決定
Rule-based Decision Making
ルール
ここでは、この形式の制御文をルールと言う。
もちろん、IF ( … IF (.... IF… ) ) ) のような入れ子構造の制御文も
ルールベースと呼ぶが、
ルールベースと言えば、基本的には、ルールを1つの単位として、
意思決定を行う、という意味となる。
207. 推論エンジン
A B C D E
T F F F F
T T F F F
T T F T F
T T T T F
T T T T T
F T T T T
F F F T T
……………………………
……………………………
…………………
T: True F: False
ID 0 : IF A THEN B
ID 1 : IF A && D THEN C
ID 3 : IF C THEN E
ID 4 : IF B THEN D
ID .. :
ID 4 : IF E THEN ~A
ルール内の条件部がtrueの時、そのルールが発火する(fired)
すると言う。発火したルールの宣言文は true となり、またそれ
が別のルールを発火させる。
発火をくり返して、true/False
が変化して行く様子
208. ルール制御
ID 0 : IF …. THEN …
ID 1 : IF …. THEN …
ID 3 : IF …. THEN ….
ID 4 : IF …. THEN …
ID .. :
ID 4 : IF …. THEN …
Priority: 3
Priority: 1
Priority: 4
Priority: 5
Priority: 2
ルールに固定、あるいは変動プライオリティ(優先度)をつけて制御を行う。
あるいはランダムにルールをピックアップする場合もある。戦略思考、キャラク
ターの挙動などでよく使われる。
Priority: -
制御
ルール= IF ( 行動条件文 ) then (動作命令文)
209. (例) ルール制御
ID 0 : IF …. THEN …
ID 1 : IF …. THEN …
ID 3 : IF …. THEN ….
ID 4 : IF …. THEN …
ID .. :
ID 5 : IF …. THEN …
Priority: 3Priority: 1
Priority: 4
Priority: 5
Priority: 2
或いは、状況判断思考によってルールを振り分ける。
戦略思考、キャラクターの挙動などでよく使われる。
Priority: -
制御
思考
ルール= IF ( 行動条件文 ) then (動作命令文)
210. 応用可能性例
http://gomibako.symphonic-net.com/vote.cgi?genre=act_b&rating=9
ID 0 : IF (敵確認) THEN (逆方向)
ID 1 : IF (誰もいない) THEN (ランダムウォーク)
ID 2 : IF (フルーツ発見) THEN (フルーツゲット)
ID 3 : IF (パワー発見) THEN (パワーゲット)
ID 0 : IF (敵強い) THEN (サンダガ)
ID 1 : IF (自分弱い) THEN (弱い敵に攻撃)
ID 2 : IF (HP<20) THEN (ケアル)
ID 3 : IF (パワー発見) THEN (パワーゲット)
こうなっているというのではなく、こういうふうに応用できる例
パックマンなど
RPGなど
211. The Sims 3 における応用
街全体をソーシャルにシミュレーションして人との関係を楽しむゲーム。
たくさんのAIを「人間らしく」制御しなければならない。
特徴付けにプロダクションルールを採用。
Richard Evans, "Modeling Individual Personalities in The Sims 3", GDC 2011
http://www.gdcvault.com/play/1012450/Modeling-Individual-Personalities-in-The
229. F.E.A.R.におけるゴール指向プランニング
Genre:Horror FPS
Developer: Monolith Production
Publisher : SIERRA
Hardware: Windows
Year: 2004
Agent Architecture Considerations for Real-Time Planning in Games (AIIDE 2005)
http://web.media.mit.edu/~jorkin/AIIDE05_Orkin_Planning.ppt
234. シンボル
kTargetAtme = ture
この兵士Bは自分を狙っているkTargetIsDead = ture
この兵士Aは死んだ
kWeaponIsLoaded = false
私Cの武器は装填済みでない
Jeff Orkin, “3 States and a Plan: The AI of F.E.A.R.",
http://web.media.mit.edu/~jorkin/gdc2006_orkin_jeff_fear.zip
270. プレイヤーたちの戦力 > 1.4 x エージェントたちの戦力
P
プレイヤーたちの戦力 < 1.4 x エージェントたちの戦力
本拠地へ
退却
戦闘!
クロムハウンズにおけるマルチエージェント技術
③ 戦闘判断 エージェントが周りの敵と味方の戦力を計算して
戦うべきか、逃げるべきかを判断する。
P
P
P
P
P
P
P P
戦力比が大きい無駄な戦闘を回避し、常に相手を上回る
戦力を増築してプレイヤーに対抗する
デバッグの過程で追加