A brief Introduction to AI and its applications in Gaming. Talk was at "Advances & Research Challenges in the Applications of AI in Gaming, Medical Imaging and Bio-Informatics"
2. Agenda
Definitions of Artificial Intelligence
Introduction to Artificial Intelligence
What does “ARTIFICIAL” INTELLIGENCE “REALLY” mean?
AI is not building robots
Problem Solving
Algorithms and Concepts of AI in Gaming
AI Game – Code and Demo
Applications of AI in Gaming
Logical and Contextual Reasoning
Google Deepmind and AlphaGo
Artificial Super Intelligence – Videos
Battlefield 1 and FIFA 17
Hands on Demo
A day made of Glass
4. Definitions of AI
The theory and development of computer systems able to perform tasks
normally requiring human intelligence, such as visual perception, speech
recognition, decision-making, and translation between languages.
Formal Wikipedia Definition
5. Definitions of AI
Artificial Intelligence (AI) is usually defined as the science of making
computers do things that require intelligence when done by humans.
Alan Turing
6. Definitions of AI
It is the science and engineering of making intelligent machines, especially
intelligent computer programs. It is related to the similar task of using
computers to understand human intelligence, but AI does not have to confine
itself to methods that are biologically observable.
John McCarthy, Computer Science Dept., Stanford
8. Definitions of AI
Warning: Cynical Definition...
My definition of AI is any algorithm that is new in computer science. Once the
algorithm becomes accepted then it's not AI, it's just a boring algorithm.
At one time windows, mouse, menus, scroLlbars etc. were considered an AI
technique for making computers understand natural language. (The menus are a
list of valid words the system understands)
This is also why I study "Cognition", not AI.
R. Keen
Dick Keene, Sun Microsystems, Inc.
9. Definitions of AI
Artificial Intelligence - an area of computer science that follows the credo,
"When in doubt, use a graph search!!”
Jared L. Colfleshm
Dept. of Computer Science, University of Virginia
10. Definitions of AI
Artificial Intelligence - a subfield of computer science devoted to the
construction of extremely complex programs that do not work.
Frank Z. Brill
Applied Mathematics, CS
Samsung
12. Definitions of AI
A year spent in artificial intelligence is enough to make one believe in God.
Artificial Intelligence is no match for natural stupidity.
Artificial Intelligence? I'll be impressed when they come up with artificial
CUNNING.
Robots do it with artificial intelligence.
sent by Adam Rifkin(adam@cs.caltech.edu)
14. AI is not just building Robots!
Robots are “real object representation of an AI engine”
An AI Engine is considered something that can do one or more of the
following
Act Humanly
Think Humanly
Think Rationally
Act Rationally
15. Act Humanly – The Turing Test Approach
Intelligent behavior is the ability to achieve Human-like performance in all
cognitive tasks
The system would need to possess the following capabilities:
Natural Language Processing – Enable communication
Knowledge Representation – Store information
Automated Reasoning – Analyze information and draw solutions
Machine Learning – Detect and extrapolate patterns
Total Turing Test:
Computer Vision – Perceive objects
Robotics - Mobility
16. Think Humanly – Cognitive Modelling Approach
The most complicated problem, which is yet to be completely solved :
HUMAN BRAIN!
How does a Human Brain work?
Can computers behave like us?
Emotions? //EML
Cognitive Modelling is achieved through
Introspection
Physiological Experiments
AI and Cognitive Science fertilize each other
18. Thinking Rationally – The laws of thought approach
Aristotle coined the word “right thinking”
His famous “Laws of Syllogisms” provided patterns and logics
Socrates is a man; All men are mortal; Therefore Socrates is mortal.
Simple working principle:
Input : Take Description of problem in a logical notation
Output: Find solution to the problem if one exists
else, the system shall never stop looking
Problem : Giving formal inputs, not sure of a 100% solution
19. Acting Rationally – The rational agent approach
An agent is something that perceives and acts
Correct inferences and conclusions
Reflex action like humans (not just about correctness! time)
Expectation : 100% rational like human
Reality : limited rationality as –
Environment is usually complex
Computational demands are too high
20. Problem Solving
Desired outcome
based on context based on chance
Decision
What to do sequence of actions
Problem Solving Agent
Problem Various solutions
21. Steps to solve a problem
Problem : Collection of information that the agent will use to decide what
to do
Initial State : The initial state that the agent knows itself to be in
Operator : Set of possible actions which decide the next state
Successor function : Given a state ‘x’, S(x) will return a set of states that is
reachable from ‘x’
State space : Set of all states reachable from the initial state by any
sequence of actions
Path : Any sequence
Path Cost Function : Assigns a cost to the path
Solution : Path from initial state to a state that satisfies the goal test
24. 8 Puzzle Problem
State : location of each tile
Operators : blank moves left, right, up or down
Goal Test : if state matches the goal
Path Cost : each step costs 1 i.e., length of traversal/path
This is an example of NP-Complete problem.
Other examples- 15 Puzzle Problem, 8 Queens Problem etc.,
These are the best problems to implement AI search algorithms
30. A* Algorithm - Minimizing the Total Path Cost
Greedy search minimizes the estimated cost to goal, h(n)
Uniform search minimizes the cost of the path so far, g(n)
Combining these 2 strategies would give the estimated cost of the
cheapest solution
i.e., f(n) = h(n) + g(n)
32. Google Now
A data aggregator and data mining
https://www.youtube.com/watch?v=pPqliPzHYyc
33. A* AI based on JS, HTML5 game
Path finding algorithms are building blocks of AI
Simple puzzle game to deep strategy game
Obstacle detection and avoidance
In most games
Walk around obstacles
Find path out of a maze
Reach destination ‘B’ from start point ‘A’
Quickest or Shortest possible route
Etc..,
34. Origins of Path Finding AI : Dijkstra’s
Early implementations of Diskstra’s algorithm of finding efficient routes of
any hypothetical situation
Best choice of route
Travelling from A->B adds up cost
35. Problems with Dijkstra’s
Naïve implementation – No ‘most likely candidates first’
Solution is got after each & every candidate is tested
36. A* to the rescue
Best first, graph search algorithm that finds the least cost path from given
initial node to the goal node
37. … more Optimization
Assign weights to nodes along the way and predict direction
By using such aggressive heuristic approaches we can predict the “Most
Likely Best Direction”
40. Game AI is an algorithm that replaces
randomness.
41. AI in Games
Good Game AI is an algorithm that provides superior designed results to
randomness.
Football Manager doesn't use Neural Networks - it uses standard decision
based AI with some learning aspects associated with them through
recording of previous resultant effects but it can't be said to be a 'pure'
approach in either manner.
Perception, Path Finding, Behavior Trees
Navigation Mesh
42. AI Game
Sprite sheet
Generate a random map or world
Obstacles
Find path from A to B
Using A*
53. Vector Field Collision Avoidance
This method provides “intelligent” behaviors in a wide class of games with
very simple and highly reusable code.
We can use Vector Field algo on top of any Path finding algo
More optimal and easy to implement
More realistic is collision avoidance
Vector field concept from Math
62. Agents behind logical reasoning
Siri, Cortana are the 2 most popular applications
These two assistants churn solution sets to perfectly match your query
unlike Google Now(most of it)
New developments
Conversational Interface
Personal Context Awareness
Service Delegation
Recurring Machine Learning
64. Logical Reasoning
Algorithm – Logic + Control
Inferences are done by Backward Chaining, using DFS
When we hit a dead-end, backs up to most recent step having alternatives
Order of search : Left to Right
Clauses in Knowledge Base are applied : First to Last
Constraint Logical Programming
Meta-reasoning : Reordering of solution set, reasoning about reasoning
66. Compiler
The best planning & strategy engine
Real time, errors as you type
Can GCC or javac be called as an AI?
How about Javascript?
Dynamic Scope!
Some thoughts on 1-pass compiler (by Mozilla)
67. Contextual Reasoning
Reasoning based on position of current state w.r.t. its neighbors
Context can be power/strength of neighbors (CS 1.6 game)
Context can be time of the day (Facebook)
Context can be priority or importance
Context can also be the flow
Two or more of the above factors can also for contexts of n-dimensions
Example of n-dimensional context GUNAI app
68. GUNAI
Time factor
Context based
Data Collection
Recurring Machine Learning
Adaptive Reasoning
Greedy to Learn
Correlation
Smartest sidebar
https://www.youtube.com/watch?v=4aOYjS1yHhE
70. ML on Twitter Trends
One of the research papers I have written with colleagues
Problem : Twitter has humongous real-time tweets
Reason why #HashTag is trending is always a ‘?’
Streaming data aggregation
Filtering
Correlation
Relevant tweets
Demo
71. Google’s Deepmind
Google Deepmind beat world champion in Go game
Program with AI and Human Intuition
Outsmarted Human Brain by using Reinforcement Learning and Neural
Networks rather than just Brute Force
Deepmind AI is general purpose
There is no Model, it just takes any set of ‘start’ & ‘end’ rules of a game to
learn with possibilities or tasks
Our minds are capable of so much, its just about how much we use it
74. Artificial Super Intelligence
Currently a hypothetical agent that posses intelligence which surpasses the
brightest human minds in all aspects
Google Deepmind can be one!
Achieved - recursive self-improvement
Intelligence Explosion – formation of an ASI
It can discover or invent anything just like us
Take relative decisions
Ability to learn with less supervision
Reinforcement learning – inherently
81. AI in Games : Battlefield 1
Counter Strike
Call of Duty
Battlefield 1
Multi-player strategy
Multi-dimensional forces
Not just winning, building and saving team
https://www.youtube.com/watch?v=c7nRTF2SowQ
82. AI in Games : FIFA
Game based on real player moves
Game Strategy
Multiple players applying their best movement
https://www.youtube.com/watch?v=-3fjoe5Njpc
83. Demo
Capturing relevant data
Learn GraphDB
Neo4J, GraphQL
Understand Graph Search
Why is it efficient?
Complex queries
Facebook (Friends, Suggestion, Post Recommendation, Timeline)
84. A Day made of Glass
Not just AI, but, a real life of the future
https://www.youtube.com/watch?v=PfgmlVxLC9w
85. References
Artificial Intelligence - A Modern Approach by Stuart J. Russell and Peter Norvig
https://neo4j.com/blog/why-the-most-important-part-of-facebook-graph-search-is-
graph/
http://www.alanturing.net/turing_archive/pages/reference%20articles/what%20is%20ai.h
tml
https://www.quora.com/Which-Artificial-Intelligence-algorithms-are-used-in-a-game-
like-Fifa-Football-or-PES-Pro-Evolution-Soccer
https://www.quora.com/What-are-some-gaming-companies-that-use-artificial-
intelligence
https://www.quora.com/Which-artificial-neural-network-learning-rule-does-Football-
Manager-Game-use
http://buildnewgames.com/vector-field-collision-avoidance/
http://buildnewgames.com/astar