Finite State Machines using Alice Stephen Cano CIS

  • Slides: 13
Download presentation
Finite State Machines using Alice Stephen Cano CIS 4914 Senior Project Wednesday December 5

Finite State Machines using Alice Stephen Cano CIS 4914 Senior Project Wednesday December 5 th

Project Summary n Motivation: In order to teach AI in a University setting, specifically

Project Summary n 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. n 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

Project Summary Problem: Can a successful Finite State Machine be assembled in the Alice programming environment? n Alice is a tool made to teach beginners how to program, but contains the ability to easily render a 3 D world (free at http: //www. alice. org) n Is Alice’s “simple” environment enough to handle high-level programming concepts? n

Project Summary Solution: Create a 3 D world with a single actor that is

Project Summary Solution: Create a 3 D world with a single actor that is controlled by a finite state machine n User interaction adds additional states and extra situations to the FSM n Start simple and build up, seeing what Alice can and cannot handle n

Literature Search n Anon, http: //www. alice. org, Carnigie Mellon (as-of Oct 10 th)

Literature Search n Anon, http: //www. alice. org, Carnigie Mellon (as-of Oct 10 th) n n Steve Rabin, AI Game Programming Wisdom 2, Charles River Media (Dec 2003) n n 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) n n 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 n Main actor, the

Work Performed In Alice, created a single-actor finite state machine n Main actor, the “penguin” character, goes between 3 different states when left to run, and can enter two different states based on user interaction. n Created two “objects” the user can put into the scene n

State Diagrams

State Diagrams

Main functions n Penguin. FSM: Main “always running” function, had a looped action that

Main functions n Penguin. FSM: Main “always running” function, had a looped action that shows the finite state machine has entered a certain state. n Example: if in “roam” state, call Penguin. roam, which makes the penguin take a few steps n Also contains a check to see if conditions have been met to enter a new state n

Main functions n Penguin. Statecheck Checks the environment of the character to see if

Main functions n Penguin. Statecheck Checks the environment of the character to see if the state needs to be changed n Performs the necessary actions for pre- and poststate change processing n Example: Sit down to eat when hungry, turn to run and hide when scared n

Conclusions: Positive While missing some high-level functionality, a simple FSM can be built in

Conclusions: Positive While missing some high-level functionality, a simple FSM can be built in Alice n Enough functionality exists for the purpose of educational ventures in AI. n Very fun, easy to use n

Conclusions: Negative FSM not as “smart” as it could be due to programming limitations

Conclusions: Negative FSM not as “smart” as it could be due to programming limitations n If/Else statements only good available logic n Animations must finish before “moving” on, cannot have multiple threads running to constantly check states n n n Example: Penguin will 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? n Can

Future Work Could a more skilled Alice animator create sharper state transitions? n Can the Java base of Alice be directly modified to be more inclusive of AI technology? n Can other AI algorithms also be replicated in Alice? n Is there a better programming environment for educational purposes of AI? n

Q/A time and quick notes n Thanks to Professor Schmalz, Dr. Dankel, and my

Q/A time and quick notes n Thanks to Professor Schmalz, Dr. Dankel, and my fellow Senior class n I wish you all a great winter break, and a great spring semester!