1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Emigration

Discussion in 'Civ5 - Mod Components' started by killmeplease, Oct 6, 2010.

  1. Horem

    Horem Emperor

    Joined:
    Apr 1, 2010
    Messages:
    1,720
    Location:
    Wales, UK
    Any chance you can surround what you change din the NotificationPanel.lua with soem comments please? So us clueless Lua people can see what need to be merged with other mods that use this file?
     
  2. BlackZiggerat

    BlackZiggerat Chieftain

    Joined:
    Jan 31, 2010
    Messages:
    90
    Location:
    indiana
    Great Job on the Mod.
    There could also be things built to counter this affect.
    The Soviet Union, China, and many other nations over time have worked militarily to keep their 'citizens' within their own borders.
    Culture could be gained and lost for a number of rounds, like a trade, to reflect the cultural impact of lost peoples or gained peoples.
    Also, if a small city should be reduced to 0 from emmigration, then 2 things could happen. The city gets the cue to Raze, or the computer converts the city to a ruins.
    Internal immigration isn't a bad idea, and should get easier with the advent of roads, highways, railroads, etc. But this would require adapting a new city field. Stability. Cities can be independently happy/unhappy from each other within the civ, and their independent ratings would affect overall civ happiness. Prolonged unhappiness would add up, as would prolonged happiness.
     
  3. BjoernLars

    BjoernLars Warlord

    Joined:
    Apr 8, 2005
    Messages:
    270
    Location:
    Anyang, Kyeonggi-do, South Korea
    Great Mod! I love it so far!
     
  4. Thalassicus

    Thalassicus Bytes and Nibblers

    Joined:
    Nov 9, 2005
    Messages:
    11,057
    Location:
    Texas
    I love your mod, and like I mentioned in the PM, things I enjoy I tend to fiddle around with (like Civ V itself). I hope it's alright if looking around in the mod a bit can be an opportunity for me to learn Lua... I haven't had any experience with this programming language and you organized your code in a manner that was easier to understand than some other mods. You have very good coding practices.

    I got that stuff I mentioned in the PM debugged, created some tools that might be helpful for this mod:

    • Queue class for tracking average happiness
    • Created an xml file containing two tables: constants and weights. The latter is just a branch-table of city functions executed in a loop to check status and multiply by the appropriate weights. There's also a weight for if the city has emigrated once already in the current turn. The other functions in the jump table are:
      • Razing
      • Resistance
      • Puppet
      • Occupied
      • Blockaded
      • Capital
      • GetGarrisonedUnit (for booleans nil evaluates to false, anything else is true).
    • Culture factored in, separately (since it's a divisor)... though it'd be easy enough to add a weight for that to the xml too.
    • Lots of debug output is dumped to FireTuner for these tools.

    I included a savegame where you can see the effect when I tied these components in: capital almost never depopulates, while the puppet states lose more. I hope this can help more than just the rambling feedback I tend give. :)

    Package.zip
     
  5. funkymunky

    funkymunky Warlord

    Joined:
    Dec 14, 2001
    Messages:
    112
    Location:
    Louisville, KY
    So do unhappy citizens emigrate to any civ or just to those that have open borders with the unhappy civ?
     
  6. MinoanGuy

    MinoanGuy Chieftain

    Joined:
    Sep 15, 2010
    Messages:
    22
    Great mod! I'll try it out. Thanks! :goodjob: The revolution idea would also be good if someone made it..
     
  7. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    8,308
    I love the idea!

    I was wondering for people have tried this, is this the best difficulty improving mod yet...as the AI is normally obssessed with happiness? Do you find at higher levels your people leave your empire in droves to the +50 happiness AI empires?
     
  8. skodkim

    skodkim Deity

    Joined:
    Jan 16, 2004
    Messages:
    2,373
    Location:
    Denmark
    So Killmeplease. Any news on v2?

    I'm actually waiting for it before I'll start a new Civ game

    \Skodkim
     
  9. BlackZiggerat

    BlackZiggerat Chieftain

    Joined:
    Jan 31, 2010
    Messages:
    90
    Location:
    indiana
    I'm in a similar place. Though I'm not not-playing, I'm eager to see the progress!
     
  10. Thalassicus

    Thalassicus Bytes and Nibblers

    Joined:
    Nov 9, 2005
    Messages:
    11,057
    Location:
    Texas
    In addition to the earlier stuff, with Afforess's help and his table serialization package I created a way to store average happiness in savegame files (previously was just in memory). Hopefully this might be useful for you, I attached the code. :)
     

    Attached Files:

  11. Fariic

    Fariic Chieftain

    Joined:
    Apr 13, 2010
    Messages:
    93
    I don't know if it's this mod or a compatability issue with another mod, but abug occured while I was using this.

    After a while I noticed that all the other notification pop ups stopes working. I would have to go into the notification log to see what happened. You pop ups continued to work fine, with the exception of the bug that says people migrated from my city to my city.

    Your mod was the only only I was running that used the notification pop ups.
     
  12. bryanw1995

    bryanw1995 Emperor

    Joined:
    Oct 10, 2006
    Messages:
    1,459
    Location:
    San Antonio, TX
    nice mod, will generally give AI advantage b/c they're typically so freakin' happy. AI needs all the help they can get, so this is a good think. :thumbsup:
     
  13. primem0ver

    primem0ver Emperor

    Joined:
    Jun 16, 2006
    Messages:
    1,140
    Gender:
    Male
    Location:
    Peoria, AZ
    I think this mod is a great idea... makes me wish I had thought of it especially because I have implemented something similar, yet not as robust in a mod I helped make for Civ IV (using a migrant unit) :).

    However, IMHO there is a reality issue (tech based). In early days of civilization emigration was rare since feasibility was an issue. Sure... it happened from time to time. Sometimes we had parts of or even entire nations move (Israel and Native Americans come to mind). In such cases these nations often emigrated and formed their own empire (something else that could be implemented? The Revolutions mod for Civ IV comes to mind). Even so, these incidents were an enormous undertaking by the societies who did such things. I think the rate should change with the development with certain technologies. Emigration should be very rare early in the game and only occur when another empire is close by. Emigration should then become more likely as certain technologies are discovered (such as ocean faring and combustion engine or the CiV equivalents). Just a thought.
     
  14. Stalker0

    Stalker0 Baller Magnus

    Joined:
    Dec 31, 2005
    Messages:
    8,308
    Keep in mind that while emigration occurs often in turns...each of those turns is 100's of years in the early game.

    Considering an arrow can fly the amount of land it takes a warrior to move in 100 years worth of a turn...I can let this one slide:)
     
  15. Lilltiger

    Lilltiger Chieftain

    Joined:
    Oct 16, 2010
    Messages:
    29
    Sounds like a great mod, going to try it out. Also I have some ideas.

    If a civ has atleast 2 trad policys, then cities with baracks and a military unit present should be quite a bit more tolerant before people migrating, to illustrate how the noble pressures the people even when they are unhappy. But as an consequence these cities should recive less imigrants as well when happy.

    If a nation drops down to angry population, then puppet-states and annexed cities will revolt and rejoin the civ they where taken from (if it still excists, else it will join some other nation) if there is no baracks+millitary units present. This will make warfare alot more intresting and realistic.

    Also the speed of constructing courthouses should be affected by the happyness in the empire, maybe +1% building speed for each happyness, simulating that empires where the people are happy have alot easier time to convert the people. (althought might not be that relevant to emigration)
     
  16. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    wanted to release Emigration v2 on saturday but there is a strange bug appeared (incorrect syntax near symbol '□'). so i am debugging it now. v2 will come in a few days.

    A part of Thalassicus' code adopted so I added him to the authors.

    Thalassicus, i've not included some stuff like modifiers for garrisoned units, occupied and puppeted cities, as i think there have to be more complex mechanics to introduce these. e.g. garrisoned unit lowering emigration has not much scence if player runs freedom policy (or liberty).
     
  17. Putmalk

    Putmalk Deity

    Joined:
    Sep 26, 2010
    Messages:
    2,623
    Location:
    New York
    Looks fantastic, and I may try this out. Minor point-out though, on your image, why don't you change the text to something more...uh...professional looking? If that makes sense...er...for a suggestion: "An Unhappy citizen in [your city] city migrated to the [target civilization adjective] city of [target city], seeking a better life!"

    Just a suggestion. But this has definitely piqued my interest.
     
  18. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    Thanks.
    Currently in v2 messages look like this:
    PS: any message text tweaks are greatly appreciated since English is not my native language ;)
     
  19. Supercheese

    Supercheese Zeppelin Commander

    Joined:
    Aug 2, 2009
    Messages:
    378
    Location:
    Idaho
    The messages should be more like this:

    English seems to love leading articles (a, an, the, etc.), and I've noticed that other languages don't seem to share that love. I thought the Beatles fixed that a while back! ;)


    "All you need is grammar... I mean, love!"
     
  20. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,794
    Location:
    Samara
    ok i'll correct messages.
    there are no leading articles in Russian at all :rolleyes: also there are no "is", "am", "are" (e.g. "he is a doctor" = "he doctor"). so its quite hard to determine when to use an article and what an article to use as i'm completely unaccustomed with it.
     

Share This Page