utahdigicon 2014 - bringing life to your games
DESCRIPTION
Pathfinding, RaycastingTRANSCRIPT
![Page 1: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/1.jpg)
PathFinding
RayCasting
Dave Geurtswww.davegeurts.com
sims11tz
Bring Life Into Your Games
![Page 2: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/2.jpg)
#UtahDigiCon#pathfinding
sims11tz
![Page 3: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/3.jpg)
Win Prizes!!!!!
![Page 4: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/4.jpg)
![Page 5: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/5.jpg)
![Page 6: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/6.jpg)
![Page 7: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/7.jpg)
![Page 8: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/8.jpg)
![Page 9: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/9.jpg)
Pop QUIZ!
![Page 10: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/10.jpg)
PathFinding
RayCasting
Bring Life Into Your Games
![Page 11: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/11.jpg)
PathFinding
![Page 12: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/12.jpg)
PathFinding – A*Search Area
Break your level up into any type of Grid System
Your hero needsTo get from
Point A
To
Point B
![Page 13: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/13.jpg)
PathFinding – A*
Each Square on our Grid is
Called a Node
Search AreaBreak your level up into any type of Grid System
Walkable
NOT Walkable
SLOW but Walkable
![Page 14: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/14.jpg)
PathFinding – A*
Open List
and
Closed List
Shopping list of Nodes
![Page 15: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/15.jpg)
PathFinding – A*
Calculating an F score for a Node
F = G + H
![Page 16: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/16.jpg)
PathFinding – A*Calculating G for a Node
F = G + HGTotal Sum of F scores from the starting Point to Node
![Page 17: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/17.jpg)
PathFinding – A*Calculating H for a Node
F = G + HHCount # of Nodes To get to the destination * 10
heuristic
![Page 18: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/18.jpg)
PathFinding – A*
F = G + H
Open Listand
Closed List
Search Area - NodesBreak your level up into any type of Grid System
Walkable NOT Walkable
![Page 19: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/19.jpg)
PathFinding – A*Recursive A* loop
Starting Node
Destination Node
![Page 20: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/20.jpg)
PathFinding – A*Recursive A* loop
![Page 21: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/21.jpg)
PathFinding – A*Recursive A* loop
![Page 22: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/22.jpg)
PathFinding – A*Recursive A* loopG
![Page 23: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/23.jpg)
PathFinding – A*Recursive A* loopH Count Nodes To get to the destination * 10
![Page 24: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/24.jpg)
PathFinding – A*Recursive A* loop
F = G + H
![Page 25: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/25.jpg)
PathFinding – A*Recursive A* loop
![Page 26: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/26.jpg)
Recursive A* loopPathFinding – A*
![Page 27: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/27.jpg)
PathFinding – A*Recursive A* loop
![Page 28: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/28.jpg)
PathFinding – A*Recursive A* loopG
![Page 29: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/29.jpg)
PathFinding – A*Recursive A* loopH
![Page 30: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/30.jpg)
PathFinding – A*Recursive A* loop
F = G + H
![Page 31: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/31.jpg)
PathFinding – A*Recursive A* loopG
![Page 32: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/32.jpg)
PathFinding – A*Recursive A* loopH
![Page 33: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/33.jpg)
PathFinding – A*Recursive A* loop
F = G + H
![Page 34: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/34.jpg)
PathFinding – A*Recursive A* loop
![Page 35: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/35.jpg)
PathFinding – A*Recursive A* loop
![Page 36: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/36.jpg)
PathFinding – A*Recursive A* loopG
![Page 37: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/37.jpg)
PathFinding – A*Recursive A* loopH
![Page 38: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/38.jpg)
PathFinding – A*Recursive A* loop
F = G + H
![Page 39: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/39.jpg)
PathFinding – A*Recursive A* loopG
![Page 40: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/40.jpg)
PathFinding – A*Recursive A* loopH
![Page 41: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/41.jpg)
PathFinding – A*Recursive A* loop
F = G + H
![Page 42: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/42.jpg)
PathFinding – A*Recursive A* loop
![Page 43: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/43.jpg)
PathFinding – A*Recursive A* loop
![Page 44: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/44.jpg)
PathFinding – A*Recursive A* loopG
![Page 45: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/45.jpg)
PathFinding – A*Recursive A* loopH
![Page 46: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/46.jpg)
PathFinding – A*Recursive A* loop
F = G + H
![Page 47: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/47.jpg)
PathFinding – A*Recursive A* loopG
![Page 48: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/48.jpg)
PathFinding – A*Recursive A* loopH
![Page 49: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/49.jpg)
PathFinding – A*Recursive A* loop
F = G + H
![Page 50: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/50.jpg)
PathFinding – A*Recursive A* loop
![Page 51: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/51.jpg)
PathFinding – A*
![Page 52: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/52.jpg)
PathFinding
Demonstration
![Page 53: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/53.jpg)
Questions?
PathFinding
![Page 54: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/54.jpg)
Pop QUIZ!
PathFinding
![Page 55: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/55.jpg)
RayCasting
![Page 56: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/56.jpg)
RayCasting
![Page 57: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/57.jpg)
RayCasting
Broad Phase Determine which things the ray might collide with.
Narrow Phase Test the ray against each possible thing to determineWhat it hits and where
![Page 58: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/58.jpg)
RayCasting
Search AreaBreak our level up into Nodes
![Page 59: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/59.jpg)
RayCasting
Shoot RayShoot out a ray from our point in an angle
![Page 60: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/60.jpg)
RayCasting
Check every nth measurementCheck for collision along the angle every nth pixels
![Page 61: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/61.jpg)
RayCasting
Broad Phase List of all Nodes that the ray touches, until the lengthOf the ray is reached.
![Page 62: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/62.jpg)
RayCastingNarrow Phase
Test the ray against each possible thing to determineWhat it hits and where
![Page 63: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/63.jpg)
RayCasting
Demonstration
![Page 64: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/64.jpg)
Questions?
RayCasting
![Page 65: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/65.jpg)
Pop QUIZ!
RayCasting
![Page 66: UtahDigiCon 2014 - Bringing Life to your Games](https://reader033.vdocuments.net/reader033/viewer/2022052619/55565ef4d8b42a144c8b4813/html5/thumbnails/66.jpg)
Results!