Path finding Exercise 12-1 Visibility graph: Nodes are corner - - PowerPoint PPT Presentation

path finding
SMART_READER_LITE
LIVE PREVIEW

Path finding Exercise 12-1 Visibility graph: Nodes are corner - - PowerPoint PPT Presentation

Path finding Exercise 12-1 Visibility graph: Nodes are corner points of all obstacles, start and target An edge between a pair of nodes (a,b) exists if and only if a and b can see another, i.e. if the line [a,b] is not interrupted by


slide-1
SLIDE 1

Path finding

Exercise 12-1

slide-2
SLIDE 2

target a) Visibility graph:

  • Nodes are corner points of all obstacles, start and target
  • An edge between a pair of nodes (a,b) exists if and only if a

and b can see another, i.e. if the line [a,b] is not interrupted by an obstacle. Edges of polygons are edges in the visibility graph, too.

slide-3
SLIDE 3

target a) Visibility graph:

  • Edge costs correspond to the Euclidean distance
  • Shortest path search in the visibility graph (e.g. with Dijkstra)

delivers shortest path between start and target

slide-4
SLIDE 4

target b) For extended objects which are invariant to point reflection:

  • Pick centroid of the object and expand all obstacles by the corresponding

Minkowski-sum

  • Like that the path finding of the extended object can be reduced to the path finding
  • f a point: the shortest path of a circle through the obstacles is equivalent to the

shortest path of the center of the circle through the expanded obstacles.

  • Problem: Circles have infinite many angles which means that the visibility graph is

not computable precisely.

  • Solution: Approximate the circle with a polygon which is invariant to point reflection

(e.g. hexagon, octagon)

slide-5
SLIDE 5

target b) Not computable, but obvious solution:

slide-6
SLIDE 6

target Annotation: The triangle is not invariant to point reflection- If approximated with a circle, there would be no path to the target. c)

slide-7
SLIDE 7

target c) Approach from robotics (motion planning) which may be too expensive for MMOs:

  • Choose reference point in the polygon, e.g. a corner.
  • Calculate Minkowski difference of the polygon (relating to the reference

point) to every polygon (=Minkowski sum of the object point reflected by the reference point)

  • Like that the polygon itself „shrinks“ to a point, obstacles „grow“ (see

also robotic work space-> configuration space (C-Space, e.g. all positions of a roboter in a room), C-obstacles, free space)

  • Move point to the target through free space.
slide-8
SLIDE 8

target c) Now the shortest path to the target is again the shortest path in the visibility graph.

slide-9
SLIDE 9

target c) Now the shortest path to the target is again the shortest path in the visibility graph.

slide-10
SLIDE 10

target c) Now the shortest path to the target is again the shortest path in the visibility graph.

slide-11
SLIDE 11

target c) Path finding of such a triangle is thus not solvable with the rather coarse approximation of a circle. But it is possible using the Minkowski difference, which though depends

  • n the shape and can be computationally intensive for a high variety of

shapes in a game

slide-12
SLIDE 12

target c) Addition: if another corner of the triangle is chosen as reference point, it looks like this:

slide-13
SLIDE 13

target c) Addition: if another corner of the triangle is chosen as reference point, it looks like this:

slide-14
SLIDE 14

target c) Addition: if another corner of the triangle is chosen as reference point, it looks like this:

slide-15
SLIDE 15

target c) Addition: Comparison: The orange path was the shortest path found previously. As we can see, it is the same, so the shortest path does not depend on the reference point chosen.

slide-16
SLIDE 16

Tutorial Exercise

Alpha Beta Pruning

slide-17
SLIDE 17

4 7 2 4 6 5 9 2 6 1 4 2 1 2 7 3 max min min max

slide-18
SLIDE 18

max min min max

slide-19
SLIDE 19

7 β=7 max min min max

slide-20
SLIDE 20

4

4 7 max min min max

slide-21
SLIDE 21

4

4 7 max min min max

slide-22
SLIDE 22

4

4 7 α=4 max min min max

slide-23
SLIDE 23

4

4 7 2 α=4 max min min max

slide-24
SLIDE 24

4

4 7 2 β=2 α=4 max min min max

slide-25
SLIDE 25

4

4 7 2 β=2 α=4 β< α max min min max

slide-26
SLIDE 26

4 4

4 7 2 β=2 β< α max min min max

slide-27
SLIDE 27

4 4

4 7 2 β=4 max min min max

slide-28
SLIDE 28

4 4

4 7 2 6 β=4 max min min max

slide-29
SLIDE 29

4 4

4 7 2 6 β=4 β=6 max min min max

slide-30
SLIDE 30

4 4

4 7 2 6 5 β=4 β=6 max min min max

slide-31
SLIDE 31

4 4 5

4 7 2 6 5 β=4 α=5 max min min max

slide-32
SLIDE 32

4 4 5

4 7 2 6 5 β=4 α=5 β<α max min min max

slide-33
SLIDE 33

4 4 4 5

4 7 2 6 5 α=4 max min min max

slide-34
SLIDE 34

4 4 4 5

4 7 2 6 5 6 α=4 β=6 max min min max

slide-35
SLIDE 35

4 4 4 5 1

4 7 2 6 5 6 1 α=4 max min min max

slide-36
SLIDE 36

4 4 4 5 1

4 7 2 6 5 6 1 α=4 α=1 max min min max

slide-37
SLIDE 37

4 4 4 5 1

4 7 2 6 5 6 1 4 α=4 α=1 β=4 max min min max

slide-38
SLIDE 38

4 2 4 4 5 1 2

4 7 2 6 5 6 1 4 2 α=4 max min min max

slide-39
SLIDE 39

4 2 4 4 5 1 2

4 7 2 6 5 6 1 4 2 α=4 β=2 max min min max

slide-40
SLIDE 40

4 2 4 4 5 1 2

4 7 2 6 5 6 1 4 2 α=4 β=2 β<α max min min max

slide-41
SLIDE 41

4 4 2 4 4 5 1 2

4 7 2 6 5 6 1 4 2 max min min max

slide-42
SLIDE 42

Search strategy: Post-order (right partial tree first)

slide-43
SLIDE 43

4 7 2 4 6 5 9 2 6 1 4 2 1 2 7 3 max min min max

slide-44
SLIDE 44

3 β=3 max min min max

slide-45
SLIDE 45

3

7 3 α=3 max min min max

slide-46
SLIDE 46

3

2 7 3 α=3 β=2 max min min max

slide-47
SLIDE 47

3

2 7 3 α=3 β=2 β<α max min min max

slide-48
SLIDE 48

3 3

2 7 3 β=3 max min min max

slide-49
SLIDE 49

3 3

2 2 7 3 β=3 β=2 max min min max

slide-50
SLIDE 50

3 2 3

1 4 2 2 7 3 β=3 α=2 β=1 max min min max

slide-51
SLIDE 51

3 2 3

1 4 2 2 7 3 β=3 α=2 β=1 β<α max min min max

slide-52
SLIDE 52

3 2 2 3

4 2 2 7 3 β=3 1 max min min max

slide-53
SLIDE 53

3 2 2 2 3

4 2 2 7 3 α=2 1 max min min max

slide-54
SLIDE 54

3 2 2 2 3

2 4 2 2 7 3 α=2 β=2 1 max min min max

slide-55
SLIDE 55

3 2 2 2 2 3

9 2 4 2 2 7 3 α=2 α=2 1 max min min max

slide-56
SLIDE 56

3 2 2 2 2 3

5 9 2 4 2 2 7 3 α=2 α=2 β=5 1 max min min max

slide-57
SLIDE 57

3 2 2 5 2 2 3

6 5 9 2 4 2 2 7 3 α=2 α=2 1 max min min max

slide-58
SLIDE 58

5 3 2 2 5 2 2 3

6 5 9 2 4 2 2 7 3 α=2 1 max min min max

slide-59
SLIDE 59

5 3 2 2 5 2 2 3

6 5 9 2 4 2 2 7 3 α=2 1 β=5 max min min max

slide-60
SLIDE 60

5 3 2 2 5 2 2 3

4 6 5 9 2 4 2 2 7 3 α=2 1 β=5 β=4 max min min max

slide-61
SLIDE 61

5 3 2 2 2 5 2 2 3

2 4 6 5 9 2 4 2 2 7 3 α=2 1 β=5 α=2 max min min max

slide-62
SLIDE 62

5 3 2 2 2 5 2 2 3

4 2 4 6 5 9 2 4 2 2 7 3 α=2 1 β=5 α=2 β=4 max min min max

slide-63
SLIDE 63

4 5 4 3 2 4 2 4 2 5 2 2 3

4 7 2 4 6 5 9 2 4 2 2 7 3 1 max min min max