Re: A roguelike system in Perl



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.
.



Relevant Pages

  • Re: A roguelike system in Perl
    ... > coordinates with borders. ... rooms in the lists of coordinates with borders (or have a way to determine ... and sort their list, trying the ones from the beginning first. ... > starting from these connections. ...
    (rec.games.roguelike.development)
  • Re: web part connections
    ... For the List View Web Part, you are correct: the radio buttons are what they ... then you have the ability to use any view style and fire connections. ... it would be the first tag in the page) and copy the entire block for the ... >> I've created three new lists in WSS site, ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Dynamic Menus in Lists
    ... What Mike is referring to is the ability to connect Web Parts. ... list would contain a country and state columns. ... The approach I would take is to create two custom lists. ... You would use Web Part Connections to filter the ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: R. Eliyahu calls for carpet bombing of Gaza
    ... these are our borders and now get on with life. ... What I would do is to send the IDF commanders around the West Bank and make two lists. ... I'd give compensation to any Palestinian who wants to move or is forced to move, and make it clear that any time a Palestinian government wants to negotiate changes, Israel would be willing to sit and agree to rational alterations. ...
    (soc.culture.jewish.moderated)
  • Re: R. Eliyahu calls for carpet bombing of Gaza
    ... with the existence of Israel in that time and show no sign of doing so ... these are our borders and now get on with life. ... IDF commanders around the West Bank and make two lists. ... negotiate changes, Israel would be willing to sit and agree to rational ...
    (soc.culture.jewish.moderated)