Wednesday, August 7, 2019

Line Of Sight


Like many tactical games, Tidewoken features a line of sight algorithm.

As soon as a spell with LoS requirement is casted, the player will only be able to cast on tiles that he "sees":



Shoutout to the creator of http://dofus-insight.com/ who helped me with the tile based code.
Check out his awesome website that emulates the LoS of Dofus.

For the technical details how the code works I refer to this post: http://playtechs.blogspot.com/2007/03/raytracing-on-grid.html


I basically converted the entire algorithm to UE4's Blueprint:

The LoS function will probably converted to C++ later on for performance boosts


For every tile in range, there is a line drawn to the casting character. If this line is obstructed, the player can't cast to this tile.

I use a macro library for global functions like "Get Tile Empty and Valid"



No comments:

Post a Comment

If you have questions regarding this project, let me know!

I'm looking for testers with understanding of tactical turn based PvP games like Dofus!