On Tue, 2004-03-16 at 00:30, Matt Chatterley wrote:
> What about making this a proper model? How might I aim to create
> 'clusters' of planets (e.g. solar systems)?
If you're concerned with realism, you might want to note that the
distance from a star to its planets is vanishingly small compared to
the distance between stars. All the games I've played have either
hid the detail of planets from the overview map (you reach the star,
then zoom in to see its planets) or have ignored the distinction
between planet and star.
> 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!!).
But realism isn't particularly important in games, so there's no
reason not to ignore scale :) Why not place a sun and its planets,
and declare that system finished. When you need more planets, that
means you need more solar systems. A new player joins, the number
of current planets is less than the new minimum number of planets,
and so you find a place for a new solar system and give it a random
assortment of planets. If this satisfies the new minimum, you're
done, otherwise, you'll need to place more. This way, you may have
an excess of a few planets, but you'll never mess with existing
solar systems.
For choosing the location of a star system, you could specify a
minimum and maximum distance star systems will be from each other,
then establish the regions on your map that could contain a
potential new star system. Establish that as a bounding rectangle,
then pick random coordinates in there until the selected point falls
within the region.
For each system, construct two polygon approximating circles, one
with a radius of max_distance, one with a radius of min_distance.
Union all the large polygons, and all the small polygons. Find a
bounding box for the large union, and select a random point within
that box that is contained by the large union but not contained by
the small union.
> Has anyone worked with such a concept before, modeling a playing
> area in space, and if so, have they found any good reference
> material on the topic? I'm more interested in the playability of
> the generated map than it's realism, but still, I don't think this
> is going to be dealt with neatly by a simple mathematical
> routine..
I've played quite a few games of GalaxyNG, which is a play by email
space conquering game. It glosses over the distinction between star
system and planet; one element on the map is a planet, presumably
orbiting a star. During map creation, it sets up one cluster of
planets per player, with a given number of planets within a given
radius, and a given minimum distance between each player. It then
adds a number of 'stuff' planets with very low stats to bridge the
gaps between clusters.
Replace 'player' with 'star' and you're getting closer to what you
appear to want. The game is open source, and can be found at:
http://galaxyng.sourceforge.net/
--
bje