Karel Crombecq, lead programmer and technical director for Dungeon Alchemist, open sourced the Straight Skeleton algorithm they use to generate roofs. It's a complex algorithm that took a long time to get right, tested for robustness on their large user-base, and now generously shared with the world.

It's implemented in C# for Unity, and licensed under the MIT license:
https://github.com/Briganti-Games/Straight-Skeleton-Generator
#ProcGen

@runevision I remember learning this algorithm in our computational geometry course. Afaik it's one of the most complex algorithms in this field!

Really happy that in my game everything is grid-based so this algorithm boils down to a much more manageable grid-based discrete geometry