1 CO2301 - Games Development 1 Week 13 - Revision Lecture AI Revision Gareth Bellaby.

Slides:



Advertisements
Similar presentations
Heuristic Search techniques
Advertisements

AI Pathfinding Representing the Search Space
October 1, 2012Introduction to Artificial Intelligence Lecture 8: Search in State Spaces II 1 A General Backtracking Algorithm Let us say that we can formulate.
Search Techniques MSc AI module. Search In order to build a system to solve a problem we need to: Define and analyse the problem Acquire the knowledge.
CS 484 – Artificial Intelligence1 Announcements Department Picnic: today, after class Lab 0 due today Homework 2 due Tuesday, 9/18 Lab 1 due Thursday,
Chapter 4 Search Methodologies.
CSE 380 – Computer Game Programming Pathfinding AI
CSC 423 ARTIFICIAL INTELLIGENCE
Best-First Search: Agendas
Mahgul Gulzai Moomal Umer Rabail Hafeez
CSC344: AI for Games Lecture 5 Advanced heuristic search Patrick Olivier
Review: Search problem formulation
1 Using Search in Problem Solving Part II. 2 Basic Concepts Basic concepts: Initial state Goal/Target state Intermediate states Path from the initial.
1 Chapter 4 Search Methodologies. 2 Chapter 4 Contents l Brute force search l Depth-first search l Breadth-first search l Properties of search methods.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Using Search in Problem Solving
Trading optimality for speed…
Problem Solving and Search in AI Heuristic Search
Using Search in Problem Solving
CSC344: AI for Games Lecture 4: Informed search
Chapter 5.4 Artificial Intelligence: Pathfinding.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
State-Space Searches.
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
1 CO Games Development 1 Week 5 Deriving a "look at" function + Graph Theory Gareth Bellaby.
Chapter 5.4 Artificial Intelligence: Pathfinding.
1 CO Games Development 1 Week 1 Introduction to AI Gareth Bellaby.
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
1 Game AI Path Finding. A Common Situation of Game AI A Common Situation of Game AI Path Planning Path Planning –From a start position to a destination.
Artificial Intelligence LECTURE 3 ARTIFICIAL INTELLIGENCE LECTURES BY ENGR. QAZI ZIA 1.
1 CO Games Development 1 Week 6 Introduction To Pathfinding + Crash and Turn + Breadth-first Search Gareth Bellaby.
WAES 3308 Numerical Methods for AI
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
1 CO Games Development 1 Week 11 Search Methods Gareth Bellaby.
P ROBLEM Write an algorithm that calculates the most efficient route between two points as quickly as possible.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
A RTIFICIAL I NTELLIGENCE UNIT : 2 Search Techniques.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
CO Games Development 1 Week 12 Interpolation, Path Smoothing & Splines
For Monday Read chapter 4, section 1 No homework..
Lecture 3: Uninformed Search
For Wednesday Read chapter 6, sections 1-3 Homework: –Chapter 4, exercise 1.
For Wednesday Read chapter 5, sections 1-4 Homework: –Chapter 3, exercise 23. Then do the exercise again, but use greedy heuristic search instead of A*
Artificial Intelligence for Games Informed Search (2) Patrick Olivier
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Informed Search II CIS 391 Fall CIS Intro to AI 2 Outline PART I  Informed = use problem-specific knowledge  Best-first search and its variants.
Heuristic Search Foundations of Artificial Intelligence.
Searching for Solutions
1 CO Games Development 1 Week 3 Game Agents 2 Gareth Bellaby.
1 CO Games Development 1 Week 4 Finite State Machines + Maths Gareth Bellaby.
1 CO Games Development 1 Week 8 A* Gareth Bellaby.
Graph Search II GAM 376 Robin Burke. Outline Homework #3 Graph search review DFS, BFS A* search Iterative beam search IA* search Search in turn-based.
3.5 Informed (Heuristic) Searches This section show how an informed search strategy can find solution more efficiently than uninformed strategy. Best-first.
CSCE 552 Spring 2010 AI (III) By Jijun Tang. A* Pathfinding Directed search algorithm used for finding an optimal path through the game world Used knowledge.
1 CO Games Development 1 Week 9 - part 2 Pathfinding Considerations Gareth Bellaby.
CSCE 552 Fall 2012 AI By Jijun Tang. Homework 3 List of AI techniques in games you have played; Select one game and discuss how AI enhances its game play.
1 CO Games Development 2 Week 13 Influence Maps Gareth Bellaby.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Artificial Intelligence Solving problems by searching.
Lecture 3: Uninformed Search
Chapter 5.4 Artificial Intelligence: Pathfinding
For Monday Chapter 6 Homework: Chapter 3, exercise 7.
Introduction to Artificial Intelligence
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
CO Games Development 1 Week 8 Depth-first search, Combinatorial Explosion, Heuristics, Hill-Climbing Gareth Bellaby.
CO Games Concepts Week 12 Collision Detection
Search Strategies CMPT 420 / CMPG 720.
Presentation transcript:

1 CO Games Development 1 Week 13 - Revision Lecture AI Revision Gareth Bellaby

2 Exam format ●2 hours. 10 minutes reading time. ●Only semester 1 material - AI + maths. ●All of the material from semester 1 is examinable.

3 Exam format ●Section A and Section B. ●Section A ●Answer all of the questions ●Maths (Vector maths and graph theory) ●Pathfinding definitions and terms ●Section B ●4 questions. ●Choose 2. ●Longer questions

4 Topic List ●There's a list of words and topics I gave at the beginning of doing the AI. ●"AI - to be learnt". ●Learn all of these phrases and their meanings.

5 Revision ●Read ●Read around the subject ●Write out own notes ●Condense notes ●Group study is invalulable

6 Characteristics of the exam questions ●Describe the topic, e.g. what is a game agent?, What is a FSM? ●Be prepared to give an example, e.g. give an example of a game agent, provide an example of a FSM. ●Provide an example of use. How would it be used? Why would it be used?

7 Prepare to draw a diagram ●Be prepared to draw a diagram for every topic. Idle Attacking Dying Attacks No hit points Player distance & LOS NPC hit points Start

8 Game Agent sense memory think act (optional)

9 Game Agents ●Autonomous or semi-autonomous. ●Perceives the world and acts upon the world. ●Agents are situated in the world. ●Agents interact with the world. ●Suits genres such as FPS, but also think about games such as Viva Pinata.

10 Game Agents - sensing ●Perceiving the world in a similar (or analogous) way to that of the player. ●Seeing. An efficient vision algorithm would only consider: ● objects that the agent is interested in ● objects within the viewing distance of the agent ● objects within the viewing angle of the agent ● objects within the unobscured LOS of the agent ●Hearing. ●Similar considerations to seeing, but need to discuss sound propagation, ambient sound, etc. ●Communication with other agents.

11 Finite State Machine ●Finite State Machine is a machine which represents behaviour as: ●states ●transitions between states ●actions. The actions can occur within a state, on entry to a state, on exit from a state. ●Need a start state and an end state. ●You need to consider FSMs as a diagramatic technique. ●I provided a bunch of examples. Make sure you understand them and write similar examples of your own.

12 Pathfinding ●What is pathfinding? ●7 algorithms: ●Crash and Turn ●Breadth-first algorithm ●Depth-first algorithm ●Hill-climbing algorithm ●Best-first algorithm ●Djikstra's algorithm ●A* algorithm

13 Pathfinding ●Don't need to learn the algorithms off by heart but you do need to able to describe and discuss them. ●You must be aware of the fundamental characteristics of each of the search techniques. ●You must be able to explain and discuss the algorithms. ●Each of the search techniques can be compared to the others. ●What are the relative advantages and disadvantages of each of the searches?

14 Pathfinding ●Description: The characteristics of the algorithm. ●Is the algorithm guaranteed to find a solution? ●If the algorithm guaranteed to find the optimal solution? ●Efficiency: speed, size of tree. ●Heuristic: blind or directed? ●Cost: does the algorithm employ cost? ●Application: Where would you use the algorithm? What are the advantages and disadvantages of the algorithm?

15 Pathfinding ●Simplest algorithm is "Crash and Turn": move towards objective, if crash into an obstacle turn and move around its perimeter until you can move towards the objective again. ●Simple to implement. ●Can be effective in simple situations ●Guaranteed to work so long as all objects are convex. ●Think about using in combination with other methods.

16 Breadth-first algorithm ●Expands all of the nodes, layer by layer. ●Exhaustive search. ●Guaranteed to find solution, if one exists. ●Guaranteed to find the optimal solution. ●Inefficient because every node searched. The problem of combinatorial explosion. ●Does not employ a heuristic. ●OK for small problems where size is manageable. Useful if you definitely want to search all of the nodes.

17 Depth-first algorithm ●Only one node expanded. Single path followed. ●Need to include backtracking, otherwise it is pretty useless. ●Not guaranteed to find a solution. (But variants such as using a limiting wall and employing backtracking are guaranteed to do so). ●Not guaranteed to find the optimal solution. ●Overcomes combinatorial explosion because a smaller tree is generated. ●Does not employ a heuristic. ●May get lucky and, on average, faster than breadth-first. ●Used for problems in which optimality not important. ●Can be used in conjunction with other searches, e.g. for opportunistic searches.

18 Hill-climbing algorithm ●Current node examined to find the best successor. Path follows best successor. ●Better than depth and breadth. ●Basic algorithm is not guaranteed to find a solution. ●Foothills. ●Plateaus. ●Ridges. ●However, it is guaranteed to find a solution if backtracking is used, together with the option to move to a worse successor if no other alternatives exist. ●Not guaranteed to find optimal solution. ●Uses a heuristic. ●Variants include randomness, jumps. ●Useful for climbing a hill! (Or equivalent).

19 Best-first algorithm ●All unexpanded nodes recorded. Best overall node chosen. ●Uses a heuristic. ●Better than depth, breadth and hill-climbing. ●Guaranteed to find a solution. ●Not guaranteed to find the optimal solution, e.g. on a map with terrain costs. ●Useful for maps with no costs or equivalent kinds of problems. ●Can be employed in a game with moving obstacles.

20 Djikstra's algorithm ●Uses cost. ●Choose the successor node with the lowest cost. Cost is accumulated along each route. ●Guaranteed to find a solution. ●Guaranteed to find the optimal solution. ●Very efficient for maps in which all of the costs can be pre-generated. ●For a game with a large map can be inefficient because potentially a large number of alternatives may be considered. ●Inefficient with moving obstacles since cost would have to be regenerated.

21 A* algorithm ●Uses cost and heuristic. ●Choose the successor node with the lowest summed cost + heuristic. Cost is accumulated along each route. ●Guaranteed to find a solution. ●Guaranteed to find the optimal solution. ●An efficient algorithm. ●A commonly used games algorithm. Compare with Djikstra's. If cost can be pre-generated and stored efficiently then Djikstra's will be the better choice, otherwise use A*.

22 A* algorithm ●Admissability,, i.e. the heuristic never overestimates the distance. ●Graceful decay of admissability. Be strict about admissability at the beginning of the search but as the search is assumed to get closer to the destination relax the admissability criterion.

23 Search ●Combinatorial explosion: the problem whereby rules in combination give rise to a large number of alternatives. ●Dealing with the complexity of the real world. ●Simplification. Using a less detailed representation ●Level-of-detail, e.g. different sized grids for pathfinding, rule based system can have different levels.

24 Search ●Representations: grids, waypoints, regions, points-of-visibility. ●Map design.

25 Game characteristics perfect informationimperfect information 2-playern-player simple physical worldcomplex physical world timing - precise time periods timing - variable time periods precise goalsimprecise goals

26 Maths ●Maths: ●vectors: ●length ●normalisation ●dot product ●cross product ●angle

27 Targeting ●Test of "in front of", or "behind". ● x is the gun's x-axis. ● w is the vector from the gun to the target. ● x w > 0 if the target is to the right ● x w = 0 if the target is straight ahead. ● x w < 0 if the target is to the left ●Also "to left of", or "to right of". ●Deriving the local axis, e.g. local x-axis.

28 Targeting ●Construct a LookAt function. You need to be able to write down how the function is constructed. You need to understand: ●length of a vector ●normalise a vector ●dot product ●cross product ●the relevant axes ●Write down the procedure in full

29 Interpolation and splines ●Path smoothing is the process of smoothing out the angular route produced by the search method. So implemented after the search has been calculated. ●Be able to define and describe the terms. ●Describe and discuss what a spline is. ●Describe and discuss interpolation. ●Describe and discuss the characteristics of the Catmull-Rom and Bézier curve. ●Interpolation of the tangents.

30 Interpolation and splines ●Path smoothing. ●Smoothing is implemented through the use of interpolation - calculating points in between our known points. ●Looked at a method of generating a curve called the Catmull-Rom spline. ●Generate tangents based on the position of the sample points.