On Sat, 6 Dec 1997, StormeRider wrote: > Was thinking today as I took a break from tweaking guild code for stock > circle about the virtual map grid. Basically, when your in a room who's > sector type is a vmap sector, it would show you something like > > ggggggggg > ggggggggg > ggggggggg > ggggggggg > gggg*gggg > mgggggggg > mgggggggg > mgggggggg > mgggggggg I have a 200x50 room area dedicated to a wilderness. The rooms are set up such so that X/Y coordinates can be derived from the vnum (i.e. room vnum 50000 is 0,0 , 50001 is 0,1 etc.). The exits are virtual - rather than have 80,000 exits, a get_exit function is called to return exit in direction X, returning the pointer to a static exit structure. Most functions use the get_exit function to get the exit, except the few that really want the actual exit, like OLC. get_exit will return the rael exit if there is one, so it's possible to seamlessly link actaul areas into the wilderness. Displaying a map then is easy, since you know that if you are at coordinates 2,2, you should display room at (3,2) to your right, (1,2) to the left etc. The rooms are actual rooms, so the area takes up some memory. Each room has a legend and color field which decides how it shows up on the map. The map was originally made in theDraw. Only rooms which have changed are saved in the actual area file - otherwise they're loaded from a binary file which just has 4 bytes disk data saved per room, with sector type, legend type and color. Descriptions are then generated based on sector type. Once someone edits a room, it becomes a real room when saving it to disk. Having the rooms as real rooms rather than virtual means no modifications are necessary to all the room-editing tools, though it takes up more memory. I'll write some more about the wilderness in my MERC Programming FAQ some time ( I recently added some description of AR's introduction system to it. It's on my homepage. ). ============================================================================= Erwin Andreasen Herlev, Denmark <erwin@pip.dknet.dk> UNIX System Programmer <URL:http://www.abandoned.org/drylock/> <*> (not speaking for) DDE ============================================================================= +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST