Laboratorio di Design I

Transcript

Laboratorio di Design I
Laboratorio di Design I
Diletta Romana Cacciagrano
Assistant Professor
Computer Science Section - UNICAM
[email protected]
SU
SUMMARY
HW‐based Evolution of (Video) Games
HW‐based Evolution of (Video) Games
Serious Game
Serious Game
Game Design
Game Design
Evolution of Artificial Intelligence In (Video) Games
g
(
)
h q
( d )
AI Techniques in (Video) Games
INTELLIGENZA
ARTIFICIALE
umano
pensiero
azione
razionale
Sistemi che pensano
come umani
Sistemi che pensano
razionalmente
Sistemi che agiscono
come umani
Sistemi che agiscono
razionalmente
Lo studio di sistemi di IA nei videogiochi riguarda la
creazione e la gestione di NPC: Non Playing Characters
³/¶,$qXQPRGRSHUIDUIDUHDLFRPSXWHUFRVHFKHsembrino LQWHOOLJHQWL´
Peter Molyneux
MODELLO
PREREGISTRATO
|
Riproduce il movimento di un oggetto dinamico.
|
Nel caso di Space Invaders O¶,$GHLQHPLFL
risponde a tre righe di pseudo-codice:
z
z
z
|
1. Continua a spostarti nella direzione
corrente (destra o sinistra).
2. Quando raggiungi il bordo dello schermo,
cambia direzione e spostati verso il basso
GHOO¶DOWH]]DGLXQDFHOOD
3. Torna a 1.
In un sistema di IA possono essere inseriti diversi
modelli, attivati in base alla posizione del giocatore
e selezionati casualmente per ogni entità sintetica,
in modo da creare situazioni di gioco più complesse
ed imprevedibili.
IMPLEMENTARE
UN SISTEMA DI IA [1]
|
Il SISTEMA ESPERTO tenta di
catturare il dominio di conoscenze
proprie di un esperto umano in un
determinato settore: la risoluzione
di un problema avviene andando
alla ricerca di corrispondenze nel
database di informazioni relative a
quel settore.
IMPLEMENTARE
UN SISTEMA DI IA [2]
|
Le MACCHINE A STATI FINITI pDVVDQRGDXQRVWDWR
DOO¶DOWUo in base all'input ricevuto e in accordo a variabili
UHODWLYHDPELHQWHGL gioco.
‡
‡
‡
‡
Se il giocatore è vicino il NPC passa allo stato codificato dal Modello;
Se il giocatore non è vicino il NPC gli dà la caccia utilizzando lo stato Inseguimento;
Se il giocatore sta colpendo il NPC, questo passa allo stato Fuga;
Se non si verifica nessuna di queste condizioni è attivato uno stato di Movimento
Casuale.
z
Controllo preventivo dello stato: consente alla MSF di
passare allo stato successivo prima di portare a termine
quello corrente.
z
Unità differenti si devono comportare in maniera altrettanto
differente, presentando molteplici stati e diverse
probabilità che ciascuno di questi venga attivato.
z
È possibile dotare ogni singola entità di memoria e
apprendimentoRYYHURGHOODFDSDFLWjGLXVDUHO¶HVSHULHQ]D
del passato per risolvere nuovi problemi (tenendo traccia
del valore di una variabile e usare questo valore nelle
funzioni di selezione e implementazione degli stati).
|
Una RETE NEURALE agisce dal basso
YHUVRO¶DOWRqLQIDWWLFRPSRVWDGLXQLWj
(dotate di livello di attivazione) e
connessioni (ciascuna associata ad un
peso). Dato un input sensoriale, la rete è
LQJUDGRGLSURGXUUHO¶RXWSXW
corrispondente basandosi semplicemente
sulla computazione effettuata da ogni
singola unità, conseguenza degli input
delle unità vicine.
z
Output
unità
nascoste
unità di
output
Mentre un sistema esperto dispone già di
tutte le informazioni necessarie, una rete
QHXUDOHGHYHHVVHUH³LVWUXLWD´WUDPLWHOD
FRUUH]LRQHGHOO¶HUURUH
unità di
input
Input
sensoriali
Galapagos
&RUUH]LRQHGHOO¶HUURUH
IMPLEMENTARE
UN SISTEMA DI IA [3]
Creatures 4
IMPLEMENTARE
UN SISTEMA DI IA [4]
AGENTI
Conway e Gosper
1.
$OO¶LQWHUQRGHOODJULJOLDFKHUDSSUHVHQWD
O¶DPELHQWHXQDFDVHOODVLDWWLYDVHVRQR
attivate 3 delle sue vicine.
2.
Una casella rimane attiva solo se sono
attive 2 o 3 delle caselle vicine, altrimenti
si spegne.
1° generazione
2° generazione
3° generazione
IMPLEMENTARE
UN SISTEMA DI IA [..]
Pongg
Pong
• O
One of the First Video f h Fi Vid
Games
• Manufactured by Atari
Manufactured by Atari
• Released in 1972
Released in 1972
• Designed for 1 or 2 players.
D ig d f 1 2 pl y
• Essentially just table tennis Essentially
ll just table
bl tennis
i 2d
in 2 dimensions.
di e sio s.
Th AI off P
The
The AI of Pong
Pongg
• There
There is Logic to how the h
i Logic
is
i to h
how the
h
C p
Computer moves the paddle.
h p ddl
• The computer predicts where The computer predicts where
the ball with end up based on a
the ball with end up based on a number of factors then moves
number of factors then moves the
the paddle to that predicted h paddle
ddl to that
h predicted
di d
l ti
location.
• To simulate Human error the To simulate Human error the
computer is designed to skip its
computer is designed to skip its adjustment
adjustment every 8 frames.
d
every 8 fframes.
P M
Pac‐Man
• Developed
Developed by Namco by Namco
• Distributed by Midway (in Distributed by Midway (in
US)
• Released: 1980
R l
d 1980
• Single player only
Single player only
• Simple maze game
Simple maze game
Gh t
Ghosts
• While
While the Ghosts appear to move in a random order this is the Ghosts appear to move in a random order this is
not always
not always the case. As each Ghost has its own Algorithm l
the
h case. As each
h Ghost
h has
h its own Algorithm
l
h
to control its actions.
li
i
Chases Pac‐Man
Chases Pac
Man
Try to get iin ffront off Pac‐Man
Try to get in front of Pac
Man
Mo es att Ra do
Moves at Random*
d *
S p Mario
Super
Super Mario Bros.
M i Bros
B
• Developed
Developed by Nintendo
l
d by
b Nintendo
i
d
• Released in 1985
Released in 1985
• Classic example of the Classic example of the
Platformer
S ipt d AI
Scripted
Scripted AI
• Enemy
Enemy units in the game units
i iin the
h game
are designed to follow a d ig d f ll
scripted pattern.
ipt d p tt
• Either move back and forth Either move back and forth
in a given location or attack
in a given location or attack a player
a player if nearby
l
if nearby
b
• Became a staple technique Became a staple technique
for AI design
for AI design.
Si City
Sim
City
•
•
•
•
Developed by Maxis
Developed
l
d by
b Maxis
i
Published by Electronic Arts
Published by Electronic Arts
Released in 1989
Released in 1989
Fi i
First in a series of i
f
Si l ti G
Simulation Games which hi h
are often at the forefront of ft
t th f f t f
AI technology
AI technology
A Living
A Living World
Li i g World
W ld
• The
The player is able to h player
l
iis able
bl to
manipulate certain aspects ip l
i
p
of the city.
f th ity
• The population of the City The population of the City
acts somewhat
acts somewhat autonomously.
l
• Furthermore the game will Furthermore the game will
simulate random disasters
simulate random disasters.
Th Sims
The
The Sims
Si
•
•
•
•
Developed by Maxis
Developed
l
d by
b Maxis
i
Published by Electronic Arts
Published by Electronic Arts
Released in 2000
Released in 2000
A lif i l i g
A life simulation game in i
which the player has control hi h th pl y h
t l
over a semi‐autonomous i t
people.
people
C pl characters
Complex
Complex characters
h
t
• The
The Sims characters can be Sims characters can be
manipulated by the player
manipulated by the player but will also carry out day to
but will also carry out day to day tasks on their own
day tasks on their own.
• Characters also have Ch
t
l h
defined needs and
defined needs and personality traits that
personality traits that dictate how they act in
dictate how they act in given situations
given situations.
C pl Object
Complex
Complex Object Interactions
Objj t Interactions
I t
ti
• Characters
Characters are able to interact with an arrangement of objects are able to interact with an arrangement
g
of objects
j
in the environment due to unique object logic
in the environment due to unique object logic.
Bl k and
Black
Black and White
d White
Whit
• Developed
Developed by Lionhead
l
d by
b Lionhead
i h d
S di
Studios
• Published by EA games
Published by EA games
• Released in 2001
Released in 2001
• Simulation game in which Si l ti g
i hi h
y pl y G d
you play God.
Bl k and
Black
Black and White
d White
Whit
• Similar
Similar to Sim
to Sim City
• You had more control over You had more control over
the environment and the
the environment and the people in the game
people in the game
• You could also create armies You could also create armies
and wage war
and wage war
AI Learning
AI Learning
L
i g
• You
YYou could control and could
ld control
t l and
d
t i l g
train large creatures
t
• You could then punish or You could then punish or
reward the creatures
reward the creatures b d on how
based
based on how they h they
h
complete
complete tasks.
l
tasks.
k
• Over time the creatures Over time the creatures
will learn how you wish
will learn how you wish tasks to be done based
tasks to be done based on how they are treated
on how they are treated.
H l Combat
Halo:
Halo: Combat Evolved C b t Evolved
E l d
•
•
•
•
Developed by Bungi
Developed
l
d by
b Bungii
Published by Microsoft
Published by Microsoft
Released in 2001
Released in 2001
Fi p
First person shooter that h
h
g
garnered fame for df
f
competently brining the p t tly b i i g th
genre to Consoles
genre to Consoles
Dy
Dynamic
Dynamic Enemy AI
i Enemy
E
y AI
• Enemies
Enemies reacted in reacted in
d
dynamic
dynamic ways.
i ways.
• Different enemies Diff
Different
t enemies
i
would react
would react diff
differently
differently in l in
i
different situations
different situations.
• Enemies would work Enemies would work
together against the
together against the player.
l
L ft 4 Dead
Left
Left 4 Dead
D d
• Developed
Developed and published by l
d and
d published
bli h d b
by
V l
Valve
• Released in 2008
Released in 2008
• A co‐op first person shooter A co op first person shooter
set in a zombie apocalypse
set in a zombie apocalypse.
AI Director
AI Director
Di t
• The
The game utilizes an AI h game utilizes
ili an AI
di
director that will change the h
ill h g h
g
game based on how well b d
h
ll
th pl y ( )
the player(s) are doing.
d i g
• This can make the game This can make the game
more or lless diffi
more or less difficult for difficult
l ffor
pl y
players with different skill ith diff
t kill
l l
levels.
• This also changes the events This also changes the events
off the
of the game between h game b
between
diff
different
different play sessions.
play
l sessions.
i
Th Elder
The
The Elder Scrolls V: Skyrim
Eld Scrolls
S ll V:
V Skyrim
Sky i
• Developed
Developed and Published by l
d and
d Published
bli h d b
by
B h d G
Bethesda Game Studios
S di
• Released in 2011
Released in 2011
• Open World RPG set in a Open World RPG set in a
fantasy world
fantasy world
U b l
Unbalanced
Unbalanced AI
d AI
• Non
Non Playable characters (NPCs) and enemies within the Playable
y
characters ((NPCs)) and enemies within the
game world react dynamically with the player and each
game world react dynamically with the player and each other.
other
U b l
Unbalanced
Unbalanced AI
d AI
• Enemies are not designed to deal with simple obstacles
Enemies are not designed to deal with simple obstacles
A Video
Are
Are Video Games good for AI Development?
Vid Games
G
good
d for
f AI Development?
D l
t?
The Good
The Good
The Bad
The Bad
• AI
AI is essential to Games
is essential to Games
• Games provide a simulated Games provide
d a simulated
l d
world where programmers ld h
p g
can experiment
p i
t
• The Game Industry is the The Game Industry is the
largest area where AI is
largest area where AI is b i applied.
being
being applied.
li d
• Time
Time and Money are an and Moneyy are an
issue
• Innovation might not be I
i
igh
b
th t i p t t
that important
• Entertainment is more Entertainment is more
important then quality
important then quality