37. Age of Empires III における地形自動生成
西川善司, 「3DゲームファンのためのAGE OF EMPIRESエンジン講座(後編)こだわりの影生成と算術合成
されるディテール、次回作はXbox2?」, GAME Watch, 2005
38. References
(1) Jacob Olsen,Realtime Procedural Terrain Generation
http://oddlabs.com/download/terrain_generation.pdf
(2) Ken Musgrave
http://www.kenmusgrave.com
(3) Terragen(Planetside Software)
http://www.planetside.co.uk/terragen
(4) Introversion Software, "Procedural Content Generation",
GameCareerGuide.com, 2007
http://www.gamecareerguide.com/features/336/procedural_content_.php
(5)西川善司, 「3DゲームファンのためのAGE OF EMPIRESエンジン講座(後
編)こだわりの影生成と算術合成されるディテール、次回作はXbox2?」,
GAME Watch, 2005
http://watch.impress.co.jp/game%2Fdocs/20050313/aoe3.htm
Figures on the pages are from these references.
40. 植物自動生成
Since 1968 A. Lindenmayer
L-system 文法規則 構成要素 F,+,-,[,]
規則 F F[-F]F[+F][F]
F
0世代 1世代
F[-F]F[+F][F] F[-F]F[+F][F][- F[-F]F[+F][F]] F[-F]F[+F][F][+ F[-F]F[+F][F]][F[-F]F[+F][F]]
2世代
F - まっすぐ進む
+ 30度左回転 ー 30度右回転 []内は個別のスタック
解釈
研究分野としては
人工生命、CGにまたがる
41. 植物自動生成
Since 1968 A. Lindenmayer
L-system 文法規則
構成要素 F,+,-,[,]
規則 F-> F[-F]F[+F][F]
F
0世代 1世代
F[-F]F[+F][F]
2世代 3世代 4世代 5世代
Simulating plant growth by Marco Grubert http://www.acm.org/crossroads/xrds8-2/plantsim.html
42. The Sketch L-System:
Global Control of Tree Modeling Using Free-form
Strokes
Takashi Ijiri, Shigeru Owada, Takeo Igarashi.
The Sketch L-System:
Global Control of Tree Modeling Using Free-form Strokes
http://www-ui.is.s.u-tokyo.ac.jp/~ijiri/SketchLSystem/index.html
L-system を用いて簡単な操作で木のモデルを作成するツール
43. デモ
The Sketch L-system
SG06_SketchLSystem
Takashi Ijiri, Shigeru Owada, Takeo Igarashi.
The Sketch L-System: Global Control of Tree Modeling Using Free-form Strokes
http://www-ui.is.s.u-tokyo.ac.jp/~ijiri/SketchLSystem/index.html
44. 発展:確率的 L-system
構成要素 F,+,-,[,]
規則 F -> F[+F]F[-F]F 0.33
F -> F[+F]F 0.33
F -> F[-F] 0.33
植物以外に使えないだろうか? じっと見る
Simulating plant growth by Marco Grubert http://www.acm.org/crossroads/xrds8-2/plantsim.html
規則を変えればいろいろな模様が自動的に生成される
45. L-system によるダンジョン自動生成(三宅案)
variables : X Y F
constants : + −
start : FX
rules : (X → X+YF+),(Y → -FX-Y)
angle : 90°
http://en.wikipedia.org/wiki/L-system
46. L-system による街の自動生成
City Engine(central pictures)
Yoav I H Parish, Pascal Müller
http://www.centralpictures.com/ce/tp/paper.pdf
http://www.centralpictures.com/ce/
George Kelly, Hugh McCabe,
A Survey of Procedural Techniques for City Generation
http://www.gamesitb.com/SurveyProcedural.pdf
50. References
(1) Simulating plant growth by Marco Grubert
http://www.acm.org/crossroads/xrds8-2/plantsim.html
(2) L-System Wiki
http://en.wikipedia.org/wiki/L-system
(3) The Sketch L-System:
Global Control of Tree Modeling Using Free-form Strokes
http://www-ui.is.s.utokyo.ac.jp/~ijiri/SketchLSystem/index.html
(4) Yoav I H Parish, Pascal Müller
http://www.centralpictures.com/ce/tp/paper.pdf
(5) City Engine(central pictures) http://www.centralpictures.com/ce/
(6) George Kelly, Hugh McCabe,
A Survey of Procedural Techniques for City Generation
http://www.gamesitb.com/SurveyProcedural.pdf
Figures on following pages are from these references.
84. ⑤ニューラルネットワークの構造が進化させる
「NEAT」の技術
Mat Buckland, Chapter 11, AI techniques for game programming, Premier Press, 2002
(実行ファイルとソースコードがCD-ROMにあります)
これまでニューラルネットは、最初に構造を定義した後は変化しなかった。
動的にニューラルネットの構造を変化させる技術
Neuron Evoluation of Augmenting Topologies (NEAT)
85. NEAT
回路の構成を遺伝子コードで表現する。
Weight: 1.2
From: 1
To: 3
Enabled: Y
Recurrent: N
Innovation: 1
Weight: -3
From: 1
To: 4
Enabled: Y
Recurrent: N
Innovation: 6
Weight: 0.7
From: 2
To: 4
Enabled: Y
Recurrent: N
Innovation: 2
Weight: -2.1
From: 3
To: 4
Enabled: Y
Recurrent: N
Innovation: 6
Weight: 1.1
From: 3
To: 5
Enabled: N
Recurrent: N
Innovation: 3
Weight: 0.8
From: 4
To: 5
Enabled: Y
Recurrent: N
Innovation: 4
Weight: -1
From: 5
To: 3
Enabled: Y
Recurrent: Y
Innovation: 7
ID: 1
Type: Input
ID: 2
Type: Input
ID: 3
Type: hidden
ID: 4
Type: hidden
ID: 5
Type: Output
2
1
4
3
5
つなぎ方を定義する遺伝子
ニューロンを定義する遺伝子
入力 出力
86. NEAT
回路の構成を遺伝子コードで表現する。
Weight: 1.2
From: 1
To: 3
Enabled: Y
Recurrent: N
Innovation: 1
Weight: -3
From: 1
To: 4
Enabled: Y
Recurrent: N
Innovation: 6
Weight: 0.7
From: 2
To: 4
Enabled: Y
Recurrent: N
Innovation: 2
Weight: -2.1
From: 3
To: 4
Enabled: Y
Recurrent: N
Innovation: 6
Weight: 1.1
From: 3
To: 5
Enabled: N
Recurrent: N
Innovation: 3
Weight: 0.8
From: 4
To: 5
Enabled: Y
Recurrent: N
Innovation: 4
Weight: -1
From: 5
To: 3
Enabled: Y
Recurrent: Y
Innovation: 7
ID: 1
Type: Input
ID: 2
Type: Input
ID: 3
Type: hidden
ID: 4
Type: hidden
ID: 5
Type: Output
2
1
4
3
5
リンク(つなぎ方)を定義する遺伝子
ニューロンを定義する遺伝子
Innovation ID によってリンク、
ニューロンを全遺伝子共通の管理す
る。
無効
入力 出力
152. 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
153. 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の人格モデル
172. 全体の流れ
Beats システム
Michael Mateas and Andrew Stern
Façade: An Experiment in Building a Fully-Realized Interactive Drama
Game Developers Conference, Game Design track, March 2003
173. ドラマ・ジェネレーター 「Facade」
sequential behavior AnswerTheDoor()
{
WME w;
with (success test f w = (KnockWME) g )
wait;
act sigh();
subgoal OpenDoor();
subgoal GreetGuest();
mental act f deleteWME(w); }
sequential behavior OpenDoor() {
precondition {
(KnockWME doorID :: door)
(PosWME spriteID == door pos :: doorPos)
(PosWME spriteID == me pos :: myPos)
(Util.computeDistance(doorPos, myPos) > 100)
}
speci¯city 2;
// Too far to walk, yell for knocker to come in
subgoal
YellAndWaitForGuestToEnter(doorID);
}
sequential behavior OpenDoor() {
precondition { (KnockWME doorID :: door) }
speci¯city 1;
// Default behavior - walk to door and
open }
振る舞い
ゴール
振る舞い
ゴール
振る舞い
ゴール行動
振る舞い
ゴール行動 行動
条件判定
条件判定
ゴールシステム
" Michael Mateas and Andrew Stern A Behavior Language for Story-based Believable Agents", appeared in Artificial Intelligence and Interactive Entertainment,
AAAI symposium, March 2002
174. ドラマ・ジェネレーター 「Facade」
Interactive Story
協調の仕方
ゴール
Member:
Trips ,Grace
Mission
酒を進める
( Tripsの役割
Grace の役割))
The wogglesのAI
でも使われた方法
Trip Grace
ゴールが2人のエージェントに打診
Trips はこのミッションの役割を
受けられる状態にあるか?
Graceはこのミッションの役割を
受けられる状態にあるか?
サブゴール サブゴール
両方が Yes なら
Michael Mateas and Andrew Stern A Behavior Language: Joint Action and Behavioral Idioms
175. ドラマ・ジェネレーター 「Facade」
Interactive Story
協調の仕方
joint sequential behavior OfferDrink() {
team Grace, Trip;
// The steps of Grace’s and Trip’s
OfferDrink()
// behaviors differ.
}
joint sequential behavior
OfferDrink() {
team Trip, Grace;
// wait for Trip to say first line
with (success_test { OfferDrinkMemory
(CompletedGoalWME name ==
iInitialDrinkOffer
status == SUCCEEDED)})
wait;
subgoal iLookAtPlayerAndWait(0.5);
// react to Martini suggestion
with (synchronize) subgoal
jSuggestMartini();
with (synchronize) subgoal
jFancyCocktailShakers();
}
joint sequential behavior
OfferDrink() {
team Trip, Grace;
with (post-to
OfferDrinkMemory)
// Individual behavior for
initial offer
subgoal
iInitialDrinkOffer();
subgoal
iLookAtPlayerAndWait(0.5);
with (synchronize) subgoal
jSuggestMartini();
// react to Grace’s line
about fancy shakers
with (synchronize) subgoal
jFancyCocktailShakers();
GraceTrip
(At the beginning of the behavior, Trip starts walking
to the bar. If he gets to the bar before the end of the
behavior, he stands behind it while delivering lines.)
Trip: A beer? Glass of wine? (Grace smiles at
player. Short pause)
Trip: You know I make a mean martini. (Grace
glances at Trip with slight frown partway into line.
At the end of line, rolls her eyes at the ceiling.)
Grace: (shaking her head, smiling) Tch, Trip just
bought these fancy new cocktail shakers. He’s
always looking for a chance to show them off. (If
Trip is still walking to the bar, he stops at “shakers”.
At “shakers” Trip looks at Grace and frowns slightly.
At the end of the line he looks back at player and
smiles. If he was still on the way to the bar, he
resumes walking to the bar).
ドラマ生成
" Michael Mateas and Andrew Stern A Behavior Language for Story-based Believable Agents", appeared in Artificial Intelligence and Interactive Entertainment, AAAI symposium, March 2002