Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Mapping node relationships

by one4k4 (Hermit)
on May 13, 2003 at 13:21 UTC ( [id://257717]=note: print w/replies, xml ) Need Help??


in reply to Re: Mapping node relationships
in thread Mapping node relationships

So, in your first paragraph; You'd simply generate a room-to-room display disregarding where they lay.. kinda like those huge "maps of the internet" that Bob Dole invented? Diku-MUD, I'll look into that, thanks.

Only storing the outlines of the room is something that completly passed me by. This way you could, in theory, have a room that's oddly shaped too.. at least in my theory. Which is to say.. random.

The MUD itself is basically a large test of my oop/mod_perl/SOAP abilities through Perl. Of course.

Thanks for the advice

One4k4 - perlmonks@poorheart.com (www.poorheart.com)

Replies are listed 'Best First'.
Re3: Mapping node relationships
by dragonchild (Archbishop) on May 13, 2003 at 13:37 UTC
    FYI: In the DikuMUD (and its descendents) representations, there is only the room. Each room has an ID and a list of exits. An exit is a pair consisting of direction ID and room ID. If the exit doesn't exist, you can't go that direction.

    Now, this ends up with a Zorkifying influence. You stand in room 1. You go "south" into room 2. However, to get back to room 1, you have to go "northeast" (or whatever). This is poor mapping technique, but the possibility still exists.

    As for storing just the coordinates - there's another problem to be aware of - you have to make sure that you don't have overlapping coordinate groups. Also, it is possible that you will have the same coordinate list up to 8 times, once for each room.

    Now, the storage of this - I would recommend having a ROOM table and a ROOM_COORD table which foreign-key's back to the ROOM table. This also allows for something like ROOM_TRAP, ROOM_ITEM, etc - all FK'ing back to ROOM.

    Of course, the entire room discussion presupposes that you want an imperfect model. Another way is to have objects contain their location rather than locations containing their objects. The room system is the latter. The problem with the former is the issue of description. It is very difficult in a text-based system to auto-generate descriptions back to a user when there isn't a set description for the location. Object-based systems are only really possible with graphical ray-traced systems, like EverQuest. But, it's still something to think about.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

      Very true. I understand your explaination of Diku, and I think it may also lead to odd coding when it comes to things like "soandso enters from the north" or somesuch, but I haven't looked into Diku very deeply yet.

      Storing coordinates for each room would leave a table that can be fairly large, but HD space isn't really an issue, speed would be the issue.. Indexes aside, I don't want to turn into a full time DBA for it.

      I have the two tables (room and room coord) you mentioned, they're key'd on room_id, with room coord containing x,y,z locations that I planed to draw a square on.. or fill in the blank on a HTML table that I don't really want to resort too..

      It's not an object based system in that I really only want to map when viewing things online. Such as where "so and so" is, or for admin purposes. I would love the ability to have each room exit that is not leading to another exit be a link (think: image map?) to an app that will create a new room.. so there can be a fairly high level way to generate new rooms.. other than the simple commands a citizen can use to make them.. but that's in the future.

      There is a room_exit table that will allow for things like leaving south to room 2, but you have to go up to get back to room 1 or somesuch. That's up to the question "why", which is better answered in the context of the game itself. There is a table called room_inventory which is key'd again, on room_id and key'd out to the inventory table(for descriptions,etc) too..

      I guess my questions all boil down to how it's possible to take x,y,z coords and draw something there..I'm going to look into how other muds do this a bit more.

      One4k4 - perlmonks@poorheart.com (www.poorheart.com)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://257717]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-16 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found