[Home] [Groups] - Message: [Prev in Group] [Next in Group]
16948: Re: [MUD-Dev] Room Generation
[Full Header] [Plain Text]
From: J C Lawrence <claw@kanga.nu>
Newsgroups: nu.kanga.list.mud-dev
Date: Fri, 19 Jan 2001 15:19:25 -0800
References: [1]
Organization: Kanga.Nu
On Fri, 19 Jan 2001 10:22:14 -0600
Nathanael Dermyer <NDermyer@HNTB.com> wrote:
> What I'm wondering is if anyone has some sort of mechanism (perl
> script, C program, VB, whatever) that will accept some sort of map
> file and a list that defines what each map symbol means, and spews
> out individual room files.
I'm not aware of such a tool (we're too enarly in the technology
curve for much standardisation). That said, its not an inherently
difficult problem. The basic algorithm would be something like:
Load file into a memory array
Traverse file and build a list of nodes (rooms)
Have each node point to ints location in the array.
Hav each node record its own type.
Traverse node list and build reverse index of array locations to nodes
Traverse node list and scan surrounding block of 8 characters for
link characters
For each link character, deduce the node location for the
indicated room, and build a link (note, you can support
one-direction links at this point).
You now have a graph, a mesh of nodes related by directional links
representing your room pattern. Now you just need to walk that
graph and dump the results in your desired format.
--
J C Lawrence claw@kanga.nu
---------(*) http://www.kanga.nu/~claw/
--=| A man is as sane as he is dangerous to his environment |=--
_______________________________________________
MUD-Dev mailing list
MUD-Dev@kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev