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

Loyalty++ 5.3.3

adds several changes to loyalty:

  1. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,784
    Location:
    Where animals hop not run
    I guess the AI would still react to remove barbarians and maybe the revolt city will naturally flip back to original AI or the AI might decide to go to war and recapture it without understanding the reasons why it happened?
     
  2. Gueux

    Gueux Chieftain

    Joined:
    Mar 30, 2018
    Messages:
    178
    Gender:
    Male
    Location:
    France
    yes the AI automatically attack barbarian/ free cities, but I saw some AI that had no army and couldn't have the idea to create one to defend from revolt and I saw some other never repairing the revolt damages
     
  3. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,784
    Location:
    Where animals hop not run
    This mod will slow down the expansionist war AI's even more which doesn't matter because they wouldn't win anyway because they are bad at domination strategy? This mod might bias towards AI that pursue culture and science. I see the domination war AIs as being antagonists to everyone else and that is about it.
     
  4. Gueux

    Gueux Chieftain

    Joined:
    Mar 30, 2018
    Messages:
    178
    Gender:
    Male
    Location:
    France
    I don't like the fact that you can "Win", I consider I have won when I'm too far ahead of the AIs and this mod surely kill some victory (not sure domination, religious, cultural, diplomatic if player killed at start do not spawn)...anyway I rarely get past industrial era, so it doesn't bother me, if you want to play the victory you should not kill player at start or not too many but I really can not add neurons to the AIs :/
     
    glider1 likes this.
  5. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,784
    Location:
    Where animals hop not run
    I've been doing some firetuner autoplay runs on the test build previous page on standard maps. I lowered the loyalty scalar and am getting good enough results. More interesting things happen and the AI still can handle it. New world colonies can be created and held and there is a reasonable number of revolt type issues as well as minor civs emerging. The mod is stable in autoplay strategic view.

    Here are my changes to loyaltymod.sql:
    update GlobalParameters set Value = "1000" where Name="LOYALTY_START";
    update GlobalParameters set Value = "1000" where Name="LOYALTY_MAXIMUM";

    update GlobalParameters set Value = "200" where Name="LOYALTY_AFTER_TRANSFERRED_BY_COMBAT";
    update GlobalParameters set Value = "300" where Name="LOYALTY_AFTER_TRANSFERRED_BY_COMBAT_ORIGINAL_OWNER";
    update GlobalParameters set Value = "200" where Name="LOYALTY_AFTER_TRANSFERRED_BY_COMBAT_OWNER_BEFORE_OCCUPATION";
    update GlobalParameters set Value = "300" where Name="LOYALTY_AFTER_TRANSFERRED_BY_CULTURAL_IDENTITY";

    UPDATE LoyaltyLevels SET LoyaltyMax = '250', LoyaltyMin = '0' WHERE LoyaltyLevelType = 'LOYALTY_LEVEL_0';
    UPDATE LoyaltyLevels SET LoyaltyMax = '500', LoyaltyMin = '251' WHERE LoyaltyLevelType = 'LOYALTY_LEVEL_1';
    UPDATE LoyaltyLevels SET LoyaltyMax = '750', LoyaltyMin = '501' WHERE LoyaltyLevelType = 'LOYALTY_LEVEL_2';
    UPDATE LoyaltyLevels SET LoyaltyMax = '1000', LoyaltyMin = '751' WHERE LoyaltyLevelType = 'LOYALTY_LEVEL_3';

    Here is a list of the lua errors in my last run up to turn 500 that were non fatal and did not stop the game from progressing:
    Line 23324: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1751: in function 'RevoltType'
    Line 23324: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1751: in function 'RevoltType'
    Line 38345: Runtime Error: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1346: attempt to index a nil value
    Line 38345: Runtime Error: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1346: attempt to index a nil value
    Line 38347: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1346: in function 'OnCombat'
    Line 38347: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1346: in function 'OnCombat'
    Runtime Error: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1346: attempt to index a nil value
    Runtime Error: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1346: attempt to index a nil value
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1346: in function 'OnCombat'
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1346: in function 'OnCombat'

    I haven't yet hand played the mod and will probably give that a go next. It would be handy if the log gave more information about what loyalty events are happening so that I do autoplay runs unattended and read the log afterwards when finished.

    Thanks for making this mod available to the civfanatics.
     
    Gueux likes this.
  6. Gueux

    Gueux Chieftain

    Joined:
    Mar 30, 2018
    Messages:
    178
    Gender:
    Male
    Location:
    France
    Thx for reporting errors, I tried to fix them.
    I have added some debug too, search (ctrl+f) in lua log :
    "started a" to find every revolt start
    "riot siege won" every siege won
    "riot siege lost" every siege lost
    "free city change owner at" every free city change owner (either old owner or colony)

    I didn't change the loyalty scale so just copy past yours, I don't know if I am going to do it cause I have made some game on big map and there was enough revolt and 1000 loyalty mean less time to react

    it really help thx
     

    Attached Files:

    glider1 likes this.
  7. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,784
    Location:
    Where animals hop not run
    Did an autoplay run on loyalty=1000 standard continents

    Non Fatal Error list:
    Runtime Error: C:\Steam\steamapps\common\Sid Meier's Civilization VI\DLC\Expansion2\UI\Replacements\CitySupport.lua:496: attempt to index a nil value
    stack traceback:
    C:\Steam\steamapps\common\Sid Meier's Civilization VI\DLC\Expansion2\UI\Replacements\CitySupport.lua:496: in function 'GetCityData'
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:2835: in function 'SetMigrationPerTurn'

    Runtime Error: bad argument #2 to 'math.random' (interval is empty)
    stack traceback:
    [C]: in function 'math.random'
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1753: in function 'RevoltType'

    LoyaltyMod: 1 table: 000000016481E880
    LoyaltyMod: -1 nil
    Runtime Error: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1347: attempt to index a nil value
    stack traceback:
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1347: in function 'OnCombat'
    [C]: in function 'func'
    [C]: in function '(anonymous)'

    365 Turn logged events:
    LoyaltyMod: 19.16 LOC_CITY_NAME_LIVERPOOL started a[ICON_Government][ICON_Pillaged]Government revolt
    LoyaltyMod: 22.17 LOC_CITY_NAME_MANCHESTER started a[ICON_Government][ICON_Pillaged]Government revolt
    LoyaltyMod: 25.15 LOC_CITY_NAME_SHEFFIELD started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: LOC_CITY_NAME_SHEFFIELD riot siege lost
    LoyaltyMod: 54.31 LOC_CITY_NAME_VIGO started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: LOC_CITY_NAME_LIVERPOOL riot siege won
    LoyaltyMod: 11.14 LOC_CITY_NAME_NEWCASTLE_UPON_TYNE started a[ICON_Government][ICON_Pillaged]Government revolt
    LoyaltyMod: 12.18 LOC_CITY_NAME_LONDON started a[ICON_Government][ICON_Pillaged]Government revolt
    LoyaltyMod: 14.15 LOC_CITY_NAME_LEEDS started a[ICON_Government][ICON_Pillaged]Government revolt
    LoyaltyMod: LOC_CITY_NAME_MANCHESTER riot siege won
    LoyaltyMod: LOC_CITY_NAME_VIGO riot siege won
    LoyaltyMod: 63.24 LOC_CITY_NAME_MURCIA started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: LOC_CITY_NAME_LEEDS riot siege won
    LoyaltyMod: 19.16 LOC_CITY_NAME_LIVERPOOL started a[ICON_Citizen][ICON_Pillaged]Populace revolt
    LoyaltyMod: LOC_CITY_NAME_LONDON riot siege lost
    LoyaltyMod: 22.17 LOC_CITY_NAME_MANCHESTER started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: 25.15 LOC_CITY_NAME_SHEFFIELD started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: 54.31 LOC_CITY_NAME_VIGO started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: LOC_CITY_NAME_VIGO riot siege lost
    LoyaltyMod: 30.29 LOC_CITY_NAME_PHARSALOS started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: LOC_CITY_NAME_PHARSALOS riot siege lost
    LoyaltyMod: 10.27 LOC_CITY_NAME_VALLETTA started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: LOC_CITY_NAME_VALLETTA riot siege lost
    LoyaltyMod: 30.29 LOC_CITY_NAME_PHARSALOS started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: LOC_CITY_NAME_PHARSALOS riot siege lost
    LoyaltyMod: 30.29 LOC_CITY_NAME_PHARSALOS started a[ICON_Government][ICON_Pillaged]Government revolt
    LoyaltyMod: LOC_CITY_NAME_PHARSALOS riot siege lost
    LoyaltyMod: 38.36 LOC_CITY_NAME_OPANGO started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: 38.36 LOC_CITY_NAME_OPANGO started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: LOC_CITY_NAME_OPANGO riot siege lost
    LoyaltyMod: 19.16 LOC_CITY_NAME_LIVERPOOL started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: LOC_CITY_NAME_LIVERPOOL riot siege lost
    LoyaltyMod: 25.15 LOC_CITY_NAME_SHEFFIELD started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: LOC_CITY_NAME_SHEFFIELD riot siege lost

    Is loyalty pressure different to loyalty? What I mean is if you scale all the loyalty variables by 10 but does that mean that England's loyalty pressure from great works is 10 times less effective?

    Could you put the turn number in the print log for each loyalty event?

    Does the print log also capture war weariness and religion revolts? Didn't see any of those.
     
    Gueux likes this.
  8. Gueux

    Gueux Chieftain

    Joined:
    Mar 30, 2018
    Messages:
    178
    Gender:
    Male
    Location:
    France
    weird you couldn't see any religious / war weariness revolt, couldn't find anything

    couldn't find why GetCityData from citysupport failed, did it happen only once?

    I think I "fixed" the math random error I say "fixed" cause I just don't spawn the naval unit if it doesn't exist but it should exist

    Runtime Error: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1347: attempt to index a nil value
    stack traceback: I have added a little debug before this error happen can you send me what there is in the lua log just before



    I added turn number for every event, you could search event with "Turn :"

    thx you for helping
     

    Attached Files:

    glider1 likes this.
  9. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,784
    Location:
    Where animals hop not run
    Another run on loyalty=1000 standard continents:

    Only one type of non fatal error happened:
    LoyaltyMod: Turn :181 68.16 LOC_CITY_NAME_BANJARMASIN started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    Runtime Error: bad argument #2 to 'math.random' (interval is empty)
    stack traceback:
    [C]: in function 'math.random'
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1754: in function 'RevoltType'

    Plenty of different types of revolts at all game stages:
    LoyaltyMod: Turn :111 17.17 LOC_CITY_NAME_UPPSALA started a[ICON_Government][ICON_Pillaged]Government revolt
    LoyaltyMod: Turn :116 LOC_CITY_NAME_UPPSALA riot siege lost
    LoyaltyMod: Turn :181 68.16 LOC_CITY_NAME_BANJARMASIN started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :185 73.18 LOC_CITY_NAME_ARKHANGELSK started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :214 27.20 LOC_CITY_NAME_JONKOPING started a[ICON_Faith][ICON_Pillaged]Religious revolt
    LoyaltyMod: Turn :221 75.25 LOC_CITY_NAME_UMGUNGUNDLOVU started a[ICON_Faith][ICON_Pillaged]Religious revolt
    LoyaltyMod: Turn :234 LOC_CITY_NAME_UMGUNGUNDLOVU riot siege lost
    LoyaltyMod: Turn :251 51.27 LOC_CITY_NAME_MAJAPAHIT started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :253 LOC_CITY_NAME_MAJAPAHIT riot siege lost
    LoyaltyMod: Turn :269 6.29 LOC_CITY_NAME_NDONDAKUSUKA started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :269 75.25 LOC_CITY_NAME_UMGUNGUNDLOVU started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :271 LOC_CITY_NAME_NDONDAKUSUKA riot siege lost
    LoyaltyMod: Turn :273 6.39 LOC_CITY_NAME_NODWENGU started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :273 5.43 LOC_CITY_NAME_KASPI started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :274 3.37 LOC_CITY_NAME_BABANANGO started a[ICON_Faith][ICON_Pillaged]Religious revolt
    LoyaltyMod: Turn :274 LOC_CITY_NAME_NODWENGU riot siege lost
    LoyaltyMod: Turn :275 7.25 LOC_CITY_NAME_CARDIFF started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :276 70.40 LOC_CITY_NAME_LEEDS started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :276 72.43 LOC_CITY_NAME_PORTSMOUTH started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :277 LOC_CITY_NAME_BABANANGO riot siege lost
    LoyaltyMod: Turn :277 LOC_CITY_NAME_KASPI riot siege lost
    LoyaltyMod: Turn :278 LOC_CITY_NAME_UMGUNGUNDLOVU riot siege lost
    LoyaltyMod: Turn :278 LOC_CITY_NAME_CARDIFF riot siege lost
    LoyaltyMod: Turn :282 51.27 LOC_CITY_NAME_MAJAPAHIT started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :282 69.36 LOC_CITY_NAME_LIVERPOOL started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :282 LOC_CITY_NAME_PORTSMOUTH riot siege lost
    LoyaltyMod: Turn :283 69.27 LOC_CITY_NAME_NEWCASTLE_UPON_TYNE started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :283 72.32 LOC_CITY_NAME_PLYMOUTH started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :283 72.37 LOC_CITY_NAME_SHEFFIELD started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :285 25.26 LOC_CITY_NAME_MBANZA_NSUNDI started a[ICON_Faith][ICON_Pillaged]Religious revolt
    LoyaltyMod: Turn :287 LOC_CITY_NAME_MAJAPAHIT riot siege lost
    LoyaltyMod: Turn :288 LOC_CITY_NAME_MBANZA_NSUNDI riot siege lost
    LoyaltyMod: Turn :291 LOC_CITY_NAME_LIVERPOOL riot siege lost
    LoyaltyMod: Turn :293 LOC_CITY_NAME_SHEFFIELD riot siege lost
    LoyaltyMod: Turn :294 LOC_CITY_NAME_PLYMOUTH riot siege lost
    LoyaltyMod: Turn :297 LOC_CITY_NAME_NEWCASTLE_UPON_TYNE riot siege lost
    LoyaltyMod: Turn :298 19.13 LOC_CITY_NAME_MOSCOW started a[ICON_Government][ICON_Pillaged]Government revolt
    LoyaltyMod: Turn :299 72.22 LOC_CITY_NAME_SOLIKAMSK started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :300 6.29 LOC_CITY_NAME_NDONDAKUSUKA started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :300 LOC_CITY_NAME_MOSCOW riot siege lost
    LoyaltyMod: Turn :302 LOC_CITY_NAME_SOLIKAMSK riot siege lost
    LoyaltyMod: Turn :304 6.39 LOC_CITY_NAME_NODWENGU started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :304 5.43 LOC_CITY_NAME_KASPI started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :305 3.37 LOC_CITY_NAME_BABANANGO started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :305 LOC_CITY_NAME_NDONDAKUSUKA riot siege lost
    LoyaltyMod: Turn :306 75.25 LOC_CITY_NAME_UMGUNGUNDLOVU started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :306 75.34 LOC_CITY_NAME_HLOBANE started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :306 75.41 LOC_CITY_NAME_NOBAMBA started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :306 LOC_CITY_NAME_NODWENGU riot siege lost
    LoyaltyMod: Turn :307 LOC_CITY_NAME_BABANANGO riot siege lost
    LoyaltyMod: Turn :307 72.43 LOC_CITY_NAME_PORTSMOUTH started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :308 LOC_CITY_NAME_UMGUNGUNDLOVU riot siege lost
    LoyaltyMod: Turn :308 LOC_CITY_NAME_HLOBANE riot siege lost
    LoyaltyMod: Turn :308 LOC_CITY_NAME_KASPI riot siege lost
    LoyaltyMod: Turn :308 72.37 LOC_CITY_NAME_SHEFFIELD started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :309 69.27 LOC_CITY_NAME_NEWCASTLE_UPON_TYNE started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :309 72.32 LOC_CITY_NAME_PLYMOUTH started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :311 10.37 LOC_CITY_NAME_MBANZA_MBATA started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :311 LOC_CITY_NAME_NOBAMBA riot siege lost
    LoyaltyMod: Turn :311 LOC_CITY_NAME_SHEFFIELD riot siege lost
    LoyaltyMod: Turn :312 LOC_CITY_NAME_MBANZA_MBATA riot siege lost
    LoyaltyMod: Turn :313 LOC_CITY_NAME_NEWCASTLE_UPON_TYNE riot siege lost
    LoyaltyMod: Turn :314 51.27 LOC_CITY_NAME_MAJAPAHIT started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :315 LOC_CITY_NAME_MAJAPAHIT riot siege lost
    LoyaltyMod: Turn :315 LOC_CITY_NAME_PLYMOUTH riot siege lost
    LoyaltyMod: Turn :325 1.40 LOC_CITY_NAME_KWAHLOMENDLINI started a[ICON_Faith][ICON_Pillaged]Religious revolt
    LoyaltyMod: Turn :329 81.39 LOC_CITY_NAME_KHANGELA started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :329 LOC_CITY_NAME_KWAHLOMENDLINI riot siege lost
    LoyaltyMod: Turn :329 0.37 LOC_CITY_NAME_BULAWAYO started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :329 3.37 LOC_CITY_NAME_BABANANGO started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :329 5.43 LOC_CITY_NAME_KASPI started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :330 25.30 LOC_CITY_NAME_MBANZA_MPANGU started a[ICON_Government][ICON_Pillaged]Government revolt
    LoyaltyMod: Turn :330 25.26 LOC_CITY_NAME_MBANZA_NSUNDI started a[ICON_Government][ICON_Pillaged]Government revolt
    LoyaltyMod: Turn :330 81.35 LOC_CITY_NAME_ULUNDI started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :330 LOC_CITY_NAME_KHANGELA riot siege lost
    LoyaltyMod: Turn :330 LOC_CITY_NAME_BULAWAYO riot siege lost
    LoyaltyMod: Turn :330 LOC_CITY_NAME_BABANANGO riot siege lost
    LoyaltyMod: Turn :331 LOC_CITY_NAME_KASPI riot siege lost
    LoyaltyMod: Turn :332 69.20 LOC_CITY_NAME_SURABAYA started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :333 LOC_CITY_NAME_ULUNDI riot siege lost
    LoyaltyMod: Turn :335 LOC_CITY_NAME_SURABAYA riot siege lost
    LoyaltyMod: Turn :335 LOC_CITY_NAME_MBANZA_MPANGU riot siege lost
    LoyaltyMod: Turn :335 LOC_CITY_NAME_MBANZA_NSUNDI riot siege lost
    LoyaltyMod: Turn :341 6.29 LOC_CITY_NAME_NDONDAKUSUKA started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    LoyaltyMod: Turn :341 6.39 LOC_CITY_NAME_NODWENGU started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :343 LOC_CITY_NAME_NDONDAKUSUKA riot siege lost
    LoyaltyMod: Turn :343 75.25 LOC_CITY_NAME_UMGUNGUNDLOVU started a[ICON_MAKE_PEACE][ICON_Pillaged]War Exhaustion revolt
    LoyaltyMod: Turn :343 LOC_CITY_NAME_NODWENGU riot siege lost
    LoyaltyMod: Turn :346 LOC_CITY_NAME_UMGUNGUNDLOVU riot siege lost
    LoyaltyMod: Turn :347 51.27 LOC_CITY_NAME_MAJAPAHIT started a[ICON_Razed][ICON_Pillaged]Separatist revolt

    Not one siege riot won though?

    Unfortunately there is a big memory leak problem with the mod:
    upload_2019-5-13_16-13-31.png

    It means that even a 16GB desktop is almost ground to a halt on a standard map by turn 350.

    Wonder why?
     
    Last edited: May 13, 2019
    Gueux likes this.
  10. Gueux

    Gueux Chieftain

    Joined:
    Mar 30, 2018
    Messages:
    178
    Gender:
    Male
    Location:
    France
    I disabled migration (I think the memory problem come from it)
     

    Attached Files:

    glider1 likes this.
  11. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,784
    Location:
    Where animals hop not run
    Another run on loyalty = 1000 and 528 turns on standard settings

    You fixed the memory problems! Can you work out what in migration causes it? The feature sounds cool.

    Plenty of revolt action, separatist revolts, government revolts, religious revolt early on, most sieges are lost.

    Non fatal errors:
    LoyaltyMod: 2 table: 000000016B562E70
    LoyaltyMod: -1 nil
    Runtime Error: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1347: attempt to index a nil value
    stack traceback:
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1347: in function 'OnCombat'
    [C]: in function 'func'
    [C]: in function '(anonymous)'

    LoyaltyMod: 63 table: 000000016B566B60
    Runtime Error: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:848: attempt to index a nil value
    stack traceback:
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:848: in function 'GetNextPlotToTarget'
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:812: in function 'MakepathToTerritory'
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:724: in function 'InitializeEachTurn'

    LoyaltyMod: Phase has Begun
    LoyaltyMod: Turn :187 20.27 LOC_CITY_NAME_SKIEN started a[ICON_Razed][ICON_Pillaged]Separatist revolt
    Runtime Error: bad argument #2 to 'math.random' (interval is empty)
    stack traceback:
    [C]: in function 'math.random'
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:1754: in function 'RevoltType'
    Lua callstack:
     
    Gueux likes this.
  12. Gueux

    Gueux Chieftain

    Joined:
    Mar 30, 2018
    Messages:
    178
    Gender:
    Male
    Location:
    France
    the migration is each turn it look every city of the player it count every migrants type and for each city it look every city in world and if it's close enought it look if it can welcome migrants and how much the city is attractive, after counting this it take every city and send a percentage of migrants to a city depending on attractivity, I think I create too much table and it's not optimized at all, I added "collectgarbage" in it, it should give me some info about where the problem is if it doesn't fix the problem search for "collectgarbage", so it reactive migration

    I (tried to) fix math random and on combat errors, but not the GetNextPlot one.

    thx for testing
     

    Attached Files:

    glider1 likes this.
  13. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,784
    Location:
    Where animals hop not run
    Here is a log of 20 turns. I can see the memory creeping up every turn slowly. Only thing I can think is a garbage problem initialising table?
    local Tablename = {}; -- cleaned up every call to function
    Tablename.InnerTable = {}; -- this not cleaned up?
     

    Attached Files:

    • Lua.zip
      File size:
      37.1 KB
      Views:
      12
    Gueux likes this.
  14. Gueux

    Gueux Chieftain

    Joined:
    Mar 30, 2018
    Messages:
    178
    Gender:
    Male
    Location:
    France
    this version do not create table, just reuse them, I don't know if it change anything, migration is activated
     

    Attached Files:

    glider1 likes this.
  15. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,784
    Location:
    Where animals hop not run
    Another test autoplay loyalty = 1000 350 turns:

    Non fatal error:

    LoyaltyMod: Revolt: 161 free city change owner at14.11
    Runtime Error: C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:3622: attempt to index a nil value
    stack traceback:
    C:\Users\Harry\Documents\My Games\Sid Meier's Civilization VI\Mods\Loyalty++Test\UI\CityBanners\LoyaltyMod.lua:3622: in function 'OnCityTileOwnershipChangedNotification'
    [C]: in function 'func'
    [C]: in function '(anonymous)'

    I think you improved the memory problem but it still not fixed (but not sure). It steadily rises and was 13 GB private memory verses ~6 GB vanilla at turn 350. If I restart game and reload save memory is normal again. Maybe it is because of autoplay? Definitely before it was using too much so it is improved by a lot.

    I will try to hand play a game instead of autoplay.
     
    Gueux likes this.
  16. Bonci

    Bonci Chieftain

    Joined:
    Oct 22, 2005
    Messages:
    738
    Location:
    Tridentum - Italia
    Hey Gueux just wanted to let you know that I love your ideas, I hope the debugging goes well!
    Thanks for your work :)
     
  17. Gueux

    Gueux Chieftain

    Joined:
    Mar 30, 2018
    Messages:
    178
    Gender:
    Male
    Location:
    France
    Thanks I really appreciate, the mod always need some bug fix and balance, if you want to help you could send me your lua.log after closing the game or tell me if you think anything is unbalanced
     
  18. glider1

    glider1 Chieftain

    Joined:
    May 29, 2006
    Messages:
    2,784
    Location:
    Where animals hop not run
    I'm still playing through a game by hand. Great mod though. It still allows you to play normally but with interesting dynamics that are well thought out and subtly balanced and there aren't any game breaking bugs. The mod is almost inactive on standard size maps though because current build of this mod (loyalty = 5000) is for huge maps. I've got a test build on loyalty = 1000 and a lot more things are happening and good fun to play.
     
  19. Gueux

    Gueux Chieftain

    Joined:
    Mar 30, 2018
    Messages:
    178
    Gender:
    Male
    Location:
    France
    I don't know how I could make the max loyalty depends on map size with sql, but I could multiply chance of revolt or loyalty per turn
     
  20. cuso210

    cuso210 Chieftain

    Joined:
    Apr 6, 2012
    Messages:
    73
    Hi! I really like this mod, I'm trying it in a Giant Map with the Historic Speed mod, so far so good. I've noticed one thing, when I'm watching the loyalty lense betwwen turns, sometimes the game freezes. It has only happened to me in that moment.
    I do have a question: Why is 5000 the max loyalty? It's not that it is bad, I'd just like to know. Is it because the new loyaty modifiers? If I play with 1000 loyalty in a huge map would rebelions start faster?
     

Share This Page