The need for better AI: FPS enemy AI fail, enemies may not always choose best possible choice, a lot of time they choose worst possible outcome.
The need for better AI: MMORPG AI fail, escort mission, people you are protecting runs straight toward danger.
Using problem statement instead of abstract to make things short and simple.
System overall functionalities, separated into three user layers: Player, developer, and Admin Player: Download and runs application using AI stubs Developer: Download and use game engine to develop AI stubs to be uploaded Admin: Oversee AI stub submission to ensure safety
Algorithm 1: Dynamic source file Pro: Efficiency, dynamic name change Con: Recompile time, user requires compiler Algorithm 2: Dynamic DLL inclusion Pro: Speed and efficiency Con: No dynamic naming
Algorithm 3: IPC Pro: Dedicated process, location freedom Con: Dump and reconstruct time Algorithm 4: Dynamic DLL Reference Pro: Dynamic inclusion, customizable Con: Efficiency and performance
.NET layer, data holder, stores game state data. Stores who is where and what the character is about.
Unity layer, uses the data layer to manipulate game objects and update game state. Could use physics based action or simple action.
Game is character driven. Character choose what to do and its action affects the game state.
AI prompt cycle. How character object interact with global game state and uses AI adaptor as well as the action manager. AI adaptor sends a copy of game state and caller character to AI stub is the key of this project. Note, each of the three layers can expand without effecting the other. Data layer initialize game state -> Graphical layer controls game engine -> AI stub decision -> Graphical layer performs action -> Update to global state
Character implementation by layers. First, an enumerator can be used to reference to a new character so that data layer and presentation layer can use the same flag. Then a generic singleton character fetching method can be created in game state to fetch a new instance of the character. The abstract singleton character factor look into character implementation to fetch necessary data to describe each character, where new characters can be added. Character reference can then be associated in graphical presentation layer by reference.
Usage of a stock character to dynamically effect how the character looks to reuse available resource. Then the character’s look can be dynamically altered by script to match the needed character’s specification.
Due to layered architecture dependencies, layers cannot be tested until they are all present. Thus scaffolding system testing is needed to test each component. Before the tests can be done, the depended layer has to be assumed to be correct.
Log-in by creating account using existing account or ECU intra account
Upload new stubs
Search/download existing stubs
Update project download packages
Select the characters for both sides. Some algorithm work best with a specific set of characters where as generic algorithm can work with random characters.
Select which AI stub to use from the “/AI Stubs” folder, where all the download needs to go.
Select how many rounds by click on the number bar then press [Up] or [Down] to go up or down, hold [Up] or [Down] to incrementally increase selection range. Same can be done by using mouse scroll. Or [Left] or [Right] key to skip by 10.
Battle until at least one side loses. Repeat if necessary.
Dynamic pie chart display.
The end, time for Q&A.
If necessary, here is a list of indexes to be used to answer things in Q&A section.
Three categories of users using two components, a simplified version of the Project Functionality diagram.
Test for expected output and expected failure.
Simplified class diagram from presentation layer point of view.
The more elaborated character class diagram from design point of view.
Simple example on how the action is carried out.
AnimationEngine flow diagram. How to fetch and get the animation by using an AnimationManager object associated with each character.
An example on how to use AnimationState flag that’s associated with ActionDriver to trigger which animation to play for the character when performing the said action.
Simplified character state diagram, much more simplified than before.
Design the interface in PhotoShop then place the GUI contents. Using guide lines to locate (x, y) location as well as (width, height) dimension of the GUI elements.
Aim the game camera constantly at where the target is.
Since the camera is looking at the target, then as long as the target moves or camera moves the view can be controlled easily.
Mouse control, using click and drag to move the target, scroll up and down to zoom in and out, and right click drag to move the camera up/down rotate left/right.
Audio manager that plays either background music or sound effect clip.
This is how the AI stub file is being recognized. By using this scheme I don’t need a secondary database to associate file with its content.
How to dynamically reference to a class, instantiate an object from the class, and how to reference to the class’ member.
The difference between Visual Studio .NET’s Reflection class library and MonoDevelop’s C# definition. While similar but syntax is different.
Since each component acts independently, there is no reason why a secondary form (manual control) can’t pretend to be an AI stub and inject action selection to an AI adaptor. Scaffolding testing.
Action driver testing, creating a fake game scene with dummy as targets. Display all available actions to visually test the effect of the action drivers before integrating them into the actual scene.
Built-in methods to help algorithm design.
Generic methods on how to design AI stubs using this framework.
Like character reference, there is an action enumerator. Each action has a cost and delay lookup. Action is separated into three types Attack, Projectile, and Defense. Which can be fetch via singleton action factory. Then action object can be associated with action drivers on graphical presentation side.
Presentation 20110918 after effect
Dynamic State Based AI Decision Framework Presenter: Kuanhung Chen, MS in Software Engineering Committee Members: Dr. Junhua Ding, Dr. Masao Kishore, Dr. Ronnie Smith East Carolina University Fall 2011 Master’s Presentation
The Need for Better AI <ul><li>Source: Penny Arcade - One Plausible Scenario </li></ul>
Problem Statement <ul><li>“ In the field of video gaming, graphics is approaching visually apex . A few more pixels and polygons no longer provide any meaningful substance to improve the quality of gaming , however the AI of the games we play is no better than those we have played a decade ago. </li></ul><ul><li>I would like to propose a dynamic AI framework that allows end-users to experience the same game in potentially endlessly different ways by simply downloading user-generated AI plug-ins . This way, users can finally program/modify their own characters' AI algorithms and make games more difficult without games cheat.” </li></ul>
Question and Answer Presenter: Kuanhung Chen, MS in Software Engineering Committee Members: Dr. Junhua Ding, Dr. Masao Kishore, Dr. Ronnie Smith East Carolina University Fall 2011 Master’s Presentation
Appendix Index <ul><li>Simplified User Project Interface </li></ul><ul><li>Test Plan </li></ul><ul><li>Simplified Class Diagram (Manual Engine) </li></ul><ul><li>Class Diagram – Elaborated </li></ul><ul><li>Action Diagram </li></ul><ul><li>Animation Engine </li></ul><ul><li>Animation Engine – Elaboration </li></ul><ul><li>Simplified Character State Diagram </li></ul><ul><li>Interface Design </li></ul><ul><li>Camera Control – Design </li></ul><ul><li>Camera Control – Camera Movement </li></ul><ul><li>Camera Control – User Interface </li></ul><ul><li>Audio Manager Implementation </li></ul><ul><li>AI Stub Verification </li></ul><ul><li>C# Reflection Invoke </li></ul><ul><li>C# Reflection Invoke Differences </li></ul><ul><li>AI Stub Injection </li></ul><ul><li>AI Stub Injection Interface </li></ul><ul><li>AI Algorithm Utility </li></ul><ul><li>AI Design Strategies </li></ul><ul><li>Data Link – Action Driver </li></ul><ul><li>AI Stub Implementation – Template </li></ul>
AI Stub Verification <ul><li>Name Verification: </li></ul><ul><ul><li>Existence and non-empty of input [full file name] </li></ul></ul><ul><ul><li>Whether the referenced file exist </li></ul></ul><ul><li>Name Validation: </li></ul><ul><ul><li>Whether the [full file name] fits the naming scheme: [[ NameSpace ]].[ ClassName ].[ Method ].DLL </li></ul></ul><ul><ul><ul><li>Breaking down the name by delimiter of “.” </li></ul></ul></ul><ul><ul><ul><li>Make sure there are at least four parts </li></ul></ul></ul><ul><ul><ul><li>Make sure that the last part is “DLL” </li></ul></ul></ul><ul><ul><li>No empty space exists in file name </li></ul></ul>
AI Algorithm Utility <ul><li>Get All Characters </li></ul><ul><li>Get Allies </li></ul><ul><li>Get Enemies </li></ul><ul><li>Get Characters by Team </li></ul><ul><li>Get Character by ID </li></ul><ul><li>Get Character by Query </li></ul><ul><li>Total HP </li></ul><ul><li>Move To </li></ul><ul><li>Get Random Character </li></ul><ul><li>Line of Sight </li></ul>
AI Design Strategies <ul><li>State-Based Statistical Analysis </li></ul><ul><ul><li>Buffer copies of game state, run trend analysis to predict opponent action </li></ul></ul><ul><li>Table Query </li></ul><ul><ul><li>More familiar to programmers </li></ul></ul><ul><li>Team-Based Shared Memory </li></ul><ul><ul><li>Establish correlation to prevent redundant actions </li></ul></ul><ul><li>Nested AI Stub </li></ul><ul><ul><li>Re-use AI Adaptor to pass on request to child adaptors for specialized requests </li></ul></ul><ul><li>Target Buffer Strategy </li></ul><ul><ul><li>Use previously determined and buffered actions to cut down on CPU time </li></ul></ul><ul><li>Memory Based Analysis </li></ul><ul><ul><li>Dump accumulated data out to external file to be reused later. </li></ul></ul>