The bridge generator I programmed as part of my ongoing exploration of procedural level generation has been upgraded to function in a wider variety of situations.

In the original version, a bridge could only be generated if the end points were facing toward one another and their "forward" directions were on the same side of the line connecting them so that this line and rays extended along these directions would form a triangle.

In this new version, the system is able to examine the configuration of the end points more intelligently, evaluate what sort of bridge geometry is required, and then construct the bridge accordingly. As a result it no longer depends on the above limitations and can construct "S" shaped bridges or connect end points that are facing away from one another. While it is still possible to arrange these points in such a way that the algorithm is unable to generate a workable bridge, it is able to handle a much wider variety of possible circumstances.

I've described the logic and my process for developing it in much more detail on my blog.

Controls:
A and D to rotate one of the end points
M to switch control between end points
The bridge generator runs automatically at intervals and will erase the existing bridge and generate a new one if it is able. If no bridge appears, try rotating one or both end points.

Leave a comment

Log in with itch.io to leave a comment.