PathFinding
RayCasting
Dave Geurtswww.davegeurts.com
sims11tz
Bring Life Into Your Games
#UtahDigiCon#pathfinding
sims11tz
Win Prizes!!!!!
Pop QUIZ!
PathFinding
RayCasting
Bring Life Into Your Games
PathFinding
PathFinding – A*Search Area
Break your level up into any type of Grid System
Your hero needsTo get from
Point A
To
Point B
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
PathFinding – A*
Open List
and
Closed List
Shopping list of Nodes
PathFinding – A*
Calculating an F score for a Node
F = G + H
PathFinding – A*Calculating G for a Node
F = G + HGTotal Sum of F scores from the starting Point to Node
PathFinding – A*Calculating H for a Node
F = G + HHCount # of Nodes To get to the destination * 10
heuristic
PathFinding – A*
F = G + H
Open Listand
Closed List
Search Area - NodesBreak your level up into any type of Grid System
Walkable NOT Walkable
PathFinding – A*Recursive A* loop
Starting Node
Destination Node
PathFinding – A*Recursive A* loop
PathFinding – A*Recursive A* loop
PathFinding – A*Recursive A* loopG
PathFinding – A*Recursive A* loopH Count Nodes To get to the destination * 10
PathFinding – A*Recursive A* loop
F = G + H
PathFinding – A*Recursive A* loop
Recursive A* loopPathFinding – A*
PathFinding – A*Recursive A* loop
PathFinding – A*Recursive A* loopG
PathFinding – A*Recursive A* loopH
PathFinding – A*Recursive A* loop
F = G + H
PathFinding – A*Recursive A* loopG
PathFinding – A*Recursive A* loopH
PathFinding – A*Recursive A* loop
F = G + H
PathFinding – A*Recursive A* loop
PathFinding – A*Recursive A* loop
PathFinding – A*Recursive A* loopG
PathFinding – A*Recursive A* loopH
PathFinding – A*Recursive A* loop
F = G + H
PathFinding – A*Recursive A* loopG
PathFinding – A*Recursive A* loopH
PathFinding – A*Recursive A* loop
F = G + H
PathFinding – A*Recursive A* loop
PathFinding – A*Recursive A* loop
PathFinding – A*Recursive A* loopG
PathFinding – A*Recursive A* loopH
PathFinding – A*Recursive A* loop
F = G + H
PathFinding – A*Recursive A* loopG
PathFinding – A*Recursive A* loopH
PathFinding – A*Recursive A* loop
F = G + H
PathFinding – A*Recursive A* loop
PathFinding – A*
PathFinding
Demonstration
Questions?
PathFinding
Pop QUIZ!
PathFinding
RayCasting
RayCasting
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
RayCasting
Search AreaBreak our level up into Nodes
RayCasting
Shoot RayShoot out a ray from our point in an angle
RayCasting
Check every nth measurementCheck for collision along the angle every nth pixels
RayCasting
Broad Phase List of all Nodes that the ray touches, until the lengthOf the ray is reached.
RayCastingNarrow Phase
Test the ray against each possible thing to determineWhat it hits and where
RayCasting
Demonstration
Questions?
RayCasting
Pop QUIZ!
RayCasting
Results!