There's nowhere in-game where migration targeting is explained, but it is in the files - so here we go:
First, country migration choices. Bear in mind that this table is only used when a POP emigrates - not when it moves to the colonies or within it's home nation.
Code:
country_migration_target =
{
factor = 1
modifier = {
factor = 0.1
unemployment = 0.1
}
This means a country has it's chance of being picked reduced by 90% if there's more than 10% unemployment in the country.
Code:
modifier = {
factor = 2.0
has_pop_culture = THIS
}
This means that POPs tend to prefer countries which have their own culture; I suspect it's mostly a sop to performance (lots of pops simply joining an exist pop of their culture have no performance impact)
Code:
modifier = {
factor = 1.05
vote_franschise = wealth_voting
}
modifier = {
factor = 1.25
vote_franschise = universal_weighted_voting
}
modifier = {
factor = 1.5
vote_franschise = universal_voting
}
These mean that the more democratic a country is, the more like POPs are to like it - from 5% more likely with wealth voting to 50% more likely with universal suffrage.
Code:
modifier = {
factor = 4.0
OR = {
continent = north_america
continent = south_america
continent = oceania
}
}
}
And these ones finally mean that independent Australia, New Zealand and American nations are massively more likely to get immigrants than Old World nations.
So, as an example, we have a POP who's decided he's leaving Newcastle. He checks every country in the world. For the sake of simplicity, we'll say that the USA has conquered North America, Ecuador has conquered South America, Britain never released Oz or NZ, and Russia has conquered every other nation left on earth.
The POP first checks for unemployment. We'll say none of them are over 10%, so it ignores this part of the table. The only country which has British culture is Britain, but these POPs are leaving Britain so it's not a valid target. The USA has universal suffrage, and so it's 'score' goes up to 1.5, while Ecuador and Russia are both dictatorships. And finally, bother Ecuador and the USA are in the Americas, so they have their scores increased 400%.
So, the USA has 1*1.5*4 = 6 weight, Ecuador has 1*4 = 4 weight, and Russia has 1 weight. The game effectively rolls an 11 sided dice, and if it gets 1-6 the POP goes to the USA, if it gets 7-10 the POP goes to Ecuador, and if it gets 11 the POP goes to Russia.
Now, the province table. POPs who know which country they're headed to (be that the country they're already in, or a new nation) roll on this to determine where they want to go.
Code:
migration_target =
{
factor = 0.01
modifier = {
factor = 0.1
unemployment = 0.1
state_scope = {
has_factories = no
}
}
This makes POPs avoid areas with no factories and high unemployment.
Code:
modifier = {
factor = 1.2
total_pops = 150000
}
modifier = {
factor = 1.2
total_pops = 250000
}
modifier = {
factor = 1.2
total_pops = 500000
}
modifier = {
factor = 1.2
total_pops = 750000
}
These modifiers attract POPs to big concentrations of population - so people will move from the countryside toward the city.
Code:
modifier = {
factor = 0
AND = {
state_scope = {
has_factories = no
}
can_build_factory = no
}
OR = {
unemployment_by_type = { type = farmers value = 0.1 }
unemployment_by_type = { type = labourers value = 0.1 }
}
}
This prevents POPs from going to places with unemployment where factories can never be built.
Code:
modifier = {
factor = 1.2
has_pop_culture = THIS
}
Those POPs sure do love going to their own culture.
Code:
modifier = {
factor = 0.25
has_culture_core = no
}
This makes POPs prefer to move within the area of their home nation to areas outside of it - so if France has seized the Left Bank of the Rhine, Frenchmen would still rather remain in France than go into the captured German territory.
Code:
modifier = {
factor = 2
state_scope = {
has_factories = yes
}
}
Attracts POPs to factories.
Code:
modifier = {
factor = 1.2
has_pop_religion = THIS
}
Attracts POPs to places where their own religion is already present.
Code:
modifier = {
factor = 1.5
any_core = { primary_culture = THIS }
}
Attracts POPs even more to their own cultural cores.
Code:
modifier = {
factor = 0.75
state_scope = {
is_slave = yes
}
}
Makes POPs less likely to pick slave states when there's non-slave ones available - so more POPs moving to America head North rather than South.
Code:
modifier = {
factor = 2
is_state_capital = yes
}
POPs prefer the state capital to the surrounding provinces, clustering them even more into cities.
Code:
modifier = {
factor = 1.5
is_capital = yes
}
Country capitals get an even bigger bonus, since everyone likes to live in the political hub of the nation.
Code:
modifier = {
factor = 1.05
is_coastal = yes
}
POPs slightly prefer to live at the seaside.
Code:
modifier = {
factor = 0.6
terrain = mountain
}
modifier = {
factor = 0.1
terrain = desert
}
modifier = {
factor = 0.6
terrain = marsh
}
modifier = {
factor = 0.1
terrain = arctic
}
POPs are less interested in these terrain types.
Code:
modifier = {
factor = 2
life_rating = 40
}
modifier = {
factor = 2
life_rating = 50
}
}
POPs prefer to live in places with nice life ratings, like the big cities and California.
Remember that POPs decide on the country they're going to BEFORE they look at terrain, or factories, or anything else, in a two-stage process (outlined on the wiki, by myself, here:
http://www.paradoxian.org/vicky2wiki/Population).