Re: A roguelike system in Perl
- From: Da-Breegster <dabreegster@xxxxxxxxx>
- Date: Thu, 07 Jul 2005 13:29:48 GMT
On 2005-07-07, The Sheep <thesheep@xxxxxxxxxxxx> wrote:
> At Thu, 07 Jul 2005 10:56:59 GMT,
> Da-Breegster wrote:
>
>> Well, right now, I start by building a random room somewhere in this big
>> blank cave. (In my system, a cave is like one level of the dungeon) The
>> borders of the room are created automatically and added to a list of
>> coordinates with borders. Then, the generator decides randomly to create
>> different excavations (rooms, hallways, mazes) and stuff. To make sure
>> all rooms are connected, it chooses a random coordinate from the border
>> list then looks to the left, right, up, and down of that tile. Whichever
>> direction has free space first is returned to the excavation generator.
>> (Right now there are only rooms though.) It'll build the room starting
>> from that point. I was even hoping to pull off some fancy stuff to where
>> it could scan outward from that point in advance and know how much room
>> there is. But so there wouldn't be boring rooms, I was going to have it
>> mark some spaces in the mini-map it returned as un-writable. So
>> basically it would end up skipping some spaces in order to look
>> interesting.
>
> As I see it, maybe you could get the benefits of the second approach while
> still using your original approach. Just store the backreferences to the
> rooms in the lists of coordinates with borders (or have a way to determine
> in which room given coordinate is) -- you can then do some fancy stuff
> with this list:
>
Backreferences to the rooms? Meaning each border coordinate thing in the
list somehow points back to its room? Well, first of all, 'rooms' are
nothing more than carved out spaces on the grid. Once they're built,
they're just there. They're not turned into objects or abstract-itized
or anything like that.
> 1. Don't add all the borders when making a room -- add only the preffered
> ones, probably marked on the room's template.
Good idea, I like it.
> 2. To limit the number of doors on the given wall, you can scan the list
> of coordinates and remove all from that wall once there's enough doors.
Or have a density variable and base it off that and the dimensions of
that wall.
> 3. You can do similar thing to limit the number of doors in a room, or
> even in some area...
> 4. You can give the coordinates (may I call them hotspots?) priorities,
> and sort their list, trying the ones from the beginning first.
> 5. Once you determine given hotspot is wrong (doesn't have enough room),
> you can remove it from the list.
>
>
I'm not sure how I'm going to handle it. I'll take a break and think
about it for a while.
>> The other way is pretty much the same, but, in the cave generator,
>> instead of choosing a random place to start from (well, semi-random:
>> it's determined by the list of borders so far.), it'd make a sort of
>> queue and for each room, build 1 to 4 connections leading out of the
>> rooms (in a cool sort of way, not just plain old doors and blank spaces
>> all the time), and then new excavations (rooms, remember) would be built
>> starting from these connections.
>
> Including 'connections' is a good idea, but for a reason you didn't
> mention. You need loops in your dungeon, or it will be a nightmare to
> navigate in. With the approach you described, it's really hard to connect
> a room (or any other feature) with more than one other room -- you end up
> with a tree-like structure.
>
> The 'connections' should help here, but I have no idea on how to make
> them?
>
Loops, that's it. I knew something was missing. Well, loops should be
formed already, sort of. In the example with the free space scanner, it
hit another room with a connection link thing, so it'll connect it. So
two long vertical hallways, for instance, that were spaced out a bit and
far away from each other would probably eventually have a connection
between them.
>> Anyway, the problem is, again, free space. Any clues? That's all, I
>> guess.
>
> The computers doesn't view 'space' as people do. I had similar ideas and
> similar problems -- I think that just trying to fit a room is the fastest
> way to determine free space.
>
I think I'll just scan outwards from the point I choose to build upon
and get an estimate of the space I have, so the width and height won't
always be off.
.
- References:
- Re: A roguelike system in Perl
- From: Breeg
- Re: A roguelike system in Perl
- From: The Sheep
- Re: A roguelike system in Perl
- From: Ray Dillinger
- Re: A roguelike system in Perl
- From: dabreegster
- Re: A roguelike system in Perl
- From: Chris Morris
- Re: A roguelike system in Perl
- From: dabreegster
- Re: A roguelike system in Perl
- From: dabreegster
- Re: A roguelike system in Perl
- From: Elethiomel
- Re: A roguelike system in Perl
- From: Chris Morris
- Re: A roguelike system in Perl
- From: Breeg
- Re: A roguelike system in Perl
- From: The Sheep
- Re: A roguelike system in Perl
- From: dabreegster
- Re: A roguelike system in Perl
- From: Sherm Pendley
- Re: A roguelike system in Perl
- From: dabreegster
- Re: A roguelike system in Perl
- From: Sherm Pendley
- Re: A roguelike system in Perl
- From: dabreegster
- Re: A roguelike system in Perl
- From: The Sheep
- Re: A roguelike system in Perl
- From: Da-Breegster
- Re: A roguelike system in Perl
- From: The Sheep
- Re: A roguelike system in Perl
- Prev by Date: Re: Light Sources
- Next by Date: Re: Light Sources
- Previous by thread: Re: A roguelike system in Perl
- Next by thread: Re: A roguelike system in Perl
- Index(es):
Relevant Pages
|