I decided to work on supporting multiple render targets. This would help in getting certain rendering techniques as well. However it didn’t go so smoothly. The code is in and most of it seems to work. However I am not able to display the render texture to the screen. I am not sure yet what it could be, but it may have something to do with sorting. I’ll have to investigate by watching the previous videos and find out why Casey implemented the sort barriers. They may point to a bug that I am not seeing currently.
After spending way too much time on the above mentioned feature, I got back to tiles. In the planning I should be optimizing the rendering, but that is not happening today. I first want to fix the tilemap generation code. And I quickly saw a stupid mistake in the code. The check for if a tile is a valid edge was wrong. It was constantly checking the same tile, the one directly below itself.
Fixing that didn’t make the algorithm work again. I also identified that I was probably doing too much work. Basically going over too many tiles and getting stuck in a loop as a result. However I think I can make it way easier and quicker, b setting the edges correctly in the first place. The new tile checking code already points me in the right direction, so I want to implement that tomorrow. Then the generation would be way simpler. Just needing to find one valid edge and follow it from there. No more setting and unsetting tiles, that’s just nonsense if you ask me. But I may find out otherwise tomorrow. We’ll see where the code takes us, but it can be made more robust, that is for sure!