CSE4AT3 - AI and AS

Download Report

Transcript CSE4AT3 - AI and AS

CSE4AT3
Artificial Intelligence and Artificial
Stupidity
Major types of AI for games
•
•
•
•
•
•
•
State Machines and Fuzzy Logic
Case Statements  (Sadly are still in use)
Random Decisions
Neural Networks
Genetic Algorithms
Hybrids
Artificial Life (similar to GAs)
State Machines and the Fuzz
hFSMs
• Hierarchical Finite State Machines
Or Fuzzy state machines
Pseudo Random Number
Generation
• Typically in C++ the RNG is seeded with
time, or some other flux value
• Seeding with a Number will produce a
repeatable sequence.
– Given time is not in effect on the problem
Emergent AI
• Danger!
• It can create very different and dynamic
behaviours
• It can also be really hard to keep under
control
• Some players may enjoy repeatable
behaviour
• Debugging Joy!
Navigation
• The A* Tree searching algorithm is
fantastic
– Not always the way a human would go, but
that is mostly due to the implementation of the
algorithm(s)
– Reducing the load on the engine by vastly
simplifying the view of the world.
Neural Networks
Genetic Algorithms
Expert Systems
• The Knowledge based approach
– This can lead to wrong and hilarious
assumptions
– Bad inference
• If all birds can fly and all birds are animals then all
animals can fly.
– Missing links
• A red person is dangerous, so all red ppl are
dangerous
• This ignores the fact that a red Tank is also pretty
bad
The Application of AI
• So now you know of many types of AI
• Where do you use them?
• Currently you use them not very creatively
Typical Uses of AI
• Unit AI / Squad AI
• Pathing / Planning
• Dynamic Difficulty
Better uses of AI
•
•
•
•
Player ability detection
Better Dynamic Difficulty
Assisting the Core Mechanics
Improving the Players Experience
– Flow
– Rhythm
– Difficulty
– Interface
– Hooks
Error Correction / Detection
• SPM Quality Management
– Basically you can’t afford to have your AI
running its own show
– Getting good quality metrics requires good
measures
• Testing player health is not THE indicator of player
ability
Example
Detecting A Player Is Lost
Once you have a good metric
(input values)
• You need to have a good process to
create your output
Expected Output
• Does your AI behave in the expected
Manner?
– Is this a good behaviour:
– Input Attack : Output Retaliate
NPC AI
• Critical NPCs don’t die, they don’t take
damage from the player, we are pretty
much happy to accept that.
– Players are happier if the NPC’s react to you,
even if it isn’t by their head exploding
Artificial Stupidity
• It is incredibly easy to make an AI which
can obliterate the player
• Creating an AI system which balances the
gameplay, whilst retaining the challenge is
a far harder goal
• Humans make dumb mistakes
– But with a perfectly good reason
Don’t be reliant on AI
• Good AI working well can enhance your
game
• When someone makes your AI fail the
gameplay should still be there
That’s the end of this course!