[MUD-Dev] Rooms, 3D arrays, etc.

Nathan Yospe yospe at hawaii.edu
Sun May 25 12:46:50 CEST 1997


On Sun, 25 May 1997, Michael Hohensee wrote:

:	I haven't had much time to read everything that's been posted 
:recently, and I hope I'm being somewhat original, but instead of trying 
:to decide which system to use- diku-style rooms, or a vast 3D array which 
:houses characters, why not use both?

Aside from the fact that I don't implement it as an array, this sounds
familiar. *grin* Fairly original... only a few dozen people have suggested
it. In any case... the main difference between my rooms and my fields and
semifields (formerly zones and fields) is how descriptions are presented,
and the fact that there are wall objects at the barriers. I make it
optional to prevent getting through the wall to the next room, but I had
to make it possible when reasonable after a friend was testing an area in
version 5 of my codebase, and decided to take a room out by putting a
couple charges on the wall on either side of the door and tossing grenades
through the resulting holes... which prooved not to go through, as I had
not actually coded barriers. Once I had, the scene worked much better. A
field describes itself based on how you are facing. A room describes
itself a little less dynamicly, showing all four walls as is normal when
you look around a room.

:	This idea came while i was looking at the areas that I wanted to 
:write for my own MUD.  I wanted to make sea routes, but I couldn't really 
:justify making it so that you have to follow one path.  It's the ocean, 
:after all.  The same thing occurs in large, open plains.

Right. I've posted this before, but...

> look
The flat green plain stretches away into a distant ridge of hills to
your right. Sixty meters to your left, a crop of trees springs up, thick
and forbidingly twisted. The strange, flat grass crunches under your
feet, releasing a pungent scent. Ahead, thirty meters off, a twisting
blue stream makes its slow, twisting way out of the small dark forest.
Sparse clouds drift by overhead.
Something streaks by overhead with a roar. A cluster bomb explodes ten 
meters off ahead to your right! A piece of turf flies by, but misses 
you.
> run
You start running toward the stream.
> run forest
You turn toward the forest, running as fast as you can. A roaring sound
reaches your ears. The forest is thirty meters away. Something roars by
overhead, leaving the impression of a silver streak in your eyes. A 
whistling sound reaches your ears. An impulse makes you dodge left, and
a reddish object streaks by your right ear. The missile starts to climb,
but impacts into the forest. You keep running. The forest is ten meters
away. You dodge as branch as you reach the edge of the forest. You stop,
winded, to catch your breath. You are just within the edge of a small, 
gnarled forest. Ahead and to each side, crooked black branches tangle 
together, making it impossible to pass without considerable effort. 
Mushrooms grow out of the mulch and rot at your feet, and there is a 
damp smell to the air. The sun filters through the treetops, almost
entirely gone by the time it reaches you.
> look plain
You turn around and stare out through the edge of the forest. The plain
stretches out into the distance. Far ahead, the flat green plain 
stretches away into a distant ridge of hills. Thirty meters ahead and to
the left, a twisting blue stream makes its slow, twisting way out of the
small dark forest. Far off to the right, a fence surrounds a complex of
buildings.
> hold rifle
You pull your plasma rifle out of the leather holster across your back 
and cradle it in your arms.
> reload rifle
The current bolt has a full charge. You don't need to reload.
> hold grenade
Shifting your plasma rifle into one hand, you detatch a sonic grenade
from the strap across your chest and prime it.
A pack of about twelve Logran drones is approaching from the direction 
of the complex of buildings. They are about 300 meters away.
> focus logran
You adjust your optical cybernetics to focus on the pack of Logran 
drones. There are fourteen of them. Magnification is at x300. The pack
is led by a class three hunter. The Logran drones are carrying laser 
rods. The Logran hunter c3 is carrying a rail cannon. They are heading
in your direction. They are about 250 meters away.


:	So why not set up such a 3D array, with a default description 
:based on terrain type.  For the rooms that actually get "created", you 
:simply give it a special description.  In this system, "exits" should be 
:replaced by barriers.  In effect, you should be able to go in any 
:direction you please, as long as there isn't something in the way.  The 
:default would be to allow you to change position in the array.

As you can see above, this can be taken even farther. From one of my
area files:

#AREA [
> mindscape {    // reference name 'mindscape'
F mindscape.are  // saves to file 'mindscape.are'
N The Mindscape~ // named "The Mindscape" in game
A FireBrand      // Author == 'FireBrand'
O mindscape2.are // Has occurance generatable alternate
}
]

#HELPS [
> {
 K mindscape~     // global information database entry
 D Database entry #000 - The Mindscape
A world without form, existing somewhere within the event horizon of 
the singularity XBC-3201, the mindscape is under code Omega edict.
~
}
]

#ROOMS [
> central {       // reference name 'mindscape:central'
 R Cocooned within the heart of the gray mist~, this single occurance of
clear, open air seems strangely cool... <s1>The faint scent of thick, 
dry fog wraps itself around you. </s><h4>A gentle hum fills the space 
within the mist. </h><v6>Tiny beads of water drift in and out of the 
near weightless center of the space, a rainbow trapped within each 
gleaming sphere. </v>
~
                  // default atmosphere = earth normal
 T none           // no ground
 G .25            // quarter strength gravity
                  // default temperature = room temp

 D -1 mist {      // an exit set for all directions to 'mindscape:mist'
  L The mist is inpenetrably thick.
~
  M As you approach the mist, tendrils seem to reach out for you, 
enveloping you in cool dampness. A final step, and it closes behind you.
~
  L $n disappears into the mist.
~
  E <h2>A faint sucking sound reaches your ears. </h>Something seems to 
have entered the mists. <v1>A shape resolves itself to your eyes as $n. 
</v>
~
 }
}
]

#FIELDS [
> mist {
 @ 0 0 0
 D -1 central{
  L A ^b glow illuminates the curling mist.
~
  M The mist parts, and sudden light, almost blinding, stuns you.
~
  E $n steps out of the mist.
~
 }
 @ -10 0 0 
 I rock
 @ 10 10 0
 I puddle
}
]

#ITEMS [
> rock {
 N rock stone~
 S $a rock~
 L A rock juts out of the mist.
~
 D There is nothing particularly extraordinary about this rock, outside
of its location. It looks strangely massive, as if it were too real.
~
 C stone
 M 10000
 S 50 50 50
}

> puddle {
 N puddle water~
 S $a puddle~
 L A puddle of water has pooled in the mist.
~
 D It looks like an unusually pure puddle of water.
~
 C water
 M 100
 V 1000
}
]

This doesn't show some of the better parts, such as the ranged specifity
descriptions that can be tagged to locations within a field, or to
Infinity at direction (for things seen off on the horizon)

:	Heck, this could get even more interesting if we made it a 4D 
:array.  The standard 3 dimensions you move around in, and the 4th would 
:be time.  It would make time travel an easier thing to deal with.  Ie, 
:Archon goes back in time, and moves two rooms east.  He then comes back 
:to his original time, popping up in the room corresponding with his 
:original position.

Aaaarrrggghhh!!! My head!!!

:	This circumvents problems that you currently get with diku-style 
:rooms, in which you'd have to set up some complicated vnum system to keep 
:track of which room in the "future" corresponds to another room in the 
:"past".  Furthermore, you wouldn't have to worry that there isn't a 
:corresponding room, since the array guaruntees it's existance.

You do the time. I don't wanna.

:	The only trouble would be to load the original array.  I've been 
:thinking of using a file with a big character map, with each character 
:represtenting each room.  So you could make:

:	###W######
:	pppWpppppp
:	###W######
:	###WWWWWWW

:Where 	W= water
:	p= path
:	#= field.

:Since we've got tons of individual characters to choose from, we could 
:come up with every terrain type we could possibly want.  This would also 
:make it easier to have natural disasters change the terrain, since it 
:would be a simple matter of changing a few characters in the overall map.

:	Does this sound interesting to anyone?

Does decrease the literary impact if you do it off of a file that way.
Sort of gets a bit like NiMUD, especially if you still present it as
rooms. Ever seen NiMUD, btw? Most interesting Merc derivative...
In any case... 3D fields are good, but loading them off of terrain maps
like that? I dunno... suppose it could be interesting. I'd like to see one
defined from some random core dump. *grin* But I prefer to allow more
control over how the descriptions are created. (I do have something like
the randomness that I create at bariers. Parameters for the field are
randomized, and it will take you as far as you can go without _looking_
repetitive, but with no actually content except that which is generated
off of a positional algorithm in your viscinity. I've been thinking of
even allowing randomly generated rooms within this, so you can extend a
city world off to infinity, just endless miles of slums and skyscrapers,
with nothing of particular significance to them...)

:--
:Michael Hohensee		michael at mainstream.net

:Eagleson's Law:
:        Any code of your own that you haven't looked at for six or more
:months, might as well have been written by someone else.  (Eagleson is
:an optimist, the real number is more like three weeks.)

Careful design and comments can increase it to three months. Six months
is pushing it, though. *grin*


   __    _   __  _   _   ,  ,  , ,  
  /_  / / ) /_  /_) / ) /| /| / /\            First Light of a Nova Dawn
 /   / / \ /_  /_) / \ /-|/ |/ /_/            Final Night of a World Gone
Nathan F. Yospe - University of Hawaii Dept of Physics - yospe at hawaii.edu




More information about the mud-dev-archive mailing list