This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Death of an advanced unit


On Wed, 2002-06-19 at 17:20, James R. Dunson wrote:
>    I've been thinking about early game strategies for the last few days as 
> a result of the discussions here, and while I'm not much of a C programmer, 
> I though I could present some sort of plan for discussion.  The following 
> is based on my experience with "terrestrial" Civ-style games (Civ I, II, 
> III; SMAC/X; Colonization; MOM; and others); IMO space-based games (MOO I, 
> II; SE III, IV, IV Gold; etc.) require a slightly different approach.  In 
> more general terms, I think the difference is whether terrain is fairly 
> continuous (Civ), or more discrete (MOO).  I also assume that there is some 
> sort of fog of war / unexplored map setup, although it should be 
> generalizable to situations where the whole map can be seen (mostly by 
> truncating the initial "view" distance to some reasonable limit for 
> purposes of settling).

There is a "fog-of-war" implemented in "Space Civilization" (my
project)  A civilization (about equivalent to a city in Civ) has a
vision range of 1 cell (but in the beginning, the area up to 4 cells
away is known), and can extend its vision range to 8 cells by building a
telescope.

> 
>    The initial problem is "first city".  Some games start with the first 
> city already present, in which case this whole bit is skipped, but in many 
> game types you only have units to start.  If the cplayer has non-settler 
> units to work with, it should initially walk them 1 turn in directions 
> designed to reveal the most map possible in the first turn, before going on 
> below.

The starting point is based on Earth circa 2000AD.  You begin the game
with a Level 0 civilization and must build up from there.

As far as building on new worlds, there is an interesting question
raised when domed settlements and space stations are introduced into the
picture.  Although a typical civilization can become the largest, domed
settlements can be placed on any kind of world, and space stations can
be placed in deep space.

For exploration purposes, all civilization/station units can build
probes, which can go anywhere without requiring supplies, but they move
slowly, don't see very far, and are easily destroyed by rivals (making
them useless for recon).  They are, however, ideal for initial
exploration, since they're easy to build and low-maintenance.

> 
>    The cplayer should look at all the squares visible, and assign them each 
> a base weight.  The enumeration and weighing routines will be used a lot at 
> different stages, and should be largely compatible between games; the 
> actual weights assigned should be an easily editable table (or a series of 
> them), as it will need tweaking, and probably vary from game to game (or 
> even within the game).  Note that this weight is *not* "what is this cell 
> worth to a city" but is "what is the worth of a city placed in that 
> cell".  (For speed, it may or may not be more effective to first build an 
> array with the worth of the cells to a city, depending on the computational 
> cost of calculating a cell's worth.)

In "Space Civilization", the question is extremely complicated due to
the number of materials that must be taken into account.  In games like
Civ, there is one material used for city maintenance and growth, one for
production, and one for economics (buying, selling, funding science). 
In "Space Civilization", there is food for civilizations, ores and
personnel for production (which cause a limiting-reagent issue that I've
never seen in other games), fuel to power short-range spacecraft, and
solar energy as an overhanging requirement for everything.  And beyond
that, there are resources that can only be produced by certain
facilities, such as matter/antimatter fuel for large starships, and
photon torpedoes for combat, and I haven't yet worked out any economics
beyond basic supply lines!

> 
>    For a fairly Civ-like game, the weight would be based primarily on the 
> total food and shields available, with bonuses for rivers, special 
> resources, and coastal position.  This should be calculated based on 
> initial value and predicted value; logical breakpoints to calculate for 
> would be size 1 (initial), size 8 (radius 1 fully used), and size 20 
> (radius 2 fully used), plus whatever breakpoint sizes are part of the game 
> (such as size 6 (aqueduct / river) and size 12 (hospital)), and perhaps 
> another early value (like size 3) if one is not otherwise present.  Values 
> for future sizes would be depreciated compared to initial ones; something 
> like value(size1) + 2/3 value(size3) + 1/2 value(size6) + 1/4 of each other 
> size value, perhaps.  The depreciation ratios should probably be in a table 
> for adjustment.  How much improvement is allowed for is a bit tricky; I'd 
> probably handwave something like assume no improvements for size 1, roads 
> by size 3, road and any single other improvement in a square by size 6, 
> fully improved by size 12.

Simple weighting may not be enough.  For example, an A-class planet
(e.g. Jupiter) produces lots of fuel, making it an excellent resource
for short-range spacecraft, but it's unsuitable for any sort of
civilization.  Of course, a civilization or station could use the
A-class planet for production if it's built on a nearby, more suitable
planet.  Perhaps the real question should be "What do I want my new unit
to do once I've built it?" and then the player can settle an appropriate
spot on the map.

Another thing to consider is that in Xconq, units don't grow outward as
one might expect; as they grow, they use all of the cells within their
reach, starting with the ones that produce the most food (or whatever it
needs to maintain and grow itself).  I wanted to set up my game so that
a civilization's reach was limited to 2 until it had a spaceport (and
possibly limited to 4 until it had a space elevator), with a theoretical
maximum reach of 8.  This, unfortunately, is not yet possible to do with
Xconq.

> 
>    This will give the cplayer a list of how cool a city would be if placed 
> in any of the squares it can see.  It then needs to calculate how many 
> turns it would take to get one of its settlers to each spot and start a 
> city.  The value of each square will then be depreciated based on the 
> number of turns "lost" in transit by a game-defined amount (in some 
> settings, typically on small maps and/or simple resource models, plunking 
> down a city immediately is a good idea; in others, typically large maps or 
> those with more complex resource models, taking a few turns to walk to a 
> prime spot for your capital is worth it).

Not only that, in space games, one must consider how the settlers get
where they need to go (since they can't walk from one planet to
another).  If the destination is close to the starting point, a simple
shuttle would suffice, but if it's on the other side of the map, a big
starship would be more appropriate.

> 
>    If the city has at least one square that exceeds a game-defined minimum 
> adjusted value, it picks the best one (ties broken by size-1 value, ties 
> there randomly broken) and gives the settler orders to go there and 
> settle.  If it does not have a suitable site, it should walk its settler 1 
> turn in the direction of the best available square (or the second-best 
> square if it's already on the best one).  Next turn, again move other units 
> to reveal more map, then repeat placement algorithm, but with a lowered 
> minimum standard (and continuing to lower on subsequent turns to insure 
> that it will eventually pick something).

That makes a lot of sense.  Of course, it would not be easy to set up
the AI to be so organized.  Also, as noted above, the production of a
size-1 unit is not necessarily that of the cell that it's built on.

> 
>    The system for placing later cities is generally similar, but I'll go 
> into some of the differing implications in another post.

Most of what you describe would probably work for any civilization or
station in "Space Civilization".  It seems to me that all you'd have to
worry  about is different goals for different units that have different
inherent characteristics.  For example, a settlement on a mineral-rich
world (e.g. Mars?) might be better for producing big starships, but a
civilization on a more populated world (e.g. Earth) might be better for
producing troops or settlers.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]