Migration and Magnates
- How they work
by QSI Programming
Migration, sometimes called "auto-colonization"
is a feature where members of your empire will move around
by themselves. It is at its most obvious when combined with
a multi-race empire, especially when Magnate Civs are involved.
This post is an attempt to explain how both Magnate Civs and
Magnate Civ is a special that appears on a planet. The "effect"
of the special is that it has a population of one of the unplayable
races on it. The special is assigned to a planet through the
normal special lottery and the species on the planet is determined
by determining which race is the best fit for the planet.
Originally, Magnate Civ and Splinter Colony were two separate
specials. Splinter Colonies would then appear on yellow and
even red planets, even when the empire did not have reasonable
tech for that. So, we merged the two specials and it is a
Splinter Colony if the planet is green for the discovering
player's race and a Magnate otherwise. This is why certain
Magnates are difficult to find when playing certain races
(essentilly the Magnates will ALWAYS have a different planet
preference than you, if you discover the planet first). If
it is a Magnate Civ, the population is doubled. All the population
is placed in a random region on the planet and no migration
processing is done until a player colonizes it, to make sure
there is an open region to colonize. This is also part of
why the Magnates migrate so quickly (they are often over-crowded
in the one region).
The Magnate Civ line in the specials.txt sheet (which is outside
the table) is no longer functional, and in fact will just
generate a planet that SAYS it is a Magnate Civ with no population
on it. The odds of a Magnate Civ can be modded by upping the
lottery balls on the Splinter Colony spreadsheet.
Migration comes in two pieces. The spreadsheet data used
by migration is in the file population.txt. In that file,
the table PopulationPushFactor is not used for anything (although
it is read in by the code).
The first and simplest piece is growth migration, which moves
population from one region to another on the same planet.
This considers only the population added through normal population
growth. Tables StayPercentage, PopulationGrowthPlanet and
PopGrowth are used for growth migration, along with the density
values in PopMisc.
The main migration processing is the "push/pull"
migration, which is a vastly simplified version of the original
migration design. For each empire in the game, each populated
region (including outposts) is processed system by system.
For each each region, the push factors are calculated and
if the number exceeds a D100 roll, people will be moved.
The push factors are defined in the PushFactor table. The
first two are for overpopulation, and an overcrowded planet
will take both penalties. The unrest value is used for regions
in unrest1, doubled for unrest2 and tripled for unrest3. The
revolt value is used for regions in revolt, so using the current
values, revolt is less of a push than unrest3. The final push
is for the existence of migration targets, so that people
will come when you give them a place to go (although they
may choose to go elsewhere).
EDIT: Planets which are a migration target and regions which
have more jobs than people will ignore the presence of other
migration targets when calculating push factors if all other
push factors are zero.
The number of people is determined using the PopulationMoving
table, which specifies a percentage of the population based
on the amount of population in the region. If this results
in more than one population point, the group is divided into
groups of one population point.
Candidate systems are determined by spreading out from the
source system and continuing until stopped by a system which
is either blockaded or contians a colony or outpost of another
empire without also containing a colony or outpost of the
source empire. All planets in these systems which are not
owned by another empire are candidates for migration.
Pull factors for each planet are calculated using the PushPullPlanet
table. Distance to system is a negative number to make farther
away planets less attractive. Distance is calculated in jumps
only. A larger negative number would make farther planets
even less attractive. The habitibility and gravity values
are straightforward. The potential maximum population uses
the capacity of the planet for the race moving without regard
to any existing population. The Existing pop values are multiplied
by the number of regions currently populated by the same species
or race (same race will get both values). There is no value
assigned to an unpopulated planet (there is a space in the
table, but any value there is ignored). If the planet has
a set migration flag, they get the larger bonus.
Planets whose pull factors are less than 20% of the highest
value are discarded and the planet is chosen from the remainder,
weighted by their pull factors. Then a region is selected
using the region pull factors from the PushPullRegion table.
Some of the vlaues in this table are planet-wide values, but
are not used to pick the planet. The -999 for different race,
starving, unrest and revolt are designed to prevent immigration.
(Yes, if you change starvation to a positive number, migrants
will prefer starving regions). The unemployment value is not
used or checked. The same is true for the tax rate values.
The Underemployment value is a multiplier for the number of
available jobs in excess of population (rather than unemployment
rate). The population numbers are as advertised (and once
again overcrowded gets both penalties). Values for piracy
and pollution are available in the spreadsheet, but both are
set to 0 in the original values.
If no region has a positive pull factor, the migration is
cancelled. If the region has already reached its immigration
cap as defined in the immigration cap entries in the PopMisc
table, that group does not move.
PopMisc has several values that are not used. The used values
are the two values for PopDensity, which define the percentages
used to consider a planet full (natural limit) and crowded.
These values are used for both types of migration. The immigration
cap values are used to limit the immigration to .05 population
points (50) or 5X the natural growth (whichever is larger),
using the original numbers.
EDIT: I meant to mention that these rules apply to ALL races
at present, except the New Orions. It is possible that at
some time in the future, the Harvesters will also have some
modifications in the area of preferences for planets with
The original design included many more push and pull factors,
generating three different types of emigrants, those that
prefered to stay on established planets, those that preferred
unpopulated planets and systems, and those that wanted to
leave the empire to join another empire (yes, the original
design allowed migration to go across empire boundaries).
There were multiple persecution policies (racial, religious
and several levels of slavery) which were major factors in
this calculation, along with many other policies, many of
which could be set on a planet by planet basis.