video thumbnail 17:55
A* Pathfinding (E07: smooth weights)

2016-12-30

[public] 60.3K views, 1.13K likes, 8.00 dislikes audio only

In this episode we apply a box blur to our terrain penalties, to achieve more natural looking paths.

Source code: https://github.com/SebLague/Pathfinding

If you'd like to support these videos, you can make a recurring monthly donation (cancellable at any time) through Patreon: http://bit.ly/sebPatreon

Or a once-off donation through PayPal:

http://bit.ly/SupportGamedevTutorials


start with a grid of values usually representing an image
/youtube/video/Tb-rM3wGwv4?t=41.23
add up all the values inside the kernel
/youtube/video/Tb-rM3wGwv4?t=79.57
centered on the top left node of the grid
/youtube/video/Tb-rM3wGwv4?t=188.24001
calculate the actual kernel size
/youtube/video/Tb-rM3wGwv4?t=230.98
loop through all of the nodes in the kernel
/youtube/video/Tb-rM3wGwv4?t=327.31
repeating the values around the edges of the grid
/youtube/video/Tb-rM3wGwv4?t=366.12
calculate the index of the node
/youtube/video/Tb-rM3wGwv4?t=422.979
pass in the grid size x as the maximum value
/youtube/video/Tb-rM3wGwv4?t=450.51999
get the final blurred penalty for each node
/youtube/video/Tb-rM3wGwv4?t=652.33899
turning on the display grid gizmos
/youtube/video/Tb-rM3wGwv4?t=755.85999
set the color to the gizmo
/youtube/video/Tb-rM3wGwv4?t=873.59998
Support these videos on Patreon patreon.com
https://www.patreon.com/SebastianLague
Procedural Terrain Generation by Sebastian Lague
/youtube/video/wbpMiKiSKm8
Delegates and Events by Sebastian Lague
/youtube/video/G5R4C8BLEOc