{"id":13663211,"url":"https://github.com/SolAnna7/TaurusDungeonGenerator","last_synced_at":"2025-04-25T13:32:17.354Z","repository":{"id":52675122,"uuid":"273572241","full_name":"SolAnna7/TaurusDungeonGenerator","owner":"SolAnna7","description":"A graph based procedural dungeon generator for Unity","archived":false,"fork":false,"pushed_at":"2021-04-21T12:43:26.000Z","size":1411,"stargazers_count":46,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-10T19:34:35.794Z","etag":null,"topics":["dungeon","dungeon-generation","dungeon-generator","graph","labyrinth","labyrinth-generation","procedural","procedural-generation","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SolAnna7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-19T19:33:28.000Z","updated_at":"2024-08-16T16:42:23.000Z","dependencies_parsed_at":"2022-08-20T14:30:35.254Z","dependency_job_id":null,"html_url":"https://github.com/SolAnna7/TaurusDungeonGenerator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolAnna7%2FTaurusDungeonGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolAnna7%2FTaurusDungeonGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolAnna7%2FTaurusDungeonGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolAnna7%2FTaurusDungeonGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SolAnna7","download_url":"https://codeload.github.com/SolAnna7/TaurusDungeonGenerator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250825058,"owners_count":21493389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dungeon","dungeon-generation","dungeon-generator","graph","labyrinth","labyrinth-generation","procedural","procedural-generation","unity"],"created_at":"2024-08-02T05:02:21.306Z","updated_at":"2025-04-25T13:32:12.266Z","avatar_url":"https://github.com/SolAnna7.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"\u003cimg src=\"Logo/taurus_logo_text.png\" title=\"TaurusDungeonGenerator\" alt=\"TaurusDungeonGenerator logo\"\u003e\n\n# TaurusDungeonGenerator v0.8\n\n#### A graph based procedural dungeon generator for Unity\n\n* [Download Playable Presentation](https://drive.google.com/drive/folders/1XDA1_g5tuvnb2khWiTpZuK7bcmDJAn89)\n* [Download Example Project](https://drive.google.com/file/d/1Oz-4GnO_038RL4KZUholrGePtJirvCOE/view?usp=sharing)\n* ~~Asset Store Link~~\n\n\u003cimg src=\"https://drive.google.com/uc?export=download\u0026id=1-3jRCGoPvjlY8IjOC1aHHUP6srYBUTD6\"\u003e\n\n## Features\n* Abstract graph structure definition\n* Store and load structures from config with \u003ca href=\"https://github.com/SolAnna7/PiscesConfigLoader\"\u003ePiscesConfigLoader\u003c/a\u003e\n* Quick layout generation (not using Unity space!)\n* Reusing dungeon plans by nesting\n* Main path and branch generation\n* Add meta data using tags and properties\n* Optional paths\n* Margin between elements\n* Debug view\n\n## System Requirements\n\n* Unity 2018.4 or later\n\n## Dependencies\n\n* [UnityOctree](https://github.com/Nition/UnityOctree) (as git submodule) \n* [Unity-Reorderable-List](https://github.com/cfoulston/Unity-Reorderable-List) (as git submodule) \n* [PiscesConfigLoader](https://github.com/SolAnna7/PiscesConfigLoader) (optional, separately installed dependency)\n\n## Installation\n\n* Clone into the Assets folder of your Unity project\n```\ngit clone git@github.com:SolAnna7/TaurusDungeonGenerator.git\ncd TaurusDungeonGenerator/\ngit submodule update --init --recursive\n```\n* ~~Download from Unity Asset Store~~\n* To load the dungeon structures from config files use the [PiscesConfigLoader](https://github.com/SolAnna7/PiscesConfigLoader)\n\n## Usage\n\n##### Create your room assets\n* Add the `Room` component to the root\n  \u003cimg src=\"https://drive.google.com/uc?export=download\u0026id=1-KCNRDNO5NgeoN5nkYQvBieeQrRgN9B2\" title=\"Room capture\" alt=\"Room capture\"\u003e\n* Setup your doors with `RoomConnector` component\n  \u003cimg src=\"https://drive.google.com/uc?export=download\u0026id=1qkYcCmzJytn2J1knEM4AeBe93nmD38Sg\" title=\"RoomConnector capture\" alt=\"RoomConnector capture\"\u003e\n* Collect your rooms into `RoomCollection`-s for randomized usage\n\n##### Define your dungeon structure\n* In code\n ```c#\n  AbstractDungeonStructure.Builder\n      .SetEmbeddedDungeons(new Dictionary\u003cstring, AbstractDungeonStructure\u003e\n      {\n          {\n              //branch type 1 definition\n              \"inline-branch-1\",\n              AbstractDungeonStructure.Builder.SetStartElement(\n                  ConnectionElement(\"DungeonGenerationTest/Corridors\", new RangeI(4, 7))\n                      .AddSubElement(\n                          NodeElement(\"DungeonGenerationTest/MiddleRoom\")\n                      ).Build()).Build()\n          },\n          {\n              //branch type 2 definition\n              \"inline-branch-2\",\n              AbstractDungeonStructure.Builder.SetStartElement(\n                  ConnectionElement(\"DungeonGenerationTest/Corridors\", new RangeI(2, 5))\n                      .AddSubElement(\n                          NodeElement(\"DungeonGenerationTest/CorrX\")\n                      ).Build()).Build()\n          }\n      })\n      .SetBranchData(new BranchDataWrapper(\n          // the types of dungeons used as branches\n          new List\u003cstring\u003e {\"inline-branch-1\", \"inline-branch-2\"},\n          // maximum percentage of empty connections where branches will be built\n          50f))\n      .SetMetaData(StructureMetaData.Builder\n          // meta data objects for the structure\n          .AddStructureProperty(\"name\", \"Realistic dungeon layout\")\n          .AddStructureProperty(\"description\", \"A realistic layout with one miniboss room, one boss room and one to three exits.\")\n          // tags for the structure\n          .AddStructureTag(\"structure-tag-1\")\n          .AddStructureTag(\"structure-tag-2\")\n          // tags for every element\n          .AddGlobalTag(\"global-node-tag-1\")\n          .Build())\n      // the actual structure of the dungeon graph\n      .SetStartElement(\n          // a single room chosen from the DungeonGenerationTest/EndRoom RoomCollection\n          NodeElement(\"DungeonGenerationTest/EndRoom\")\n              // tags for this node\n              .SetMetaData(NodeMetaData.Builder.AddTag(\"entrance\").Build())\n              .AddSubElement(\n                  // a sequence of connected rooms chosen from the DungeonGenerationTest/Corridors RoomCollection\n                  // the length of the sequence is between 5 and 10 rooms randomly chosen at generation\n                  ConnectionElement(\"DungeonGenerationTest/Corridors\", new RangeI(5, 10))\n                      .AddSubElement(\n                          NodeElement(\"DungeonGenerationTest/MiddleRoom\")\n                              .SetMetaData(NodeMetaData.Builder.AddTag(\"small-boss-room\").Build())\n                              .AddSubElement(\n                                  ConnectionElement(\"DungeonGenerationTest/Corridors\", new RangeI(5, 10))\n                                      .AddSubElement(\n                                          NodeElement(\"DungeonGenerationTest/CorridorsNormalBig\")\n                                              .AddSubElement(\n                                                  ConnectionElement(\"DungeonGenerationTest/CorridorsBig\", new RangeI(3))\n                                                      .AddSubElement(\n                                                          NodeElement(\"DungeonGenerationTest/BigRoom\")\n                                                              .SetMetaData(NodeMetaData.Builder.AddTag(\"big-boss-room\").Build())\n                                                              .AddSubElement(\n                                                                  NodeElement(\"DungeonGenerationTest/CorridorsNormalBig\")\n                                                                      .AddSubElement(\n                                                                          ConnectionElement(\"DungeonGenerationTest/Corridors\", new RangeI(5, 10))\n                                                                              .AddSubElement(\n                                                                                  NodeElement(\"DungeonGenerationTest/MiddleRoom\")\n                                                                                      .AddSubElement(\n                                                                                          ConnectionElement(\"DungeonGenerationTest/Corridors\", new RangeI(5, 10))\n                                                                                              .AddSubElement(NodeElement(\"DungeonGenerationTest/EndRoom\")\n                                                                                                  .SetMetaData(NodeMetaData.Builder.AddTag(\"exit-1-static\").Build())\n                                                                                                  .Build())\n                                                                                              .Build())\n                                                                                      .AddSubElement(\n                                                                                          ConnectionElement(\"DungeonGenerationTest/Corridors\", new RangeI(5, 10))\n                                                                                              // this part of the tree is optional\n                                                                                              .SetMetaData(NodeMetaData.Builder.SetOptionalNode().Build())\n                                                                                              .AddSubElement(NodeElement(\"DungeonGenerationTest/EndRoom\")\n                                                                                                  .SetMetaData(NodeMetaData.Builder\n                                                                                                      .AddTag(\"exit-2-optional\")\n                                                                                                      // end of an optional tree\n                                                                                                      .SetOptionalEndpoint()\n                                                                                                      .Build())\n                                                                                                  .Build())\n                                                                                              .Build())\n                                                                                      .AddSubElement(\n                                                                                          ConnectionElement(\"DungeonGenerationTest/Corridors\", new RangeI(5, 10))\n                                                                                              .SetMetaData(NodeMetaData.Builder.SetOptionalNode().Build())\n                                                                                              .AddSubElement(NodeElement(\"DungeonGenerationTest/EndRoom\")\n                                                                                                  .SetMetaData(NodeMetaData.Builder\n                                                                                                      .AddTag(\"exit-3-optional\")\n                                                                                                      .SetOptionalEndpoint()\n                                                                                                      .Build())\n                                                                                              )))))))))))\n              .Build())\n      .Build()\n```\n  \n* Or load from config files using \u003ca href=\"https://github.com/SolAnna7/PiscesConfigLoader\"\u003ePiscesConfigLoader\u003c/a\u003e\n  \n ```yaml\n  realistic-dungeon-layout-1:\n    inline-nested:\n      # branch type 1 definition\n      inline-branch-1:\n        start-node:\n          connection: DungeonGenerationTest/Corridors\n          length: 4_7\n          subs:\n            - node: DungeonGenerationTest/MiddleRoom\n      # branch type 2 definition\n      inline-branch-2:\n        start-node:\n          connection: DungeonGenerationTest/Corridors\n          length: 2_5\n          subs:\n            - node: DungeonGenerationTest/CorrX\n    # the types of dungeons used as branches\n    branch-prototypes:\n      - inline-branch-1\n      - inline-branch-2\n    # maximum percentage of empty connections where branches will be built\n    branch-max-percent: 50\n    # meta data objects for the structure\n    structure-properties:\n      name: \"Realistic dungeon layout\"\n      description: \"A realistic layout with one miniboss room, one boss room and one to three exits.\"\n    # tags for the structure\n    structure-tags:\n      - structure-tag-1\n      - structure-tag-2\n    # tags for every element\n    global-node-tags:\n      - global-node-tag-1\n    # the actual structure of the dungeon graph\n    start-node:\n      # a single room chosen from the DungeonGenerationTest/EndRoom RoomCollection\n      node: DungeonGenerationTest/EndRoom\n      # tags for this node\n      tags:\n        - entrance\n      subs:\n        # a sequence of connected rooms chosen from the DungeonGenerationTest/Corridors RoomCollection\n        - connection: DungeonGenerationTest/Corridors\n          # the length of the sequence is between 5 and 10 rooms randomly chosen at generation\n          length: 5_10\n          subs:\n            - node: DungeonGenerationTest/MiddleRoom\n              tags:\n                - small-boss-room\n              subs:\n                - connection: DungeonGenerationTest/Corridors\n                  length: 5_10\n                  subs:\n                    - node: DungeonGenerationTest/CorridorsNormalBig\n                      subs:\n                        - connection: DungeonGenerationTest/CorridorsBig\n                          length: 3\n                          subs:\n                            - node: DungeonGenerationTest/BigRoom\n                              tags:\n                                - big-boss-room\n                              subs:\n                                - node: DungeonGenerationTest/CorridorsNormalBig\n                                  subs:\n                                    - connection: DungeonGenerationTest/Corridors\n                                      length: 5_10\n                                      subs:\n                                        - node: DungeonGenerationTest/MiddleRoom\n                                          subs:\n                                            - connection: DungeonGenerationTest/Corridors\n                                              length: 5_10\n                                              subs:\n                                                - node: DungeonGenerationTest/EndRoom\n                                                  optional-end: true\n                                                  tags:\n                                                    - exit-1-static\n                                            - connection: DungeonGenerationTest/Corridors\n                                              length: 5_10\n                                              # this part of the tree is optional\n                                              optional: true\n                                              subs:\n                                                - node: DungeonGenerationTest/EndRoom\n                                                  # end of an optional tree\n                                                  optional-end: true\n                                                  tags:\n                                                    - exit-2-optional\n                                            - connection: DungeonGenerationTest/Corridors\n                                              length: 5_10\n                                              optional: true\n                                              subs:\n                                                - node: DungeonGenerationTest/EndRoom\n                                                  optional-end: true\n                                                  tags:\n                                                    - exit-3-optional\n```\n\n##### Parameterise and generate your dungeon, then build it in unity space\n\n```c#\nPrototypeDungeonGenerator generator = new PrototypeDungeonGenerator(inputStructure, \n                                                                    seed, \n                                                                    new PrototypeDungeonGenerator.GenerationParameters {RequiredOptionalEndpointNumber = optionalPathNumber});\nPrototypeDungeon prototypeDungeon = generator.BuildPrototype();\nDungeonStructure builtStructure = prototypeDungeon.BuildDungeonInUnitySpace(transform);\n```\n##### 🎆🎆🎆 Profit 🎆🎆🎆 \n\n### Nested Dungeons\n\nReuse dungeons as subtrees\nCan continue with children\nCan be defined as global (used from any other dungeon) or inline (reusable only in one main dungeon)\n\n```yaml\nexample-dungeons:\n\n  global-nestable-dungeon:\n    start-node:\n      connection: DungeonGenerationTest/Corridors\n      length: 1_3\n      subs:\n        - node: DungeonGenerationTest/MiddleRoom\n\n  nesting-presentation:\n    start-node:\n      node: DungeonGenerationTest/EndRoom\n      subs:\n        - connection: DungeonGenerationTest/Corridors\n          length: 10_20\n          subs:\n            - node: DungeonGenerationTest/CorrX\n              subs:\n                # this nested dungeon continues have child nodes\n                - nested: example-dungeons.global-nestable-dungeon\n                  subs:\n                    - connection: DungeonGenerationTest/Corridors\n                      length: 1_3\n                      subs:\n                        - node: DungeonGenerationTest/EndRoom\n                - nested: example-dungeons.global-nestable-dungeon\n\n```\n\n### Branches\n\n\u003cimg src=\"https://drive.google.com/uc?export=download\u0026id=1-1BtC67YWWFbl975OVW7JnxjmCNwz5yE\"\u003e\n\nAfter creating the main tree, other low priority paths can be added. This can be used as a way to add complexity and dead-ends to a dungeon.\nThe brances are defined as nested dungeons (global or inline)\nSet the maximum number of unused connectors where brances are tried to be generated. Either as percent `branch-max-percent: 50` or as a number `branch-max-num: 12`\n\n```yaml\n  realistic-dungeon-layout-1:\n    inline-nested:\n      # branch type 1 definition\n      inline-branch-1:\n        start-node:\n          connection: DungeonGenerationTest/Corridors\n          length: 4_7\n          subs:\n            - node: DungeonGenerationTest/MiddleRoom\n      # branch type 2 definition\n      inline-branch-2:\n        start-node:\n          connection: DungeonGenerationTest/Corridors\n          length: 2_5\n          subs:\n            - node: DungeonGenerationTest/CorrX\n    # the types of dungeons used as branches\n    branch-prototypes:\n      - inline-branch-1\n      - inline-branch-2\n    # maximum percentage of empty connections where branches will be built\n    branch-max-percent: 50\n...\n```\n\n### Optional paths\n\nSome subtrees of the main path can be marked as **optional** and nodes inside them as **optional-end**.\nAt generation the required number of optional endpoints can be set.\nUse-Case: Reusing the same dungeon with different number of exits.\n\n### Margin between elements\n\nAdd additional margin between elements\n*This is still an experimental feature*\n\n```c#\nstructure.StructureMetaData.MarginUnit = 0.5f;\n```\n\n### Debug view\n\nUse the `DungeonDebugger` static class to\n* Draw in-editor gizmos around the dungeon element with color coded information\n* Generate a debug structure using unity cubes with the same colors\n* Generate debug description text\n\n\u003cimg src=\"https://drive.google.com/uc?export=download\u0026id=1fFFbQxuKtS6gD8i2eDFCKSArJt1K4-yd\" title=\"Debug View\" alt=\"Debug View\"\u003e\n\n## Planned features\n\n### v0.9\n* Room repetition control\n* Path straightness/~~gayness~~ curvedness control\n### v1.0\n* Unity Editor extension for dungeon structure creation\n### ?\n* Optional handling refactor: Activate optional paths based on room tags\n* Circles in the layout\n* Variables: Define variables (like random ranges) to reuse in the structure\n* Bounding box for the dungeon\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSolAnna7%2FTaurusDungeonGenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSolAnna7%2FTaurusDungeonGenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSolAnna7%2FTaurusDungeonGenerator/lists"}