52. IF ( 前置宣言文 ) then (後置宣言文)
ルールベース意思決定
Rule-based Decision Making
ルール
ここでは、この形式の制御文をルールと言います。
もちろん、IF ( … IF (.... IF… ) ) ) のような入れ子構造の制御文も
ルールベースと呼びますが、
ルールベースと言えば、基本的には、ルールを一つの単位として、
意思決定を行う、という意味です。
53. 推論エンジン
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
が変化して行く様子
54. ルール制御
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 (動作命令文)
55. (例) ルール制御
ID 0 : IF …. THEN …
ID 1 : IF …. THEN …
ID 3 : IF …. THEN ….
ID 4 : IF …. THEN …
ID .. :
ID 5 : IF …. THEN …
Priority: 3
Priority: 1
Priority: 4
Priority: 5
Priority: 2
或いは、状況判断思考によってルールを振り分ける。
戦略思考、キャラクターの挙動などでよく使われる。
Priority: -
制御
思考
ルール= IF ( 行動条件文 ) then (動作命令文)
56. 応用可能性例
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など
57. 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
62. The Sims シリーズのAIの作り方
人をダイナミクス(力学系、動的な数値の仕組み )として動かす。
世界を動かす PeerAI(=キャラクターAI) を構築。
Sub
Peer
Meta
Meta
Peer
Sub
[原則] 周囲の対象に対する、あらゆる可能な行動から、
ムード(幸せ) 係数を最大化する行動を選択する。
Sims (not under direct player control) choose what to do by selecting, from all of the
possible behaviors in all of the objects, the behavior that maximizes their current happiness.
Will Wright, AI: A Design Perspective (AIIDE 2005)
http://www.aaai.org/Papers/AIIDE/2005/AIIDE05-041.ppt
Kenneth Forbus, Will Wright, “Some notes on programming objects in The Sims – Example”
http://www.qrg.cs.northwestern.edu/papers/Files/Programming_Objects_in_The_Sims.pdf
63. オブジェクトに仕込むデータ構造
Data (Class, Sate)
Graphics (sprites, z-
buffers)Animations (skeletal)
Sound Effects
Code (Edith)
-Main (object thread)
-External 1
-External 2
-External 3
パラメーター
グラフィックス
アニメーション
サウンド
メインスレッド
いろいろなインタラクションの仕方
Ken Forbus, “Simulation and Modeling: Under the hood of The Sims” (NorthWerstern大学、講義資料) ※IEで見てください。
http://www.cs.northwestern.edu/%7Eforbus/c95-gd/lectures/The_Sims_Under_the_Hood_files/frame.htm
Kenneth Forbus, Will Wright, “Some notes on programming objects in The Sims – Example”
http://www.qrg.cs.northwestern.edu/papers/Files/Programming_Objects_in_The_Sims.pdf
64. The Sims における「モチーフ・エンジン」
Ken Forbus, “Simulation and Modeling: Under the hood of The Sims” (NorthWerstern University)
http://www.cs.northwestern.edu/%7Eforbus/c95-gd/lectures/The_Sims_Under_the_Hood_files/frame.htm
Data
- Needs
- Personality
- Skills
- Relationships Sloppy - Neat
Shy - Outgoing
Serious - Playful
Lazy - Active
Mean - Nice
Physical
- Hunger
- Comfort
- Hygiene
- Bladder
Mental
- Energy
- Fun
- Social
- Room
Motive Engine
Cooking
Mechanical
Logic
Body
Etc.
AIの人格モデル
69. 限界効用逓減の法則
X_Hunger
W_Hunger(-80)
-80 60
W_Hunger(60)
Δ(-80 → 60)=W_Hunger(60)*(60) - W_Hunger(-80)*(-80)
Δ (60→90) =W_Hunger(90)*(90) - W_Hunger(60)*(60)
90
W_Hunger(90)
Δ(-80 → 60) is much larger than Δ(60→90)
ある程度満たされたものを満たすより、
満たされないものをある程度満たす方が大きな満足をもたらす
Utility for hunger
ビールは一杯目が一番おいしい
70. The Sims のAIの原理
三宅陽一郎、「Spore におけるゲームAI技術とプロシージャル」 (DiGRA Japan 第14回 月例研究
http://digrajapan.org/?wpdmact=process&did=Ni5ob3RsaW5r
Ken Forbus, “Simulation and Modeling: Under the hood of The Sims” (NorthWerstern大学、講義資料)
http://www.cs.northwestern.edu/%7Eforbus/c95-gd/lectures/The_Sims_Under_the_Hood_files/frame.htm
Richard Evans, Modeling Individual Personalities in The Sims 3, GDC 2010
http://www.gdcvault.com/play/1012450/Modeling-Individual-Personalities-in-The
71. The Sims 3 では、多くのムードや欲求が準備される。
行動 対象
GDC09 資料 http://www.gdcvault.com/play/1452/(307)-Breaking-the-Cookie-Cutter
78. 古典: 中央集権型(Central domain)
すべての知的プロセスが
順番に実行
サブサンプション : 並列 & 多層化
すべての知的プロセスが、
並列に実行
Rodney Brooks, A robust layered control system for a mobile robot
Robotics and Automation, IEEE Journal of (Volume:2 , Issue: 1 ) 1986
119. いろいろな世界表現
ナビメッシュ-ウェイポイント
階層表現
LOS マップ
戦術マップクラスタリング
敵配位マップ テリトリー表現
Tactical Point System
Halo2Killzone
Killzone2Halo Assassin’s Creed
Left 4 Dead
Alex J. Champandard, Remco Straatman, Tim Verweij, "On the AI Strategy for KILLZONE 2's Bots”
http://aigamedev.com/open/coverage/killzone2/
Damian Isla,"Building a Better Battle: HALO 3 AI Objectives",
http://halo.bungie.net/inside/publications.aspx
Michael Booth, "The AI Systems of Left 4 Dead," Artificial Intelligence and Interactive Digital Entertainment
Conference , http://www.valvesoftware.com/company/publications.html
121. Halo2 :世界表現
Dude, Where's My Warthog: From Pathfinding to General Spatial Competence, D. Isla, Invited talk, Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2005 http://naimadgames.com/publications.html
122. Dude, Where's My Warthog: From Pathfinding to General Spatial Competence, D. Isla, Invited talk, Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2005
http://naimadgames.com/publications.html
Halo2 :世界表現
123. Halo2 :世界表現
Dude, Where's My Warthog: From Pathfinding to General Spatial Competence, D. Isla, Invited talk, Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2005
http://naimadgames.com/publications.html
124. Halo2 :世界表現
Dude, Where's My Warthog: From Pathfinding to General Spatial Competence, D. Isla, Invited talk, Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2005
http://naimadgames.com/publications.html
125. Halo2: 世界表現
Dude, Where's My Warthog: From Pathfinding to General Spatial Competence, D. Isla, Invited talk, Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2005
http://naimadgames.com/publications.html
126. Halo2: 世界表現
Dude, Where's My Warthog: From Pathfinding to General Spatial Competence, D. Isla, Invited talk, Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2005
http://naimadgames.com/publications.html
127. Halo2: 世界表現
Dude, Where's My Warthog: From Pathfinding to General Spatial Competence, D. Isla, Invited talk, Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2005
http://naimadgames.com/publications.html
128. Halo2: 世界表現
Dude, Where's My Warthog: From Pathfinding to General Spatial Competence, D. Isla, Invited talk, Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2005
http://naimadgames.com/publications.html
129. Halo2: 世界表現
Dude, Where's My Warthog: From Pathfinding to General Spatial Competence, D. Isla, Invited talk, Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2005
http://naimadgames.com/publications.html
130. Counter Strike : Navigation Mesh
世界表現
Dude, Where's My Warthog: From Pathfinding to General Spatial Competence, D. Isla, Invited talk, Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2005
http://naimadgames.com/publications.html
133. オブジェクト表現
これが車である
この方向に押せば動く
Dude, Where's My Warthog: From Pathfinding to General Spatial Competence, D. Isla, Invited talk, Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2005
http://naimadgames.com/publications.html
171. 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