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