Emigration

A simple and excellent idea. Kudos for using the proper term (emigration) too :)
I wonder if emigrants could be given a sense of location so they'd emigrate to the happier city closest to them (eg, if the city is just next to the otomans it'll emigrate to them, but if it is across the country near the egyptians it'd emigrate to them instead)
 
Here's some further thoughts I had while playing with this... I was pondering ways to smooth out spikes in happiness level or number of emigrants, and weigh several factors that would increase the likelihood of emigration.

If the emigrants are prioritized to come from recently conquered cities of high population and few/no happiness buildings, I think both realism might be improved and the possibly destabilizing effect wouldn't be entirely up to chance. For example, with complete randomness you can get that rare 2% chance of depopulating a core city for wonder or military production ten turns in a row. By allowing for some decision-making capability (through garrisoning units, building happiness buildings, higher culture in the city, etc), it gives the player more control over the progress of the game.

It has some precedent, as CiV has transitioned to this deterministic approach in several aspects of the game, like no longer having a 2% chance to lose Great Generals in each battle, or a 2% chance to get that Great Prophet in the modern era when you really needed a Great Engineer.

While I was thinking about this, some pseudocode came to mind:

Spoiler :
PHP:
for each (player in game.alivePlayers)
	happinessQueue[player].pushFront(player.happiness);
	if (size(happinessQueue[player]) >= 10 * multiplierGameSpeed) then
		happinessQueue[player].popBack();
	happinessAverage = sum(happinessQueue[player]) / size(happinessQueue[player]);

	if (player.happiness < 0) and (happinessAverage < 0)
		numEmigrants = (-happinessAverage / 10) + 1;
		while (numEmigrants)
			numEmigrants -= 1;
			currentCityIndex = random (1, player.numCities);
			count = player.numCities;
			while (count)
				count -= 1;
				pickedCity = player.cityByIndex(currentCityIndex);
				pickedCityIndex = (currentCityIndex + 1) mod player.numCities;
				if (pickedCity.population > 1) and (
                        1 / random(1, player.numCities)
						<=
						( pickedCity.population
						/ (pickedCity.HappinessInCity + 1)
						* cityConquered(pickedCity)
						* cityGarrisoned(pickedCity)
						) ) then
					emigrateFromCity(pickedCity);
					break;

cityConquered (city)
	if city.isRevolting return multiplierRevolting;
	if city.isPuppetState return multiplierPuppetState;
	if city.isOccupied return multiplierOccupied;
	return 1;

cityGarrisoned (city)
	if city.isGarrisoned return multiplierGarrisoned;
	return 1;
 
Just a thought when cities are razed would this work so people would flee the city to other civs?
 
Just a thought when cities are razed would this work so people would flee the city to other civs?
Maybe not all then. I always assumed razing a city was equal to killing every last inhabitant.
 
Great mod! Using it in my current game and have lost quite a few emigrants to AI civs when I got into unhappiness ... makes keeping my citizens happy a priority, just as it should be!
IMHO, keep it just as it is, except for the bug where immigrants are said to be arriving from my own civ - but someone else already reported that.
 
This is nice...good job. I also like the idea of a revolution starting when there is only 1 citizen left. This would give it a nice extra touch.
 
Here's some further thoughts I had while playing with this... basically, to smooth out spikes in happiness level or number of emigrants, and weigh several factors that would increase the likelihood of emigration.

If the emigrants are prioritized to come from recently conquered cities of high population and few/no happiness buildings, I think both realism would be improved and the potentially destabilizing effect on the game wouldn't be entirely up to chance. For example, with it totally random you could get that rare 1% chance of it hitting a core city for wonder or military production ten turns in a row and wrecking your game. By allowing for some decision-making capability, through garrisoning units or building happiness buildings, it gives the player more control over the progress of the game.

It also has precedent, as CiV has transitioned to this deterministic approach in several aspects of the game, such as no longer having a 2% chance to lose Great Generals in each battle, or a 2% chance to get that pointless Great Prophet in the modern era when you really needed a Great Engineer.

Agree in general as well without getting into specifically how it would work. But there are probably a few factors that should drive where and how often the emigrants leave and where the go to. Conquered cities would be rife with emigration, and probably civs that have a lot of policies on the Freedom tree for instance might get more of them (at least in higher proportion than just happiness).

Mod is a great start though, and I'm sure it will continue to evolve either as part of this mod or as these type of ideas are incorporated into larger modpacks. It is a fundamental gameplay element that is here to stay I think.
 
Could you add the name of the city into the mouseover tooltip when Emigration takes place? That would be cool.
 
Along the same lines as immigration benefits from Wonders and Policies, there could also be Unique Abilities which act as an influence. For example, America could have "Manifest Destiny" replaced with "Melting Pot" considering how immigrants are explicitly mentioned in their Dawn of Man intro.
 
Do citizens emigrate to countries you are at war with? If they do I would strongly suggest that you add a very strong malus for emmigration to such places because realistically, who's going to move to a place that's trying to kill you?

Also is it possible to keep some sort of tally of where the citizens came from so you can get some sort of indication how cosmopolitian your empire is? You could also use this information to favor the citizens returning to their home country if it becomes happy again over other countries if the one they are living i now becomes unhappy.
 
Just wanted to say that I've recommended people use this with my mod (as it is compatible ;)).

If in v2 you make it modular (using new lua files, rather than overwriting, and therefore need to modify InGame.xml) let me know, I'll add the necessary line to my own mod to ensure they are compatible. ;)

I've also pointed this mod out in a discussion in the tester forums. ;)
 
suggestion, how about adding internal migration? a city with poor production per pop point (and thus sort of poorer pay for workers), would tend to have people migrate to the city where they can make more.

down/upside is city food surplus would no longer be dominant factor in having a large population.
 
suggestion, how about adding internal migration? a city with poor production per pop point (and thus sort of poorer pay for workers), would tend to have people migrate to the city where they can make more.

down/upside is city food surplus would no longer be dominant factor in having a large population.

Wouldn't really work since happyness is empirewide now.
 
Wouldn't really work since happyness is empirewide now.

That is exactly what he mentioned, instead of using happyness it'd use labor or some other variable. Internal (e)migration would be interesting too.
 
it was reported here that cities can drop to size 0 but then grow to 1 and so forth.

I've had a city that drops to -3 population and then regrows, so I can confirm this. Beyond a simple bugfix, this is one reason I think a weighted approach might be valuable, so it's unlikely to hit the same city many times in a row (population will drop and reduce chance of emigration from that city).
 
Back
Top Bottom