Course Outline. Video Game AI: Lecture 7 Heuristics & Smoothing. Finding the best location out of several. Variable size units / special movement?

Similar documents
Notes. Video Game AI: Lecture 5 Planning for Pathfinding. Lecture Overview. Knowledge vs Search. Jonathan Schaeffer this Friday

Choosing a Search Space Representation

Computer Game Programming Basic Path Finding

Navigation and Metric Path Planning

Game AI: The set of algorithms, representations, tools, and tricks that support the creation and management of real-time digital experiences

CS 354R: Computer Game Technology

Chapter 5.4 Artificial Intelligence: Pathfinding

Pathfinding. Pathfinding Planned Movement

Class Overview. Introduction to Artificial Intelligence COMP 3501 / COMP Lecture 2. Problem Solving Agents. Problem Solving Agents: Assumptions

Road Map Methods. Including material from Howie Choset / G.D. Hager S. Leonard

I may not have gone where I intended to go, but I think I have ended up where I needed to be. Douglas Adams

Lecture 11 Combinatorial Planning: In the Plane

Graph and A* Analysis

Voronoi Diagram. Xiao-Ming Fu

The big picture: from Perception to Planning to Control

ECE276B: Planning & Learning in Robotics Lecture 5: Configuration Space

CMU-Q Lecture 4: Path Planning. Teacher: Gianni A. Di Caro

Rasterization, or What is glbegin(gl_lines) really doing?

5. THE ISOPERIMETRIC PROBLEM

Sung-Eui Yoon ( 윤성의 )

val(y, I) α (9.0.2) α (9.0.3)

4.7 Approximate Integration

Rasterization: Geometric Primitives

Tight Cocone DIEGO SALUME SEPTEMBER 18, 2013

Pathfinding. Artificial Intelligence for gaming

Worksheet 3.1: Introduction to Double Integrals

Coverage and Search Algorithms. Chapter 10

the gamedesigninitiative at cornell university Lecture 20 Pathfinding

Line Drawing Week 6, Lecture 9

Minecraft Due: Mar. 1, 2015

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

Vectorization Using Stochastic Local Search

Vertex Cover Approximations

Time-sliced pathfinding on arbitrary polygon surfaces

Finding a Path. Advanced Pathfinding. Finding a Path. A* Pathfinding Search. Practical Path Planning 3/21/2016. Tile-Based Navigation Graphs IMGD 4000

In what follows, we will focus on Voronoi diagrams in Euclidean space. Later, we will generalize to other distance spaces.

Simplicial Hyperbolic Surfaces

Navigation Mesh based Pathfinding for large crowds

Algorithms for GIS. Spatial data: Models and representation (part I) Laura Toma. Bowdoin College

I may not have gone where I intended to go, but I think I have ended up where I needed to be. Douglas Adams

Explicit Abstraction & Refinement. Single Agent Search COMP Prof. Nathan Sturtevant Lecture 16. Clique Abstraction (Sturtevant & Buro, 05)

Introduction to Information Science and Technology (IST) Part IV: Intelligent Machines and Robotics Planning

Route planning / Search Movement Group behavior Decision making

CS 387/680: GAME AI PATHFINDING

Renderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005

DM842 Computer Game Programming: AI. Lecture 5. Path Finding. Marco Chiarandini

Integral Geometry and the Polynomial Hirsch Conjecture

Direct Rendering. Direct Rendering Goals

Input Nodes. Surface Input. Surface Input Nodal Motion Nodal Displacement Instance Generator Light Flocking

Remarks on Kuratowski s Planarity Theorem. A planar graph is a graph that can be drawn in a plane without edges crossing one another.

Surface Simplification Using Quadric Error Metrics

Einführung in Visual Computing

15-494/694: Cognitive Robotics

Week 8 Voronoi Diagrams

Rasterization. COMP 575/770 Spring 2013

AutoCAD and Its Applications BASICS Supplemental Material Chapter 4

Appendix E Calculating Normal Vectors

Lecture 3: Art Gallery Problems and Polygon Triangulation

Computer Graphics 7 - Rasterisation

CS 460/560 Introduction to Computational Robotics Fall 2017, Rutgers University. Lecture 08 Extras. A* In More Detail. Instructor: Jingjin Yu

Coverage and Search Algorithms. Chapter 10

Computer Graphics. Chapter 4 Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1

Direction Fields; Euler s Method

Motion Planning. Howie CHoset

Strict Theta*: Shorter Motion Path Planning Using Taut Paths

AutoCAD. Multilines. Drawing Multilines. Multiline Justification MLINE

Platform Games Drawing Sprites & Detecting Collisions

Pathfinding. Advaith Siddharthan

Cross-Parameterization and Compatible Remeshing of 3D Models

Supplemental Material Chapter 4. Drawing Multilines

Shading Techniques Denbigh Starkey

Combinatorial Optimization

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10

Ch. 25 The Reflection of Light

CS 410/584, Algorithm Design & Analysis, Lecture Notes 8!

Lecture IV Bézier Curves

Introduction to ANSYS ICEM CFD

Computer Graphics. Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1

Pick s Theorem and Lattice Point Geometry

1. CONVEX POLYGONS. Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D.

Subdivision Curves and Surfaces: An Introduction

CMSC 425: Lecture 9 Geometric Data Structures for Games: Geometric Graphs Thursday, Feb 21, 2013

CS 331: Artificial Intelligence Informed Search. Informed Search

Planning: Part 1 Classical Planning

Introduction to Geometry. Computer Graphics CMU /15-662

Capturing an Evader in a Polygonal Environment with Obstacles

Elementary Planar Geometry

Greedy Approximations

Triangle Rasterization

CS 331: Artificial Intelligence Informed Search. Informed Search

CS 532: 3D Computer Vision 14 th Set of Notes

Continuous. Covering. Location. Problems. Louis Luangkesorn. Introduction. Continuous Covering. Full Covering. Preliminaries.

A Grid-Based Approximation Algorithm for the Minimum Weight Triangulation Problem

Lecture notes: Object modeling

Computational Geometry

GEO 154 CARTOGRAPHY II- PLOTTING USING AUTOCAD- ASSIGMENT HELP

Parallel Computation of Spherical Parameterizations for Mesh Analysis. Th. Athanasiadis and I. Fudos University of Ioannina, Greece

Ma/CS 6b Class 26: Art Galleries and Politicians

[Anton, pp , pp ] & [Bourne, pp ]

COMP371 COMPUTER GRAPHICS

Transcription:

Course Outline Video Game AI: Lecture 7 Heuristics & Smoothing Nathan Sturtevant COMP 3705 http://aigamedev.com/ now has free interviews! Miscellaneous details Heuristics How better heuristics can be built Path smoothing Simple smoothing Funnel algorithm Variable size units / special movement? Not necessary in all games Artists can make sure all areas are passable If planning is done in an abstract state space, build a different abstraction for every unit type Add the radius of the unit to all constrained edges Doesn t quite handle all cases If units can jump, need different connectivity Finding the best location out of several A* uses a heuristic to guide search toward a single target If there are multiple targets, you would need to take the minimum of the heuristic distance to each In practice, it is much better to search in reverse

Search with two goals Search with two goals G S G G S G Speeding search There are many ways to speed search Most common is abstraction Build a more abstract graph and search on it (Last Wednesday s lecture) An alternative Build a better heuristic Building better heuristics The book discusses several methods We will discuss a few quickly Read the details in the book One method is not covered in the book Will discuss in more detail

Heuristics Fundamentally: Describe the constraints of the problem A heuristic is the exact solution to the problem with one or more constraints removed Grid example: Move from the start to goal through adjacent cells, avoiding blocked cells Relax adjacency or blocked cells Heuristic - Take advantage of the state space Suppose map is divided by a bridge Every optimal path between the top and bottom of the map will cross that bridge Option 1: Plan two separate paths, one from the bridge and one away from it Option 2: Pre-compute distances to the bridge

Building a heuristic - memory Heuristics In this case, just store the distance from every point to the point in the center Advantage of this approach: O(N) memory, with N states in graph/map Any pathfinding between the four regions will be nearly immediate Pathfinding within a region will require a full search Long paths become fast Not very much memory required Disadvantage of the approach: Only works on certain types of maps Could precompute: Approx: 4 (N/4)2 + N = N2/4 + N Factor of 4 saving over APSP Alternate approach: differential heuristics Simple idea: Perform a Dijkstra search from any one state in the map For each state reached, store the distance to s1 Estimate the distance between any two states using the triangle inequality h(x, y) = d(x, s1) - d(y, s1)! d(x, y) Prefer to pick states at the end of the state space Easier to visualize as a 1-d projection of the state space

Differential Heuristic Advantages: Works for more types of state spaces Can build several heuristics and take the max Disadvantages May require more storage Won t work well on 2d spaces But, we tend to have good default heuristics for 2d spaces The best results use compression & specialized A* Simple smoothing Any path can be represented by line segments What algorithms can be performed on line segments to shorten paths that are too long Attempt 1: Straight-line checks Begin at the first point in the path Perform a straight line check to every other vertex Replace previous vertices with the straight line

Attempt 1 Analysis How many line tests/raycasts required? Guaranteed to produce optimal path? Not all optimal smoothing points are on endpoints of path segments Order matters Paths still a bit blocky Attempt 2: Limited straight-line checks Try to smooth optimal octile segments Only if underlying representation is a grid Try to connect the midpoints of the line segments Maintain a minimum line segment length Don t smooth too close to obstacles

Attempt 2 analysis How many line tests/raycasts required? Smoothed path likely to be homotopic to previous path Not checking far enough ahead to make big cuts in path length Attempt 3: Path following Instead of trying to generate a smooth path, follow the path in a smooth way Pick a point slightly ahead of the character Walk towards that point Update each frame Subtle change in DA:O Limit the character turn rate Possibly take several frames to turn

Attempt 3 analysis Pros Cost is minimal Can be very effective in practice Cons May bump into walls/traps Attempt 4 Find closest point on polygon boundary Generally used when not convex Otherwise there is a better approach

More complex smoothing Funnel Algorithm When a path is defined by a sequence of polygons, the funnel algorithm finds the optimal path through For each additional segment, optionally joint the new points with the previous candidate line segments Definitions Channel Bounded area in which path is being produced Funnel Two sets of line segments which define potential area for future segments of the path Path Existing path which has been produced Apex Intersection between the end of the path and start of the funnel Funnel Algorithm Walk down each new edge Extend the existing left/right line segment This extends the funnel If the left/right lines cross, a new apex is defined Start over with the new apex

Funnel Algorithm Pros: Produces high-quality paths No more difficult than many other approaches Cons: Need representation amenable to funnels Length of path may be significantly different than when planning Conclusions Finding a path is only part of the problem Making it look good is just as important Wednesday: Flocking, group movement, etc