UE4 Custom A* Grid Movement & FOW



Mucking around with a rogue-like idea but been suck doing astar/grid movement for a while now. Nothing too serious, just having fun learning when I feel like it.
damage numbers animated preview

Until I get around to generating rooms needed a why to test the astar/blocking/movement stuff.
damage numbers animated preview


Finally got Astar stuff working here. Couldnt understand the built-in UE4 implementation so looked up a bunch of stuff and this one stuck after tryin a bunch. Actually the other stuff I read helped too..
damage numbers animated preview


Fog of Wah Huh Yeah… Black is unexplored territory. Green tinted areas are explored territory that is out of you field of view. And the floor is brown lol.



FOW is a mesh, scaled to the size of the grid and uses 2 “Render Target Textures”. A 24x24 sized grid would have two 24x24px RTTs created to use as alpha textures for the fog material. So coordinates match up and making a pixel black/white controls alpha in the material/location.



Did navigation by both keyboard/mouse and can now import CSV maps from Tiled (by @thorbjorn81) for testing. Also keeping track of turns and got rid of some rounding errors.



Movement! I use a timeline in C++, a vlerp/array of locations for movement. This way you can set how long in seconds a move/turn will take. Basically lerp from current to target & remove from array when done. If array has more points, do it again!

Here its set to 0.25 seconds.
damage numbers animated preview


Also did a quick and dirty blueprint version



And now Smooth Fog of war



Hope to have all of this wrapped up in a couple of UE4/UE5 plugins when I get some free time!