Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use Random Walk to generate a dungeon map?
    primarykey
    data
    text
    <p>Ok so, I'm making a 2d dungeon crawler and I want to randomize a map for it. Right now it's look like I'm going to use a Random Walk algoritm for the path, combined with a Perlin Noise for different the underworld enviroments (currently only 1, as I'm using my own shitty looking tile set consisting of only 1 rook image and 1 grass image, but whatever :D)</p> <p>So in figuring out how random walks work, it looks like I'm supposed to do something along the lines of this:</p> <p>*create two-dimensional array sized after the map.</p> <p>*pick random start postion and end postiont (I chose to put these on opposite sides of the map, randomly distributed across its side.</p> <p>*follow these steps until you hit your finish point:</p> <p>*pick a direction to 'walk' at random (only up, down, left, right because you otherwise I'm left with diagonal passes which the player can't walk through)</p> <p>*'walk' that direction for a random amount of steps (I randomize amount of steps first then walk one by one for bound checking later, rather than just drawing a line).</p> <p>*Everytime you 'walk' on a tile, turn that tile to 1 from originally 0.</p> <p>*repeat above steps until you hit your finish point.</p> <p>This leaves me with too much open ground, and too much closed ground. What I'm looking for is a path covered with rooms, sort of, but I want to control how big the 'rooms' become. I don't want 'rooms' to get too big, which some become. So I want the feeling of being in an enclosed space, but also I want to use as much of the map grid as possible.</p> <p>Is a random walk not suited for this? I was thinking about making every step have a certain width to it, maybe that could work.</p> <p>Or maybe I'm just implementing it wrong! I'm not a math genious sadly ;P</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload