4-scene-setup.html 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783
  1. <!doctype html>
  2. <html lang="en" class="no-js">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1">
  6. <link rel="prev" href="3-dungeon-flow.html">
  7. <link rel="next" href="../core-concepts/index.html">
  8. <link rel="icon" href="../assets/images/favicon.ico">
  9. <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.11">
  10. <title>4. Scene Setup & First Generation - DunGen</title>
  11. <link rel="stylesheet" href="../assets/stylesheets/main.4af4bdda.min.css">
  12. <link rel="stylesheet" href="../assets/stylesheets/palette.06af60db.min.css">
  13. <script src="https://unpkg.com/iframe-worker/shim"></script>
  14. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  15. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
  16. <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
  17. <link rel="stylesheet" href="../stylesheets/extra.css">
  18. <script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
  19. </head>
  20. <body dir="ltr" data-md-color-scheme="slate" data-md-color-primary="black" data-md-color-accent="cyan">
  21. <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
  22. <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
  23. <label class="md-overlay" for="__drawer"></label>
  24. <div data-md-component="skip">
  25. <a href="#getting-started-scene-setup-first-generation" class="md-skip">
  26. Skip to content
  27. </a>
  28. </div>
  29. <div data-md-component="announce">
  30. </div>
  31. <header class="md-header md-header--shadow" data-md-component="header">
  32. <nav class="md-header__inner md-grid" aria-label="Header">
  33. <a href="../index.html" title="DunGen" class="md-header__button md-logo" aria-label="DunGen" data-md-component="logo">
  34. <svg width="100%" height="100%" viewBox="0 0 258 272" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
  35. <path d="M79,20.998C103.163,20.998 126.827,20.993 150.49,21.002C156.512,21.004 156.994,21.502 157,27.603C157.008,36.435 157.275,45.279 156.89,54.094C156.689,58.68 158.685,61.484 161.849,64.242C170.723,71.978 179.515,79.812 188.188,87.772C190.849,90.214 193.071,93.217 195.28,95.995C199.425,101.209 199.993,100.532 203.73,100.441C209.056,100.311 214.403,100.217 219.713,100.549C222.988,100.754 224.083,99.873 224.059,96.517C223.93,78.354 223.952,60.189 224.044,42.025C224.059,38.949 223.341,37.434 219.868,37.603C214.383,37.872 208.877,37.791 203.381,37.715C199.579,37.663 197.517,38.715 197.907,43.168C198.327,47.964 197.807,52.836 198.065,57.655C198.263,61.366 196.432,62.919 193.348,61.885C188.656,60.311 184.193,58.029 179.724,55.858C179.188,55.598 179.033,54.157 179.028,53.262C178.979,44.43 179.007,35.598 178.995,26.766C178.99,22.857 180.241,20.823 184.822,20.897C200.816,21.158 216.816,20.988 232.814,21.004C239.132,21.01 240.996,22.894 240.998,29.241C241.006,56.07 241.005,82.9 240.998,109.729C240.997,114.795 238.959,117.469 233.922,117.935C228.649,118.423 223.32,118.407 218.015,118.42C208.355,118.444 198.68,117.994 189.04,118.408C184.225,118.615 181.96,116.755 180.231,112.653C175.241,100.811 167.104,91.401 156.54,84.26C153.778,82.394 150.001,81.189 146.67,81.142C126.51,80.86 106.344,81.107 86.182,80.92C81.723,80.878 80.502,82.453 80.517,86.753C80.64,122.394 80.606,158.037 80.499,193.679C80.487,197.764 81.821,199.148 86.047,199.093C103.375,198.866 120.707,198.998 138.038,198.998C159.059,198.998 178.198,184.319 182.849,163.942C184.15,158.243 183.93,152.135 183.91,146.215C183.896,141.846 185.254,139.882 189.885,139.936C204.381,140.105 218.88,139.974 233.378,140.01C238.862,140.024 240.989,142.215 240.993,147.822C241.011,180.317 241.012,212.813 240.992,245.308C240.988,250.939 238.967,252.977 233.218,252.985C205.722,253.022 178.226,253.017 150.73,252.989C145.524,252.983 144.074,251.47 144.001,246.325C143.982,244.992 144.14,243.641 143.973,242.329C143.34,237.341 146.132,235.979 150.411,235.99C160.395,236.016 171.06,236.112 181.183,236.112C181.349,229.59 181.592,223.106 181.957,216.723C182.112,214.015 183.166,213.054 185.926,212.937C199.005,212.385 199.002,212.308 199.002,225.465C199.002,236.846 199.003,236.883 210.211,236.618C214.669,236.512 219.122,236.203 223.998,235.966L223.998,215.809C223.998,197.812 223.911,179.813 224.071,161.817C224.103,158.195 223.211,156.729 219.348,156.922C213.399,157.218 207.424,157 201.518,157C200.995,162.216 201.49,167.296 200.093,171.982C197.761,179.807 196.375,184.335 192.2,189.003C186.463,195.42 180.539,202.401 173.212,206.467C165.218,210.904 155.809,213.982 146.533,214.772C140.003,215.328 133.915,215.112 127.586,214.988C124.239,214.923 122.845,216.06 122.934,219.622C123.145,228.116 123.005,236.618 123.001,245.117C122.998,251.059 121.128,252.977 115.061,252.989C97.897,253.025 80.733,253.002 63.568,253.002C51.404,253.002 39.239,253.028 27.074,252.99C21.11,252.972 19.972,251.911 19.969,246.171C19.952,212.512 20.027,178.852 19.931,145.193C19.92,141.244 21.512,139.936 25.206,139.967C36.037,140.056 46.872,139.868 57.7,140.066C61.659,140.139 62.704,138.654 62.9,134.816C63.079,131.328 63.031,127.859 62.985,124.329C62.92,119.388 61.017,118.259 56.858,118.302C47.864,118.397 38.869,118.381 29.875,118.42C29.044,118.424 28.21,118.569 27.382,118.535C20.483,118.255 19.854,117.626 19.858,110.743C19.874,83.582 19.901,56.422 19.946,29.261C19.957,22.709 21.747,21.005 28.509,21.001C45.173,20.992 61.836,20.998 79,20.998M40.806,37.592C39.579,39.018 37.305,40.427 37.283,41.871C37.009,60.012 37.047,78.158 37.045,96.302C37.045,98.812 38.187,100.243 40.973,100.24C46.626,100.235 52.281,100.327 57.93,100.537C61.815,100.681 63.165,99.043 63.06,95.156C62.832,86.672 62.99,78.177 63.001,69.687C63.01,63.101 65.168,60.989 71.882,60.989C92.36,60.99 112.837,60.999 133.315,60.997C139.718,60.996 139.987,60.711 139.998,54.125C140.004,50.629 139.757,47.111 140.059,43.642C140.457,39.073 138.568,37.373 134.101,37.395C103.319,37.551 72.535,37.595 40.806,37.592M62.997,200.455C62.997,187.472 63.078,174.487 62.886,161.507C62.863,159.996 61.38,157.25 60.476,157.208C52.923,156.859 45.347,157.01 37.87,157.01C37.87,182.364 37.917,206.983 37.817,231.602C37.803,235.205 39.289,236.074 42.623,236.055C62.599,235.939 82.576,236.005 102.552,235.977C103.642,235.975 104.732,235.678 105.997,235.493C105.997,229.703 105.875,224.216 106.048,218.738C106.137,215.898 105.136,214.958 102.315,214.998C93.661,215.12 85.004,215.009 76.348,215.006C62.998,215 62.998,215.006 62.997,200.455Z" style="fill:currentColor;fill-rule:nonzero;"/>
  36. <g transform="matrix(1,0,0,1,91.4761,179.778)">
  37. <text x="0px" y="0px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:110px;fill:currentColor;">D</text>
  38. </g>
  39. </svg>
  40. </a>
  41. <label class="md-header__button md-icon" for="__drawer">
  42. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
  43. </label>
  44. <div class="md-header__title" data-md-component="header-title">
  45. <div class="md-header__ellipsis">
  46. <div class="md-header__topic">
  47. <span class="md-ellipsis">
  48. DunGen
  49. </span>
  50. </div>
  51. <div class="md-header__topic" data-md-component="header-topic">
  52. <span class="md-ellipsis">
  53. 4. Scene Setup & First Generation
  54. </span>
  55. </div>
  56. </div>
  57. </div>
  58. </nav>
  59. </header>
  60. <div class="md-container" data-md-component="container">
  61. <main class="md-main" data-md-component="main">
  62. <div class="md-main__inner md-grid">
  63. <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
  64. <div class="md-sidebar__scrollwrap">
  65. <div class="md-sidebar__inner">
  66. <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
  67. <label class="md-nav__title" for="__drawer">
  68. <a href="../index.html" title="DunGen" class="md-nav__button md-logo" aria-label="DunGen" data-md-component="logo">
  69. <svg width="100%" height="100%" viewBox="0 0 258 272" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
  70. <path d="M79,20.998C103.163,20.998 126.827,20.993 150.49,21.002C156.512,21.004 156.994,21.502 157,27.603C157.008,36.435 157.275,45.279 156.89,54.094C156.689,58.68 158.685,61.484 161.849,64.242C170.723,71.978 179.515,79.812 188.188,87.772C190.849,90.214 193.071,93.217 195.28,95.995C199.425,101.209 199.993,100.532 203.73,100.441C209.056,100.311 214.403,100.217 219.713,100.549C222.988,100.754 224.083,99.873 224.059,96.517C223.93,78.354 223.952,60.189 224.044,42.025C224.059,38.949 223.341,37.434 219.868,37.603C214.383,37.872 208.877,37.791 203.381,37.715C199.579,37.663 197.517,38.715 197.907,43.168C198.327,47.964 197.807,52.836 198.065,57.655C198.263,61.366 196.432,62.919 193.348,61.885C188.656,60.311 184.193,58.029 179.724,55.858C179.188,55.598 179.033,54.157 179.028,53.262C178.979,44.43 179.007,35.598 178.995,26.766C178.99,22.857 180.241,20.823 184.822,20.897C200.816,21.158 216.816,20.988 232.814,21.004C239.132,21.01 240.996,22.894 240.998,29.241C241.006,56.07 241.005,82.9 240.998,109.729C240.997,114.795 238.959,117.469 233.922,117.935C228.649,118.423 223.32,118.407 218.015,118.42C208.355,118.444 198.68,117.994 189.04,118.408C184.225,118.615 181.96,116.755 180.231,112.653C175.241,100.811 167.104,91.401 156.54,84.26C153.778,82.394 150.001,81.189 146.67,81.142C126.51,80.86 106.344,81.107 86.182,80.92C81.723,80.878 80.502,82.453 80.517,86.753C80.64,122.394 80.606,158.037 80.499,193.679C80.487,197.764 81.821,199.148 86.047,199.093C103.375,198.866 120.707,198.998 138.038,198.998C159.059,198.998 178.198,184.319 182.849,163.942C184.15,158.243 183.93,152.135 183.91,146.215C183.896,141.846 185.254,139.882 189.885,139.936C204.381,140.105 218.88,139.974 233.378,140.01C238.862,140.024 240.989,142.215 240.993,147.822C241.011,180.317 241.012,212.813 240.992,245.308C240.988,250.939 238.967,252.977 233.218,252.985C205.722,253.022 178.226,253.017 150.73,252.989C145.524,252.983 144.074,251.47 144.001,246.325C143.982,244.992 144.14,243.641 143.973,242.329C143.34,237.341 146.132,235.979 150.411,235.99C160.395,236.016 171.06,236.112 181.183,236.112C181.349,229.59 181.592,223.106 181.957,216.723C182.112,214.015 183.166,213.054 185.926,212.937C199.005,212.385 199.002,212.308 199.002,225.465C199.002,236.846 199.003,236.883 210.211,236.618C214.669,236.512 219.122,236.203 223.998,235.966L223.998,215.809C223.998,197.812 223.911,179.813 224.071,161.817C224.103,158.195 223.211,156.729 219.348,156.922C213.399,157.218 207.424,157 201.518,157C200.995,162.216 201.49,167.296 200.093,171.982C197.761,179.807 196.375,184.335 192.2,189.003C186.463,195.42 180.539,202.401 173.212,206.467C165.218,210.904 155.809,213.982 146.533,214.772C140.003,215.328 133.915,215.112 127.586,214.988C124.239,214.923 122.845,216.06 122.934,219.622C123.145,228.116 123.005,236.618 123.001,245.117C122.998,251.059 121.128,252.977 115.061,252.989C97.897,253.025 80.733,253.002 63.568,253.002C51.404,253.002 39.239,253.028 27.074,252.99C21.11,252.972 19.972,251.911 19.969,246.171C19.952,212.512 20.027,178.852 19.931,145.193C19.92,141.244 21.512,139.936 25.206,139.967C36.037,140.056 46.872,139.868 57.7,140.066C61.659,140.139 62.704,138.654 62.9,134.816C63.079,131.328 63.031,127.859 62.985,124.329C62.92,119.388 61.017,118.259 56.858,118.302C47.864,118.397 38.869,118.381 29.875,118.42C29.044,118.424 28.21,118.569 27.382,118.535C20.483,118.255 19.854,117.626 19.858,110.743C19.874,83.582 19.901,56.422 19.946,29.261C19.957,22.709 21.747,21.005 28.509,21.001C45.173,20.992 61.836,20.998 79,20.998M40.806,37.592C39.579,39.018 37.305,40.427 37.283,41.871C37.009,60.012 37.047,78.158 37.045,96.302C37.045,98.812 38.187,100.243 40.973,100.24C46.626,100.235 52.281,100.327 57.93,100.537C61.815,100.681 63.165,99.043 63.06,95.156C62.832,86.672 62.99,78.177 63.001,69.687C63.01,63.101 65.168,60.989 71.882,60.989C92.36,60.99 112.837,60.999 133.315,60.997C139.718,60.996 139.987,60.711 139.998,54.125C140.004,50.629 139.757,47.111 140.059,43.642C140.457,39.073 138.568,37.373 134.101,37.395C103.319,37.551 72.535,37.595 40.806,37.592M62.997,200.455C62.997,187.472 63.078,174.487 62.886,161.507C62.863,159.996 61.38,157.25 60.476,157.208C52.923,156.859 45.347,157.01 37.87,157.01C37.87,182.364 37.917,206.983 37.817,231.602C37.803,235.205 39.289,236.074 42.623,236.055C62.599,235.939 82.576,236.005 102.552,235.977C103.642,235.975 104.732,235.678 105.997,235.493C105.997,229.703 105.875,224.216 106.048,218.738C106.137,215.898 105.136,214.958 102.315,214.998C93.661,215.12 85.004,215.009 76.348,215.006C62.998,215 62.998,215.006 62.997,200.455Z" style="fill:currentColor;fill-rule:nonzero;"/>
  71. <g transform="matrix(1,0,0,1,91.4761,179.778)">
  72. <text x="0px" y="0px" style="font-family:'Arial-BoldMT', 'Arial', sans-serif;font-weight:700;font-size:110px;fill:currentColor;">D</text>
  73. </g>
  74. </svg>
  75. </a>
  76. DunGen
  77. </label>
  78. <ul class="md-nav__list" data-md-scrollfix>
  79. <li class="md-nav__item">
  80. <a href="../index.html" class="md-nav__link">
  81. <span class="md-ellipsis">
  82. Introduction
  83. </span>
  84. </a>
  85. </li>
  86. <li class="md-nav__item">
  87. <a href="../changelog.html" class="md-nav__link">
  88. <span class="md-ellipsis">
  89. Changelog
  90. </span>
  91. </a>
  92. </li>
  93. <li class="md-nav__item md-nav__item--active md-nav__item--nested">
  94. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" checked>
  95. <div class="md-nav__link md-nav__container">
  96. <a href="index.html" class="md-nav__link ">
  97. <span class="md-ellipsis">
  98. Getting Started
  99. </span>
  100. </a>
  101. <label class="md-nav__link " for="__nav_3" id="__nav_3_label" tabindex="0">
  102. <span class="md-nav__icon md-icon"></span>
  103. </label>
  104. </div>
  105. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="true">
  106. <label class="md-nav__title" for="__nav_3">
  107. <span class="md-nav__icon md-icon"></span>
  108. Getting Started
  109. </label>
  110. <ul class="md-nav__list" data-md-scrollfix>
  111. <li class="md-nav__item">
  112. <a href="1-creating-tiles.html" class="md-nav__link">
  113. <span class="md-ellipsis">
  114. 1. Creating Tiles
  115. </span>
  116. </a>
  117. </li>
  118. <li class="md-nav__item">
  119. <a href="2-doorways.html" class="md-nav__link">
  120. <span class="md-ellipsis">
  121. 2. Doorways
  122. </span>
  123. </a>
  124. </li>
  125. <li class="md-nav__item">
  126. <a href="3-dungeon-flow.html" class="md-nav__link">
  127. <span class="md-ellipsis">
  128. 3. Dungeon Flow Basics
  129. </span>
  130. </a>
  131. </li>
  132. <li class="md-nav__item md-nav__item--active">
  133. <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
  134. <label class="md-nav__link md-nav__link--active" for="__toc">
  135. <span class="md-ellipsis">
  136. 4. Scene Setup & First Generation
  137. </span>
  138. <span class="md-nav__icon md-icon"></span>
  139. </label>
  140. <a href="4-scene-setup.html" class="md-nav__link md-nav__link--active">
  141. <span class="md-ellipsis">
  142. 4. Scene Setup & First Generation
  143. </span>
  144. </a>
  145. <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  146. <label class="md-nav__title" for="__toc">
  147. <span class="md-nav__icon md-icon"></span>
  148. Table of contents
  149. </label>
  150. <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
  151. <li class="md-nav__item">
  152. <a href="#setting-up-the-generator" class="md-nav__link">
  153. <span class="md-ellipsis">
  154. Setting Up the Generator
  155. </span>
  156. </a>
  157. </li>
  158. </ul>
  159. </nav>
  160. </li>
  161. </ul>
  162. </nav>
  163. </li>
  164. <li class="md-nav__item md-nav__item--nested">
  165. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" >
  166. <div class="md-nav__link md-nav__container">
  167. <a href="../core-concepts/index.html" class="md-nav__link ">
  168. <span class="md-ellipsis">
  169. Core Concepts
  170. </span>
  171. </a>
  172. <label class="md-nav__link " for="__nav_4" id="__nav_4_label" tabindex="0">
  173. <span class="md-nav__icon md-icon"></span>
  174. </label>
  175. </div>
  176. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
  177. <label class="md-nav__title" for="__nav_4">
  178. <span class="md-nav__icon md-icon"></span>
  179. Core Concepts
  180. </label>
  181. <ul class="md-nav__list" data-md-scrollfix>
  182. <li class="md-nav__item">
  183. <a href="../core-concepts/tiles.html" class="md-nav__link">
  184. <span class="md-ellipsis">
  185. Tiles & Tile Component
  186. </span>
  187. </a>
  188. </li>
  189. <li class="md-nav__item">
  190. <a href="../core-concepts/weighting.html" class="md-nav__link">
  191. <span class="md-ellipsis">
  192. Weighting
  193. </span>
  194. </a>
  195. </li>
  196. <li class="md-nav__item">
  197. <a href="../core-concepts/tile-sets.html" class="md-nav__link">
  198. <span class="md-ellipsis">
  199. Tile Sets
  200. </span>
  201. </a>
  202. </li>
  203. <li class="md-nav__item">
  204. <a href="../core-concepts/archetypes.html" class="md-nav__link">
  205. <span class="md-ellipsis">
  206. Archetypes
  207. </span>
  208. </a>
  209. </li>
  210. <li class="md-nav__item">
  211. <a href="../core-concepts/doorways.html" class="md-nav__link">
  212. <span class="md-ellipsis">
  213. Doorways
  214. </span>
  215. </a>
  216. </li>
  217. <li class="md-nav__item">
  218. <a href="../core-concepts/dungeon-flow.html" class="md-nav__link">
  219. <span class="md-ellipsis">
  220. Dungeon Flow Asset
  221. </span>
  222. </a>
  223. </li>
  224. <li class="md-nav__item">
  225. <a href="../core-concepts/flow-editor.html" class="md-nav__link">
  226. <span class="md-ellipsis">
  227. Flow Editor
  228. </span>
  229. </a>
  230. </li>
  231. <li class="md-nav__item">
  232. <a href="../core-concepts/dungeon-generator.html" class="md-nav__link">
  233. <span class="md-ellipsis">
  234. Dungeon Generator
  235. </span>
  236. </a>
  237. </li>
  238. </ul>
  239. </nav>
  240. </li>
  241. <li class="md-nav__item md-nav__item--nested">
  242. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
  243. <div class="md-nav__link md-nav__container">
  244. <a href="../advanced-features/index.html" class="md-nav__link ">
  245. <span class="md-ellipsis">
  246. Advanced Features
  247. </span>
  248. </a>
  249. <label class="md-nav__link " for="__nav_5" id="__nav_5_label" tabindex="0">
  250. <span class="md-nav__icon md-icon"></span>
  251. </label>
  252. </div>
  253. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
  254. <label class="md-nav__title" for="__nav_5">
  255. <span class="md-nav__icon md-icon"></span>
  256. Advanced Features
  257. </label>
  258. <ul class="md-nav__list" data-md-scrollfix>
  259. <li class="md-nav__item">
  260. <a href="../advanced-features/props-variety.html" class="md-nav__link">
  261. <span class="md-ellipsis">
  262. Props for Variety
  263. </span>
  264. </a>
  265. </li>
  266. <li class="md-nav__item">
  267. <a href="../advanced-features/doors.html" class="md-nav__link">
  268. <span class="md-ellipsis">
  269. Doors
  270. </span>
  271. </a>
  272. </li>
  273. <li class="md-nav__item">
  274. <a href="../advanced-features/multiple-floors.html" class="md-nav__link">
  275. <span class="md-ellipsis">
  276. Multiple Floors
  277. </span>
  278. </a>
  279. </li>
  280. <li class="md-nav__item">
  281. <a href="../advanced-features/lock-key-system.html" class="md-nav__link">
  282. <span class="md-ellipsis">
  283. Lock & Key System
  284. </span>
  285. </a>
  286. </li>
  287. <li class="md-nav__item">
  288. <a href="../advanced-features/injecting-tiles.html" class="md-nav__link">
  289. <span class="md-ellipsis">
  290. Injecting Special Tiles
  291. </span>
  292. </a>
  293. </li>
  294. <li class="md-nav__item">
  295. <a href="../advanced-features/connection-rules.html" class="md-nav__link">
  296. <span class="md-ellipsis">
  297. Tile Connection Rules
  298. </span>
  299. </a>
  300. </li>
  301. <li class="md-nav__item">
  302. <a href="../advanced-features/attached-dungeons.html" class="md-nav__link">
  303. <span class="md-ellipsis">
  304. Generating Attached Dungeons
  305. </span>
  306. </a>
  307. </li>
  308. <li class="md-nav__item">
  309. <a href="../advanced-features/additional-collisions.html" class="md-nav__link">
  310. <span class="md-ellipsis">
  311. Avoid Collisions With the Scene
  312. </span>
  313. </a>
  314. </li>
  315. <li class="md-nav__item">
  316. <a href="../advanced-features/runtime-events.html" class="md-nav__link">
  317. <span class="md-ellipsis">
  318. Runtime Events & Code Execution
  319. </span>
  320. </a>
  321. </li>
  322. <li class="md-nav__item">
  323. <a href="../advanced-features/post-processing.html" class="md-nav__link">
  324. <span class="md-ellipsis">
  325. Custom Post-Processing
  326. </span>
  327. </a>
  328. </li>
  329. <li class="md-nav__item">
  330. <a href="../advanced-features/character-component.html" class="md-nav__link">
  331. <span class="md-ellipsis">
  332. DunGen Character Component
  333. </span>
  334. </a>
  335. </li>
  336. </ul>
  337. </nav>
  338. </li>
  339. <li class="md-nav__item md-nav__item--nested">
  340. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" >
  341. <div class="md-nav__link md-nav__container">
  342. <a href="../optimization/index.html" class="md-nav__link ">
  343. <span class="md-ellipsis">
  344. Optimization
  345. </span>
  346. </a>
  347. <label class="md-nav__link " for="__nav_6" id="__nav_6_label" tabindex="0">
  348. <span class="md-nav__icon md-icon"></span>
  349. </label>
  350. </div>
  351. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
  352. <label class="md-nav__title" for="__nav_6">
  353. <span class="md-nav__icon md-icon"></span>
  354. Optimization
  355. </label>
  356. <ul class="md-nav__list" data-md-scrollfix>
  357. <li class="md-nav__item">
  358. <a href="../optimization/culling.html" class="md-nav__link">
  359. <span class="md-ellipsis">
  360. Built-in Culling
  361. </span>
  362. </a>
  363. </li>
  364. <li class="md-nav__item">
  365. <a href="../optimization/tile-pooling.html" class="md-nav__link">
  366. <span class="md-ellipsis">
  367. Tile Pooling
  368. </span>
  369. </a>
  370. </li>
  371. </ul>
  372. </nav>
  373. </li>
  374. <li class="md-nav__item md-nav__item--nested">
  375. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
  376. <div class="md-nav__link md-nav__container">
  377. <a href="../pathfinding/index.html" class="md-nav__link ">
  378. <span class="md-ellipsis">
  379. Pathfinding
  380. </span>
  381. </a>
  382. <label class="md-nav__link " for="__nav_7" id="__nav_7_label" tabindex="0">
  383. <span class="md-nav__icon md-icon"></span>
  384. </label>
  385. </div>
  386. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
  387. <label class="md-nav__title" for="__nav_7">
  388. <span class="md-nav__icon md-icon"></span>
  389. Pathfinding
  390. </label>
  391. <ul class="md-nav__list" data-md-scrollfix>
  392. <li class="md-nav__item">
  393. <a href="../pathfinding/unity-navmesh.html" class="md-nav__link">
  394. <span class="md-ellipsis">
  395. Unity NavMesh Components
  396. </span>
  397. </a>
  398. </li>
  399. <li class="md-nav__item">
  400. <a href="../pathfinding/astar-pathfinding.html" class="md-nav__link">
  401. <span class="md-ellipsis">
  402. A* Pathfinding Project Pro
  403. </span>
  404. </a>
  405. </li>
  406. <li class="md-nav__item">
  407. <a href="../pathfinding/custom-adapters.html" class="md-nav__link">
  408. <span class="md-ellipsis">
  409. Custom Adapters
  410. </span>
  411. </a>
  412. </li>
  413. </ul>
  414. </nav>
  415. </li>
  416. <li class="md-nav__item md-nav__item--nested">
  417. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
  418. <div class="md-nav__link md-nav__container">
  419. <a href="../integrations/index.html" class="md-nav__link ">
  420. <span class="md-ellipsis">
  421. Integrations
  422. </span>
  423. </a>
  424. <label class="md-nav__link " for="__nav_8" id="__nav_8_label" tabindex="0">
  425. <span class="md-nav__icon md-icon"></span>
  426. </label>
  427. </div>
  428. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
  429. <label class="md-nav__title" for="__nav_8">
  430. <span class="md-nav__icon md-icon"></span>
  431. Integrations
  432. </label>
  433. <ul class="md-nav__list" data-md-scrollfix>
  434. <li class="md-nav__item">
  435. <a href="../integrations/sectr.html" class="md-nav__link">
  436. <span class="md-ellipsis">
  437. SECTR Portal Culling
  438. </span>
  439. </a>
  440. </li>
  441. <li class="md-nav__item">
  442. <a href="../integrations/playmaker.html" class="md-nav__link">
  443. <span class="md-ellipsis">
  444. PlayMaker Actions
  445. </span>
  446. </a>
  447. </li>
  448. </ul>
  449. </nav>
  450. </li>
  451. <li class="md-nav__item md-nav__item--nested">
  452. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_9" >
  453. <div class="md-nav__link md-nav__container">
  454. <a href="../troubleshooting/index.html" class="md-nav__link ">
  455. <span class="md-ellipsis">
  456. Troubleshooting
  457. </span>
  458. </a>
  459. <label class="md-nav__link " for="__nav_9" id="__nav_9_label" tabindex="0">
  460. <span class="md-nav__icon md-icon"></span>
  461. </label>
  462. </div>
  463. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
  464. <label class="md-nav__title" for="__nav_9">
  465. <span class="md-nav__icon md-icon"></span>
  466. Troubleshooting
  467. </label>
  468. <ul class="md-nav__list" data-md-scrollfix>
  469. <li class="md-nav__item">
  470. <a href="../troubleshooting/limitations.html" class="md-nav__link">
  471. <span class="md-ellipsis">
  472. Limitations & Considerations
  473. </span>
  474. </a>
  475. </li>
  476. <li class="md-nav__item">
  477. <a href="../troubleshooting/analysis.html" class="md-nav__link">
  478. <span class="md-ellipsis">
  479. Analysis
  480. </span>
  481. </a>
  482. </li>
  483. </ul>
  484. </nav>
  485. </li>
  486. <li class="md-nav__item md-nav__item--nested">
  487. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_10" >
  488. <label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
  489. <span class="md-ellipsis">
  490. Reference
  491. </span>
  492. <span class="md-nav__icon md-icon"></span>
  493. </label>
  494. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
  495. <label class="md-nav__title" for="__nav_10">
  496. <span class="md-nav__icon md-icon"></span>
  497. Reference
  498. </label>
  499. <ul class="md-nav__list" data-md-scrollfix>
  500. <li class="md-nav__item">
  501. <a href="../reference/faq.html" class="md-nav__link">
  502. <span class="md-ellipsis">
  503. FAQ
  504. </span>
  505. </a>
  506. </li>
  507. <li class="md-nav__item">
  508. <a href="../reference/cookbook.html" class="md-nav__link">
  509. <span class="md-ellipsis">
  510. Cookbook
  511. </span>
  512. </a>
  513. </li>
  514. </ul>
  515. </nav>
  516. </li>
  517. </ul>
  518. </nav>
  519. </div>
  520. </div>
  521. </div>
  522. <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
  523. <div class="md-sidebar__scrollwrap">
  524. <div class="md-sidebar__inner">
  525. <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  526. <label class="md-nav__title" for="__toc">
  527. <span class="md-nav__icon md-icon"></span>
  528. Table of contents
  529. </label>
  530. <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
  531. <li class="md-nav__item">
  532. <a href="#setting-up-the-generator" class="md-nav__link">
  533. <span class="md-ellipsis">
  534. Setting Up the Generator
  535. </span>
  536. </a>
  537. </li>
  538. </ul>
  539. </nav>
  540. </div>
  541. </div>
  542. </div>
  543. <div class="md-content" data-md-component="content">
  544. <article class="md-content__inner md-typeset">
  545. <h1 id="getting-started-scene-setup-first-generation">Getting Started: Scene Setup &amp; First Generation</h1>
  546. <p>Now that we have our dungeon flow set up, it's time to generate it.</p>
  547. <hr />
  548. <h2 id="setting-up-the-generator">Setting Up the Generator</h2>
  549. <p>Start with a clean scene or an empty GameObject in your existing one.</p>
  550. <ol>
  551. <li>Create a new <code>GameObject</code> and name it <strong>Dungeon Generator</strong></li>
  552. <li>Add the <code>Runtime Dungeon</code> component:<br />
  553. <code>Add Component &gt; DunGen &gt; Runtime Dungeon</code></li>
  554. </ol>
  555. <p><img align="left" alt="Runtime Dungeon Settings" src="../assets/images/getting-started/runtime-dungeon-settings.png" width="300" /></p>
  556. <p>In the Inspector:</p>
  557. <ul>
  558. <li>Assign your <strong>Dungeon Flow</strong> asset to the appropriate field</li>
  559. <li>Make sure <strong>Generate On Start</strong> is checked</li>
  560. </ul>
  561. <div style="clear: both;"></div>
  562. <p>Now when you enter Play Mode, DunGen will automatically generate a dungeon based on your setup.</p>
  563. <blockquote>
  564. <p>🎥 <strong>Tip:</strong><br />
  565. Switch to the Scene view during Play Mode to fly around and inspect the layout. </p>
  566. </blockquote>
  567. <p><img alt="Generated Dungeon Layout" src="../assets/images/getting-started/final-generated-dungeon.png" /></p>
  568. <details class="example">
  569. <summary>Generating in Code</summary>
  570. <p>We can generate a new dungeon in code as follows. Add this new component to any GameObject in your scene and be sure to assign your <code>Runtime Dungeon</code> to the field. Now, pressing <span class="keys"><kbd class="key-r">R</kbd></span> will generate a new random dungeon.</p>
  571. <div class="language-csharp highlight"><span class="filename">GenerateDungeonOnKeyPress.cs</span><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="k">using</span><span class="w"> </span><span class="nn">DunGen</span><span class="p">;</span>
  572. </span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="k">using</span><span class="w"> </span><span class="nn">UnityEngine</span><span class="p">;</span>
  573. </span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a>
  574. </span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="k">public</span><span class="w"> </span><span class="k">class</span><span class="w"> </span><span class="nc">GenerateDungeonOnKeyPress</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">MonoBehaviour</span>
  575. </span><span id="__span-0-5"><a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a><span class="p">{</span>
  576. </span><span id="__span-0-6"><a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="w"> </span><span class="k">public</span><span class="w"> </span><span class="n">RuntimeDungeon</span><span class="w"> </span><span class="n">RuntimeDungeon</span><span class="p">;</span>
  577. </span><span id="__span-0-7"><a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a>
  578. </span><span id="__span-0-8"><a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="w"> </span><span class="k">void</span><span class="w"> </span><span class="nf">Update</span><span class="p">()</span>
  579. </span><span id="__span-0-9"><a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a><span class="w"> </span><span class="p">{</span>
  580. </span><span id="__span-0-10"><a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a><span class="w"> </span><span class="k">if</span><span class="p">(</span><span class="n">Input</span><span class="p">.</span><span class="n">GetKeyDown</span><span class="p">(</span><span class="n">KeyCode</span><span class="p">.</span><span class="n">R</span><span class="p">))</span>
  581. </span><span id="__span-0-11"><a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a><span class="w"> </span><span class="p">{</span>
  582. </span><span id="__span-0-12"><a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a><span class="w"> </span><span class="kt">var</span><span class="w"> </span><span class="n">generator</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">RuntimeDungeon</span><span class="p">.</span><span class="n">Generator</span><span class="p">;</span>
  583. </span><span id="__span-0-13"><a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a><span class="w"> </span><span class="n">generator</span><span class="p">.</span><span class="n">Generate</span><span class="p">();</span>
  584. </span><span id="__span-0-14"><a id="__codelineno-0-14" name="__codelineno-0-14" href="#__codelineno-0-14"></a><span class="w"> </span><span class="p">}</span>
  585. </span><span id="__span-0-15"><a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a><span class="w"> </span><span class="p">}</span>
  586. </span><span id="__span-0-16"><a id="__codelineno-0-16" name="__codelineno-0-16" href="#__codelineno-0-16"></a><span class="p">}</span>
  587. </span></code></pre></div>
  588. </details>
  589. </article>
  590. </div>
  591. <script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>
  592. <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
  593. </div>
  594. <button type="button" class="md-top md-icon" data-md-component="top" hidden>
  595. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
  596. Back to top
  597. </button>
  598. </main>
  599. <footer class="md-footer">
  600. <nav class="md-footer__inner md-grid" aria-label="Footer" >
  601. <a href="3-dungeon-flow.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: 3. Dungeon Flow Basics">
  602. <div class="md-footer__button md-icon">
  603. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
  604. </div>
  605. <div class="md-footer__title">
  606. <span class="md-footer__direction">
  607. Previous
  608. </span>
  609. <div class="md-ellipsis">
  610. 3. Dungeon Flow Basics
  611. </div>
  612. </div>
  613. </a>
  614. <a href="../core-concepts/index.html" class="md-footer__link md-footer__link--next" aria-label="Next: Overview">
  615. <div class="md-footer__title">
  616. <span class="md-footer__direction">
  617. Next
  618. </span>
  619. <div class="md-ellipsis">
  620. Overview
  621. </div>
  622. </div>
  623. <div class="md-footer__button md-icon">
  624. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11z"/></svg>
  625. </div>
  626. </a>
  627. </nav>
  628. <div class="md-footer-meta md-typeset">
  629. <div class="md-footer-meta__inner md-grid">
  630. <div class="md-copyright">
  631. <div class="md-copyright__highlight">
  632. Copyright &copy; Aegon Games Ltd.
  633. </div>
  634. Made with
  635. <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
  636. Material for MkDocs
  637. </a>
  638. </div>
  639. </div>
  640. </div>
  641. </footer>
  642. </div>
  643. <div class="md-dialog" data-md-component="dialog">
  644. <div class="md-dialog__inner md-typeset"></div>
  645. </div>
  646. <script id="__config" type="application/json">{"base": "..", "features": ["content.code.annotate", "content.code.copy", "content.tabs.link", "announce.dismiss", "header.autohide", "navigation.footer", "navigation.indexes", "navigation.top", "navigation.tracking"], "search": "../assets/javascripts/workers/search.f8cc74c7.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
  647. <script src="../assets/javascripts/bundle.c8b220af.min.js"></script>
  648. </body>
  649. </html>