[MUD-Dev] Room Generation
Kwon Ekstrom
justice at softhome.net
Fri Jan 19 21:42:11 CET 2001
Nathanael Dermyer <NDermyer at HNTB.com> wrote:
<EdNote: Actually that was J C Lawrence>
> 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).
Seems to me that you're going over the same information repeatedly.
IMHO, it would be more efficient to have a custom data structure to
store the data per room, then parse as you go when reading the file.
Read in what you need for each room, then parse there. From the
example I assume that a switch statement comparing character values
would be adequate to map values to the data structure. After that
you'd simply need to know how to output it in the proper file format.
_______________________________________________
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