# [MUD-Dev] Spherical World Design

J C Lawrence claw at kanga.nu
Fri Jul 7 23:43:43 New Zealand Standard Time 2000

```On Sat, 7 Nov 1998 19:11:59 -0500
Philip Loguinov, Draymoor <fibhufky at erols.com> wrote:

> For a text based mud, I'm trying to design a round world for my
> planet rather then using a flat grid. I've gone through several
> ideas including using rooms and not using rooms, but every time I
> run into complications which don't have a...

Let's break this size business down a bit.

No matter if you are using rooms or a coordinate system you really
end up with a finite and known number of possible locations (eg room
X or coords X/Y/Z).

Note: This is true even if you are using floating point values for
your coordinate system -- ist just that the number of possible
locations happens to be very large in that case.  Why?  Accuracy
limits whcih define a minimum granularity for the FP values.

Okay, so we have a world which is composed of a limited number of
atomically defined positions.

How many possible positions do we want?  You say you want a
spherical planet.  Okay, how many "steps" of reasonable size must it
take a player to circle such a globe?  10?  100?  1,000?  100,000?
What is the actual __subjective__ diameter of your planet as
perceived by your players as motion constraint?

The smaller the number possible positions about a circumpherence,
the smaller the subjective size of your planet.  Imagine: if it only
took us 1,000 steps to circle the earth we'd think it was a damned
small place.  As it takes considerably more than that, we tend to
think the earth is kind of a Big Place.  MUDs are little different.

> Use a room grid but as you go farther from the equator, the
> "degrees" travelled across the globe increases because the
> distance decreases. IE, It takes less energy to move a room. At
> the very north and south, it would be as if it was one room, and
> take absolutely no energy to move laterally. I really don't like
> this solution because even though movement is compensated for,
> it's only an illusion and a poor one at that. Not to mention it
> kind of makes the world cylindrical.

> A nicer, but fatally flawed aproach was to have a web-like grid of
> rooms stretching out from the pole to the equator and back to the
> pole. Each layer of rooms would have an increasing number of
> rooms. The Pole would be one room, the next layer would be 4, and
> then it would double from there. Aside from the fact this would be
> hell to implement, it also increases way too quickly. It takes
> less then 10 layers of rooms from the north pole to get an equator
> of 1024 rooms.

An approach I've used makes a world which looks a lot like the
intersection of two perpendicual cylinders (basically you wrap both
axis).  It gets a little funky on the arithmetic for the edges of
the intersection (stairstep it and creatively ignore overlaps unless
you want to get expensive), but it works surprising well in giving a
cheap impression of a round world (and orbiting objects are also
easy to do).

> The idea I really like and want to use is similar to the first but
> it doesn't use rooms. Instead, it uses a meter by meter grid which
> is defined by an equator diameter. From that, I can generate a
> longitude/latitude grid and assign degree measures to each
> latitudal layer based on how far away it is from the equator and
> some math. The problem here is that the world is still
> cylindrical.

See above.  You still retain a square grid, you just fudge a lot
around the four edges of the intersection to get a pretty good
subjective apparancy of a sphere.  If you want to get really fancy,
you could increase the number of cylinders in the intersection and
get a closer approximation without massively increasing the compute
overhead, it just gets harder to visualise to figure out the
acceptable artithmetic approximations.

> Has anyone done something like this before that they could share
> they're experiance? Any ideas would be appreciated, actually.

Next up is using a regular polyhedron of some sort.  There's a nice
series of polyhedrons based on equilateral triangles you could base
off.  What's particularly nice about that is that the resulting
triangles map so well to hexagons for standard map approaches.

--
"Finally coming home"                       Home: claw at kanga.nu
J C Lawrence                               Other: coder at kanga.nu
----------(*)                     Keys etc: finger claw at kanga.nu
--=| A man is as sane as he is dangerous to his environment |=--

_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev

```