A Python implementation of a procedural path and room generation algorithm, designed for dungeon or map layouts with city-block style connections and tunable complexity.
- Path and Room Generation: Creates multiple paths (main and alternatives) between a start and end point, with rooms represented as nodes and hallways as edges.
- Randomization: Supports random position nudging (fuzzing) and random deletion of rooms and hallways for varied layouts.
- Cross-Path Connections: Connects alternative paths to the main path for grid-like or looped structures.
- Orphan Cleanup: Removes disconnected rooms and hallways to maintain valid paths.
- Untangling: Reduces edge crossings for clearer visualizations using force-based node adjustment.
- Visualization: Plots generated paths and rooms using matplotlib for easy inspection.
- Clone the repository.
- Install dependencies:
pip install -r requirements.txt
- Run the Jupyter notebook
notebook.ipynb
to generate and visualize sample paths.
- Generate main and alternative paths between start and end nodes.
- Randomly nudge room positions.
- Connect corresponding rooms between paths.
- Randomly delete rooms and hallways.
- Clean up orphaned nodes and edges.
- Untangle the graph for better visualization.
- Adjust path generation parameters, fuzzing intensity, deletion percentages, and untangling settings in the notebook.
- Change visualization styles via the
GraphStyle
class.
MIT License