Devlog 1 : Algorithms and Unit movement


Hello everyone, welcome to the first devlog for Stranded Together. Over the past week I've been losing my mind trying to code player movement and limitations for units in the game. I started with breadth first search but later switched to the A star algorithm because I needed to add weight to some tiles for later. After going through the code and moving everything over to the A star algorithm, I started thinking about how to implement a visual indicator to show where the player can move. At first I thought about reusing the A star algorithm but quickly learned that that wouldn't work, so I tried to calculate every possible move the player can make and, again, realized that would be a terrible idea. Right when I was going to throw in the towel for the night, I found a website where someone implemented the exact thing I was looking for and they shared the code for it along with a video. I went through it and adapted it to work with my own setup and finally got it working. Now I dread having to calculate the line of sight of units but that's a problem for future me. Thank you so much for following the development of Stranded Together!

Credits to the resources I drew from:

https://gameprogrammingacademy.com/unity-tutorial-tactics-movement/

https://www.youtube.com/watch?v=i0x5fj4PqP4

https://www.youtube.com/watch?v=4JaHSLA2CKs

https://www.youtube.com/watch?v=ji-f-74zfIQ&t=44s

Get Stranded Together