• Tidak ada hasil yang ditemukan

Index of /Kuliah2016-2017/KecerdasanBuatanUntukGame

N/A
N/A
Protected

Academic year: 2017

Membagikan "Index of /Kuliah2016-2017/KecerdasanBuatanUntukGame"

Copied!
17
0
0

Teks penuh

(1)

Artificial Intelligence in

Game Design

(2)

Reactive Planning

Plan: Set of steps to accomplish some goal

Move to door Open door Enter room

– Can easily be done with state machine

Reactive planning:

Altering plan if steps not currently possible

– What if player locks door?

– What if player barricades door?

(3)

Reactive Planning

Decision-making process like tree

Possible courses of action may require many steps

– Decision trees just defined for single step

Door opens Enter room

Door

doesn’t

opens

Try breaking down door Get key

Try unlocking door

Door opens Enter room

Door

doesn’t

(4)

Behavior Trees

Designed for appearance of reactive planning

– Plans, contingencies actually scripted

Combine features of several representations

– Decision trees (unambiguous)

– Finite State Machines (hierarchical)

Often used to design games (Halo 2, etc.)

– Easy to translate into code

(5)

Tasks

Leaves of tree = tasks performed by NPC

Conditions: Is something currently true or not?

– Internal to character or external in world

– Ideally, can be quickly checked against game state

Door

open?

(6)

Tasks

Actions: Outputs/instructions to game engine

– Internal to character state

– External, often in form of firing animation

– Can fire other actions

(hear player  start path planning routine)

(7)

--Composites

Define how tasks combined

Sequence node: Execute tasks in given order

– Often involve tests at beginning to insure sequence can be completed

– Sequence halts and fails if any tasks fail

Door open?

Move(room)

Close door

(8)

Composites

Selector node: Try tasks in order until one

succeeds

– Multiple tasks with same goal

– Like if / else if/else if …/ else

– Best if last task always succeeds (like else)

Open door

Break down

door

Bang on

door

(9)

Decision Tree Structure

Example: Entering a room

– Problem: Player may have closed the door to prevent guard from entering

?

Door

open?

Move

(room)

Move

(door)

Open

door

(10)

Hierarchical Structure

Can nest to any level

– Usually alternate levels of selection, sequence

(11)

Translation into Code

Each task/node is subroutine that returns boolean

• Sequence node:

for each task T {

success = execute T

if (!success) return false }

return true

• Selector node:

for each task T {

success = execute T

if (success) return true }

(12)

Decorators

Used to modify structure of nodes below in tree

Common case: looping

– For limited number of times

– Until fail …

Open door

Break down

door

Bang on

door

?

(13)

Nondeterminism

Characters should not always take actions in

same order (appears scripted)

• Door locked

• Set fire to door: Get matches, get gasoline Barge door

Set fire to door

Don’t always

try the same

one first!

(14)

Partial-Order Planning

• Understand what steps must happen in a certain order

• Other steps can be done in any order

– Choose order randomly in those cases

Try

opening door

Try

unlocking door

Barge door

Set fire to door

Try in either order

Get matches

Get gasoline Pour gasoline on door

Ignite gasoline

(15)
(16)

Parallelism

Controls behavior for multiple characters

working towards common goal

– Each character has behavior subtree that runs in

parallel (usually implemented as concurrent threads)

– All characters exit tree when goal succeeds/fails

Charcter 1’s

task

Charcter 2’s

task

Charcter 3’s

task

(17)

Parallelism

• “Sequence” parallelism:

Exit (and fail) if any

thread fails

• “Selection” parallelism:

Exit (and succeed) if any

thread succeeds

Quaterback avoids rushers Reciever gets open   

Rifleman shoots at boss opponent

Grenadier throws grenade at boss

opponent

Referensi

Dokumen terkait

[r]

Demikian Berita Acara ini kami buat dengan penuh rasa tanggung jawab, untuk dapat dipergunakan sebagaimana mestinya.. Muara Sabak, 05 Juli

laporan laba rugi, laporan perubahan modal, neraca, arus kas, catatan atas laporan keuanganA. laporan laba rugi, laporan perubahan modal, arus kas, catatan atas

Sehubungan dengan hal tersebut di atas maka dengan hormat kami mengundang saudara untuk menghadiri acara pembuktian kualifikasi yang akan dilaksanakan pada :. Diharapkan

Paket pengadaan ini terbuka untuk penyedia yang teregistrasi pada Layanan Pengadaan Secara Elektronik ( LPSE ) dan memenuhi persyaratan memiliki : SIUJK Klasifikasi Bangunan

ATAS NAMA TERDAKWA KAMALUDIN Alias JEFRI Alias ABDUL HAMID Alias GILANG RIDHO.. KETUA MAHKAMAH AGUNG REPUBLIK

Sub Kompetensi : Mahasiswa dapat memahami konsep komponen simetris dan penggunaannya pada analisis sistem tenaga listrik. Indikator Pencapaian Kompetensi : Mahasiswa

menyatakan dengan sesungguhnya bahwa karya tulis ilmiah yang berjudul : “ Aplikasi Konsentrasi Bubur California dalam Biocoating terhadap Tingkat Serangan Busuk Buah