Embed Notice
HTML Code
Corresponding Notice
- Embed this noticeif you were assembling the whole dungeon out of modules i had a fever dream about that.
something like taking the generated graph for the mission and running it through some force directed layout stuff. that usually just gives you some big cobweb (great for space sims though!) but there is a trick there.
basically pick the start node and then look at the connections (in case you make it so these vary, like if you can have nodes with 1-5 connections) and then it picks an appropriate room to fulfill that part of the graph. assign directions for each connection, then modify the layout alg so an assigned edge has to obey a given directionality.
each time you run the sim it will float everything out, but once a node makes some directions rigid they will have to float in ways that make sense for the connections that exist. then you go to the next node and do the same thing, picking rooms with appropriate connection nodes (if some edges are pinned in a direction now.)
in theory it should allow rooms to drift a little. you can shore it up by inserting corridors wherever a connection point has to be stretched out to accomodate everything else.
:bunhdthink: i have that HAM implementation that could get coopted to test this