#2956

 · 
vanilla

When generating corridors in the Dungeons of Doom, make corridor-drawing follow established corridor paths when possible instead of allowing long parallel double-wide corridors to be carved, because these are ugly.

A possible algorithm is to build the proposed corridor without editing the map, then identify all squares where the proposed corridor intersects with or is adjacent to existing ones, then pathfind to see which successive pairs of intersections are not already reachable, then only connect those pairs of intersections along the proposed path.

Another possibility is to let the corridors generate normally, and then do a postprocessing cleanup step, where all “unnecessary” corridor spaces are removed one by one until there are no more. An unnecessary space is defined as a CORR space where for each pair of orthogonally adjacent CORR spaces to it, the common corner of those orthogonally adjacent CORR spaces is itself a CORR. Though this may still produce some odd dead-end corridors.