Senior_Project_Final_Presentation

Download Report

Transcript Senior_Project_Final_Presentation

Finite State Machines
using Alice
Stephen Cano
CIS 4914 Senior Project
Wednesday December 5th
Project Summary

Motivation: In order to teach AI in a University
setting, specifically high level AI algorithms such
as Finite State Machines, there needs to be a
foundational environment to work in.

Save students the time of building characters or
settings for artificial intelligence and instead focus on
the algorithms themselves
Project Summary



Problem: Can a successful Finite State Machine
be assembled in the Alice programming
environment?
Alice is a tool made to teach beginners how to
program, but contains the ability to easily render
a 3D world (free at http://www.alice.org)
Is Alice’s “simple” environment enough to
handle high-level programming concepts?
Project Summary



Solution: Create a 3D world with a single actor
that is controlled by a finite state machine
User interaction adds additional states and extra
situations to the FSM
Start simple and build up, seeing what Alice can
and cannot handle
Literature Search

Anon, http://www.alice.org, Carnigie Mellon (as-of
Oct 10th)


Steve Rabin, AI Game Programming Wisdom 2,
Charles River Media (Dec 2003)




Alice tutorials and other work done in Alice
What is a Finite State Machine?
Good examples for single-actor FSM
How to debug and enhance your finite state machine
Ian Millington, Artificial Intelligence for Games,
Morgan Kaufmann (June 2006)


More basic information around Finite State Machines
“Ant colony” finite state machine involving many actors
Work Performed



In Alice, created a single-actor finite state
machine
Main actor, the “penguin” character, goes
between 3 different states when left to run, and
can enter two different states based on user
interaction.
Created two “objects”
the user can put into
the scene
State Diagrams
Main functions

Penguin.FSM:
Main “always running” function, had a looped action
that shows the finite state machine has entered a
certain state.
 Example: if in “roam” state, call Penguin.roam,
which makes the penguin take a few steps
 Also contains a check to see if conditions have been
met to enter a new state

Main functions

Penguin.Statecheck
Checks the environment of the character to see if
the state needs to be changed
 Performs the necessary actions for pre- and poststate change processing
 Example: Sit down to eat when hungry, turn to run
and hide when scared

Conclusions: Positive



While missing some high-level functionality, a
simple FSM can be built in Alice
Enough functionality
exists for the purpose
of educational ventures
in AI.
Very fun, easy to use
Conclusions: Negative



FSM not as “smart” as it could be due to
programming limitations
If/Else statements only good available logic
Animations must finish before “moving” on,
cannot have multiple threads running to
constantly check states


Example: Penguin will not notice fear-enducing
skeleton until he is done with his walk cycle
Cannot dynamically add objects to the
environment
Future Work




Could a more skilled Alice animator create
sharper state transitions?
Can the Java base of Alice be directly modified
to be more inclusive of AI technology?
Can other AI algorithms also be replicated in
Alice?
Is there a better programming environment for
educational purposes of AI?
Q/A time and quick notes

Thanks to Professor Schmalz, Dr. Dankel, and
my fellow Senior class

I wish you all a great winter break, and a great
spring semester!