[MUD-Dev] Room Generation
J C Lawrence
claw at kanga.nu
Fri Jan 19 15:19:25 CET 2001
On Fri, 19 Jan 2001 10:22:14 -0600
Nathanael Dermyer <NDermyer at 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 at 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 at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list