What I don't understand is how it works. When I looked at the source code, it says that "if at least X amount of tiles are within 1 radius of a tile, and at most Y amount of tiles are within 2 radius of a tile, then the tile changes".
I can't see the logic behind the "at most Y amount of tiles are within 2 radius" part. I don't really HAVE to, because it works fine with a 30% fill with a 4 0 2 generation and that's all I really need. But I'm curious...
> What I don't understand is how it works. When I looked at the source > code, it says that "if at least X amount of tiles are within 1 radius > of a tile, and at most Y amount of tiles are within 2 radius of a tile, > then the tile changes".
> I can't see the logic behind the "at most Y amount of tiles are within > 2 radius" part. I don't really HAVE to, because it works fine with a > 30% fill with a 4 0 2 generation and that's all I really need. But I'm > curious...
> Can anyone explain this to me? Thanks!
Usually, a cellular automaton uses the number of adjacent squares; if 5 or more squares are squares in radius 1, the cell is a wall, otherwise, a floor. The problem with this is that it tends to generate large open spaces, which are uninteresting as far as roguelikes go. the soulution is to take any uninteresting tiles, those that are all alone, and make that area more interesting, by adding walls to it. I just makes the map more interesting is all. I find that I haven't needed to do that, that I get interesting enough maps with 1 generation and 42% fill. There are lots of interesting things you can do with cellular automata.
> What I don't understand is how it works. When I looked at the > source code, it says that "if at least X amount of tiles are > within 1 radius of a tile, and at most Y amount of tiles are > within 2 radius of a tile, then the tile changes".
> I can't see the logic behind the "at most Y amount of tiles are > within 2 radius" part. I don't really HAVE to, because it works > fine with a 30% fill with a 4 0 2 generation and that's all I > really need. But I'm curious...
> Can anyone explain this to me? Thanks!
The page you referenced is unreachable (invalid domain name), but that rule sounds like what I described in this article: http://www.jimrandomh.org/misc/caves.html (second draft with nice HTML formatting of article first published as http://www.jimrandomh.org/misc/caves.txt), which explains the reasoning behind the radius-2 rule. It fills in big empty spaces without breaking connections, so that you can seed with a lower fill and usually get a uniform looking, connected dungeon.
jimrandomh wrote: > "Verdagon" <Verda...@gmail.com> wrote: >> Can anyone explain this to me? Thanks!
> The page you referenced is unreachable (invalid domain name), but that > rule sounds like what I described in this article: > http://www.jimrandomh.org/misc/caves.html
Ah yes, sorry bout the link. The real ones are those you posted...
"It fills in big empty spaces without breaking connections, so that you can seed with a lower fill and usually get a uniform looking, connected dungeon."
What does "seed with a lower fill" mean?
Oh, another question I've been meaning to ask: when I tried the "4-5" thing on your site (Fill: 45%, R1Cutoff: 4, R2Cutoff: 5 Repeats: 5) all I got was a huge map, all walls, with one piece of floor. What's going on?
Thank you very much for your time. I really appreciate it!
"Verdagon" <Verda...@gmail.com> wrote: > Ah yes, sorry bout the link. The real ones are those you posted...
> "It fills in big empty spaces without breaking connections, so > that you can seed with a lower fill and usually get a uniform > looking, connected dungeon."
> What does "seed with a lower fill" mean?
You initialize (seed) the map by making some percentage of tiles walls (fill). So by this I meant, make fewer of the tiles walls initially.
> Oh, another question I've been meaning to ask: when I tried the > "4-5" thing on your site (Fill: 45%, R1Cutoff: 4, R2Cutoff: 5 > Repeats: 5) all I got was a huge map, all walls, with one piece of > floor. What's going on?
> Thank you very much for your time. I really appreciate it!
Ah, I think I see where the confusion comes from. The "4-5" rule is this: Tile T will be filled if either - T is already filled *and* at least 4 of its neighbors are filled - T is not yet filled *and* at least 5 of its neighbors are filled
This is the same thing as saying Tile T will be filled if the number of tiles within one step of T, including T itself, is at least 5.
But this is not the function which my sample program uses. The function I use is Tile T will be filled if the number of tiles within one step of T, including T itself, is at least R1Cutoff OR the number of tiles within TWO steps of T, including T itself, is at MOST R2Cutoff.
So, if R1Cutoff=4 and R2Cutoff=5, that will happen almost all of the time.
Anyways, the function I eventually chose as the 'best' answer was Fill: 40% Repeat 4 times: R1 cutoff: 5 R2 cutoff: 2 Repeat 3 times: R1 cutoff: 5 R2 cutoff: -1
So the parameters would be xsize ysize 40 5 2 4 5 -1 3
> jimrandomh wrote: >> "Verdagon" <Verda...@gmail.com> wrote: >>> Can anyone explain this to me? Thanks!
>> The page you referenced is unreachable (invalid domain name), but >> that rule sounds like what I described in this article: >> http://www.jimrandomh.org/misc/caves.html
jimrandomh wrote: > The Sheep <thesheep@ sheep.prv.pl> wrote: >> jimrandomh wrote: >>> "Verdagon" <Verda...@gmail.com> wrote: >>>> Can anyone explain this to me? Thanks! >>> The page you referenced is unreachable (invalid domain name), but >>> that rule sounds like what I described in this article: >>> http://www.jimrandomh.org/misc/caves.html >> Would you agree to put it on roguebasin? > Of course.
You still have the problem of getting rid of disjoint regions. How do you plan on tackling that?
I've implemented this nifty generator in my roguelike (I liked the looks of the samples and I didn't want to emulate NetHack with rooms and tunnels.. what kind of a _dungon_ has those?) and my current plan is to have the upstairs and downstairs be in the biggest region, and allow the smaller disjoint regions to exist.. maybe give the player a pickaxe and put some treasure in them. Heh. Any other ideas?
> You still have the problem of getting rid of disjoint regions. How do > you plan on tackling that?
Giving a pickaxe was my idea too :) and choosing entrance and exit in the same region (by pathfinding them), at least at the first levels.
Another idea: you could create a living dungeon, just by generating - let us say, every 50 rounds - a new cycle for the map, and coming backward then, like if it was 'pulsating'. Don't know if I am clear...