Morning guys, it's been a while.
I've got a bit of an odd question / thought process happening here. I'm working on a MUD and for the purposes of this e-mail, lets simply say that it's complete and working..
I wanted to generate maps (using gif/pngs read: GD* type stuff) so that users can view where their character lies online, and so admins can track npc movements, pc movements, etc.. stuff like that.
But my first step is to simply map everything plain-n-simple like.
A sample database record contains something like this:
room_id,x,y,z
1,0,0,0
2,1,0,0
and so on..
I can add a column to specify the "type" of room, be it outdoors, woods, lava, etc.. but that's not an issue. Yet.
I've got a relationship table similar to the following:
room_id,exit_to_room_id, exit_direction
1,2,e
2,1,w
That's how I can go about building the x,y,z stuff above. If the direction we moved is east, then x++, etc..
I looked into point based maps via some modules found on CPAN, but can't really think about how to draw the relationships.
For that matter, I can use a large-large table with 10px by 10px cells and map that way, but I'd like to use a png/image of sorts.
Any thoughts? Links? Flames?
Thanks in advance,
One4k4 -
perlmonks@poorheart.com (
www.poorheart.com)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.