# [MUD-Dev] 2d mapping in SQL

&lt &lt
Tue Mar 30 22:12:56 New Zealand Daylight Time 2004

```From: Matt Chatterley

>   What about making this a proper model? How might I aim to create
>   'clusters' of planets (e.g. solar systems)?

Your ObjectType could simply be an object (cluster pack) which then
refers to other objects under it's influence.

I notice that you're using x/y (rectangular coords).  You might try
playing with polar coordinates.

All you need is angle, distance, ObjectID and one more data point -
radius of the sphere.  Your planets are not an infinitely small
point in the universe, they take up space.  This model also buys you
"spheres of influence" if you modeled gravitational pull, LOS for
shadows, and a meta-object (cluster/solar system/whatever) which
encompases other objects.  Think: map/array of planets within a
custerObject.

> The solar system example is not too bad, I suppose. Parameters
> such as those above could govern the placing of suns, and once a
> sun (or group of) is placed, a certain density of planets would be
> permitted in a given area around that sun-group. This would
> require a rather different approach to map expansion, though,
> since new 'clusters' would be created (you don't want a new planet
> to suddenly spring into existence in an area populated by players
> - this would cause mass confusion, and numerous arguments as to
> whose planet is blocking the sunlight in whose garden!!).

You have all the data you need at your fingertips for player
populations.  You might look into a statistics book and plotting
point-graphs.  You may find an algorithm for determining the
xth-percentile-fall-into-this-region which you can use for
balancing.

> Would some sort of fractal algorithm be more sensible?

Possibly, but as the game progresses you'd probably end up chewing
mass CPU time looking for a good spot.

IMO, just grow the universe a little.  In a polar-coordinate model
you don't have to put finite constraints on your systems.  It just
"is" and everything's related to angle and distance.

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

```