You are on page 1of 83

FORUM ILMIAH

XIV

AI in Games

ARIYADI
about.me
Outline




AI Games
: An Overview
What is Artificial
Intelligence (AI)
What do humans do with
games?



Computer Game Types









What is AI in Games?







Goals of Game AI












Do you know the
first AI Game who
can beats human
player?? What game
is it?
AI applied to games
Learning to play
board games
Beginning I: gaming
Beginning II: computer
gaming
Beginnings III: A field
forming




Computer Games: trends
and problems






Believability






Authenticity





Standard game AI
approaches









AI in Different Game
Types




AI in FPS-type Games









21
AI in FPS-type Games Cont.









22
Representation of the
World in an FPS-type Game

23
AI in RTS-type Games








24
AI in RTS-type Games
Cont.


25
Representation of the
World in an RTS-type Game

26
AI in RPG-type Games





27
AI in Sports Games










• 28
AI in Sports Games Cont.


29
Research trees in AI Games


Why shall we apply CI
(evolutionary) methods to
games?








What is the use of CI
(evolutionary) methods in
games research?


Lucas/Kendall 2006 “Evolutionary Computation and Games”,


IEEE Computational Intelligence Magazine
Games as AI
testbeds/benchmarks
Why games are good
testbeds?





Car Setup Optimization:
EvoStar







Car Setup Optimization:
Which parameters?













Car Setup Optimization:
Framework
Games as testbed:
a closing balance











Why AI can improve games


Why AI can’t improve games







Evolutinary Design of NPC







Racing Lines:
the problem
Racing Lines:
Standard approach
Racing Lines:
evolutionary approach
Evolving Game Content





Evolving FPS Maps



Evolving Racing Tracks





Examples
AI Competition




Develop your own game
(Unity 3D)











http://www.unity3d.com
HOT TOPICS











Where are we going?





Previous Research
LATAR BELAKANG

Gambar 1. Tingkat Kesulitan


(http://kingdomrushtd.wikia.com/wiki/Difficulty)
PENDEKATAN YANG
DIAJUKAN


TUJUAN


Real-Time

LINGKUP
Strategy
Strategy Games

PENELITIAN
Turn-Based
Map Strategy

Strategy Game
Generation

Tower
Defense

Resource
Element Management
Generation

Creep
Offense

Current Genetic
Affective Research
Personal NSGA-II
Algorithm
Gaming
Assumption
Dynamic
Difficulty Optimization
Multi
Single
Objective
Desirable

Adjustment
Necessary
Method
Objective

Dynamic Optimization
Difficulty Method
Adjustment

Gambar 2. Diagram Venn Cakupan Penelitian


KAJIAN PUSTAKA: THEORY
OF FUN

Gambar 3. Grafik Visual dari Flow (http://www.nuhs.edu/christian/2011/7/6/flow/)


[1] Nakamura, J., & Csikszentmihalyi, M, (2002), “The concept of flow”. Handbook of positive psychology, hal. 89 - 105.
Dynamic Difficulty
Adjustment (DDA)


[2] R. Hunicke dan V. Chapman, (2004), “AI for Dynamic Difficulty Adjustment in Games”, Challenges in Game Artificial Intelligence AAAI Workshop, hal. 91–96.
NSGA-II
Evaluasi Fungsi
Populasi Awal Peringkat populasi
Obyektif

Ya Tidak
Solusi Pareto-Optimal Kriteria Stop? Seleksi

Offsprings
Pilih N individu Persilangan

Elitism
Peringkat populasi Mutasi

Gabungkan populasi Evaluasi Fungsi


parents dan offsprings Obyektif

Gambar 4. Diagram Alir NSGA-II


DIAGRAM Tower Defense

FISHBONE
EVOLUSI
CREEP
Tower

Creep Evolution
Personal Assumption

Gambar 5. Diagram Fishbone Penelitian


TOWER DEFENSE
KOMERSIAL
Game Manager Path

Creep

Tower

Gambar 6. Kingdom Rush


(http://appadvice.com/appnn/2012/06/now-on-iphone-kingdom-rush-could-be-the-perfect-tower-defense-game)
GAME TEST-BED
Tower Manager

Game Manager
Tower Info Box

Tower

Creep

Creep Info Box


Map

Gambar 7. Infinite Tower Defense


(Julian Togelius dkk., Computational Intelligence and Tower Defence(2011))
BLOCK DIAGRAM Choose Random
Individual for
Initial Wave

Player Tower Placement Creep Wave

Evolving Process
using NSGA-II

No Towers Dominate
Creeps?

Game Environment
Yes

Get DDA
Parameter from
current wave

Gambar 8. Blok Diagram Tower Defense


GEN CREEP

8 Gen Creep
Creep Spawn Immune
Flying? Speed Hitpoints Armor Boss?
Size Delay? ?

Decision Variable
Gambar 9. Gen Creep pada Infinite Tower Defense
Flow model

Penyerangan creep agen


agen terlalu kuat

Flow

pemain terlalu kuat

Strategi tower pemain

Gambar 6. Flow Model DDA dengan NSGA-II


PARAMETER DDA


𝑑𝑒𝑎𝑡ℎ𝐶𝑟𝑒𝑒𝑝/𝑐𝑟𝑒𝑒𝑝𝑆𝑖𝑧𝑒
𝑒𝑣𝑜𝑃𝑜𝑖𝑛𝑡 = 1800 ∗ 1 +
2

𝑒𝑣𝑜𝑃𝑜𝑖𝑛𝑡
𝑑𝑒𝑎𝑑𝐶𝑟𝑒𝑒𝑝
𝑐𝑟𝑒𝑒𝑝𝑠𝑖𝑧𝑒
EVALUASI OBYEKTIF (1)


EVALUASI OBYEKTIF (2)

𝑠𝑢𝑟𝑣𝑖𝑣𝑒𝐶𝑟𝑒𝑒𝑝 𝑐𝑝
𝑠𝑖𝑚𝐶𝑟𝑒𝑒𝑝 = +
𝑐𝑟𝑒𝑒𝑝𝑠𝑖𝑧𝑒 𝑝𝑙

𝑠𝑖𝑚𝐶𝑟𝑒𝑒𝑝
𝑠𝑢𝑟𝑣𝑖𝑣𝑒𝐶𝑟𝑒𝑒𝑝
𝑐𝑟𝑒𝑒𝑝𝑠𝑖𝑧𝑒
𝑐𝑝
𝑝𝑙
FUNGSI OBYEKTIF

• Max(𝑓1 , 𝑓2 , … , 𝑓𝑁 )

𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 𝑓 𝑠𝑝𝑒𝑒𝑑 = 𝑠𝑝𝑒𝑒𝑑 ∗ 𝑠𝑖𝑚𝐶𝑟𝑒𝑒𝑝


൞𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 𝑓 ℎ𝑖𝑡𝑝𝑜𝑖𝑛𝑡𝑠 = ℎ𝑖𝑡𝑝𝑜𝑖𝑛𝑡𝑠 ∗ 𝑠𝑖𝑚𝐶𝑟𝑒𝑒𝑝
𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒 𝑓 𝑎𝑟𝑚𝑜𝑟 = 𝑎𝑟𝑚𝑜𝑟 ∗ 𝑠𝑖𝑚𝐶𝑟𝑒𝑒𝑝
FUNGSI OBYEKTIF (2)
𝑠𝑝𝑒𝑒𝑑𝐺𝑒𝑛𝑒
𝑠𝑝𝑒𝑒𝑑 = ∗ 𝑠𝑝𝑒𝑒𝑑𝑀𝑜𝑑 ∗ 𝑝𝑝𝑐
𝑤𝑒𝑖𝑔ℎ𝑡
ℎ𝑖𝑡𝑝𝑜𝑖𝑛𝑡𝑠𝐺𝑒𝑛𝑒
ℎ𝑖𝑡𝑝𝑜𝑖𝑛𝑡𝑠 = ∗ ℎ𝑖𝑡𝑝𝑜𝑖𝑛𝑡𝑠𝑀𝑜𝑑 ∗ 𝑝𝑝𝑐
𝑤𝑒𝑖𝑔ℎ𝑡
𝑎𝑟𝑚𝑜𝑟𝐺𝑒𝑛𝑒
𝑎𝑟𝑚𝑜𝑟 = ∗ 𝑎𝑟𝑚𝑜𝑟𝑀𝑜𝑑 ∗ 𝑝𝑝𝑐
𝑤𝑒𝑖𝑔ℎ𝑡
𝑠𝑢𝑟𝑣𝑖𝑣𝑒𝐶𝑟𝑒𝑒𝑝 𝑐𝑝
𝑠𝑖𝑚𝐶𝑟𝑒𝑒𝑝 = +
𝑐𝑟𝑒𝑒𝑝𝑠𝑖𝑧𝑒 𝑝𝑙
FUNGSI OBYEKTIF (3)
𝑆𝑢𝑏𝑗𝑒𝑐𝑡 𝑡𝑜 𝑤𝑒𝑖𝑔ℎ𝑡 = 𝑠𝑝𝑒𝑒𝑑𝐺𝑒𝑛𝑒 + ℎ𝑖𝑡𝑝𝑜𝑖𝑛𝑡𝑠𝐺𝑒𝑛𝑒 + 𝑎𝑟𝑚𝑜𝑟𝐺𝑒𝑛𝑒
𝑠𝑝𝑒𝑒𝑑𝑀𝑜𝑑 = 0.0625
ℎ𝑖𝑡𝑝𝑜𝑖𝑛𝑡𝑠𝑀𝑜𝑑 = 3
𝑎𝑟𝑚𝑜𝑟𝑀𝑜𝑑 = 4
𝑒𝑣𝑜𝑃𝑜𝑖𝑛𝑡
𝑝𝑝𝑐 =
𝑐𝑟𝑒𝑒𝑝𝑠𝑖𝑧𝑒
𝑐𝑟𝑒𝑒𝑝𝑠𝑖𝑧𝑒 = 𝑐𝑟𝑒𝑒𝑝𝑠𝑖𝑧𝑒𝐺𝑒𝑛𝑒 ∗ 20 + 1
0 ≤ {𝑐𝑟𝑒𝑒𝑝𝑠𝑖𝑧𝑒𝐺𝑒𝑛𝑒, 𝑠𝑝𝑒𝑒𝑑𝐺𝑒𝑛𝑒, ℎ𝑖𝑡𝑝𝑜𝑖𝑛𝑡𝐺𝑒𝑛𝑒, 𝑎𝑟𝑚𝑜𝑟𝐺𝑒𝑛𝑒} ≤ 1
KONFIGURASI SIMULASI

Keterangan Nilai

Populasi 100

Generasi 100

Probabilitas Persilangan 1

Probabilitas Mutasi 1/n

Indeks Distribusi Persilangan 20

Indeks Distribusi Mutasi 20


HASIL SIMULASI

(a) (b) (c) (d)

Gambar 7. Hasil Simulasi dengan Parameter di dalam Permainan (a) Generasi ke-1
(b) Generasi ke-5 (c) Generasi ke-10 (d) Generasi ke-20
VIDEO PERMAINAN
HASIL PENGUJIAN
(KONSTANTA DDA)

Evolution points dalam 10 wave
35000

30000

25000
900
20000 1200
1800
15000
2200
2700
10000

5000

0
1 2 3 4 5 6 7 8 9 10
GRAFIK DDA

GRAFIK EVOPOINT
50000

45000

40000

35000

30000
EVOPOINT

25000
Pemain Pemula
20000 Pemain Berpengalaman

15000

10000

5000

0
1 2 3 4 5 6 7 8 9 10
LEVEL PERMAINAN
HASIL PENGUJIAN
(PERUBAHAN PARAMETER)
• Skenario pengujian ini memberikan penekanan (dominasi) kepada Hitpoints
• Hitpoints yang diambil memiliki nilai gen lebih dari 0.7

Speed Hitpoints Armor

1.070 44 400
0.966 295 139
2.58 443 343
2.24 445 206
7.19 551 393
KESIMPULAN


Future Research
Wise Words

You might also like