Sub Blog 2 | Mathematically Justifying the Overachiever Option Formula for "Generating Jaquaysed Dungeons"
Why is the optional formula in Step 4: x = (3r - k - 3)L - r + 1?
In my personal findings, I found that converting 65% +/- 5% of the edges in a Delaunay Triangulation Grid into room connections was the exploration "sweet-spot." Specifically, I wanted there to be on average 2-3 connections per room.
Any less, and the dungeon would feel too linear. Any more, and I worry that the dungeon would be so interconnected that analysis paralysis could grind everything to a halt.
To find the ratio of room paths to total edges, it's the formula L(oop rate) = (M + x) / e, where:
- M = # of room paths found in Step 3 = # of rooms - 1
- x = # of room paths added in Step 4
- e = total # of edges from the Delaunay Triangulation Grid from Step 2
Rearranging the formula to find x, we get:
- L = ( (r -1) + x ) / e
- eL = r - 1 + x
- x = eL - r + 1
Thus, to find x, we only need to find the total number of edges from Step 2. Fortunately, there is already a formula for the number of edges in a Delaunay Triangulation Grid. Unfortunately, the equation is e = 3r - k - 3, where:
- r = # of rooms
- k = # of outer edges for the "Outer Hull" (basically the Grid's circumference).
Substituting e in the previous formula results in: x = (3r - k - 3)L - r + 1. Thus, the optional formula will always produce a dungeon with an L of whatever value you wish.
However, I found that with smaller dungeons, x = # of rooms / 3 is a decent approximation. I only recommend using the optional formula for very large dungeons or if you're creating an automated dungeon generator.
To return to the Original Post, click here.
Comments
Post a Comment