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

Bug Reports and Technical Issues

Discussion in 'Rhye's and Fall - Dawn of Civilization' started by Leoreth, Sep 11, 2014.

  1. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,875
    Gender:
    Male
    Location:
    House of Hades
    That's actually a good point, civs should probably cancel their defensive parts before declaring war on you if it's over a congress decision.
     
  2. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,875
    Gender:
    Male
    Location:
    House of Hades
    Confirmed the crash. It's caused by the Russian troops capturing Krakow, if you want to continue deleting the Russian army or giving the city to Russia should avoid the crash until I figure out the fix.
     
  3. Mxzs

    Mxzs Prince

    Joined:
    Aug 16, 2003
    Messages:
    522
    Defensive Alliance thing: Really?

    If you want that behavior, you should change the nomenclature, because that's not a defensive alliance.

    I also don't know why any sane player would sign such an agreement. You're chaining yourself to an AI and trusting it won't ever suddenly yell "Yippee ki-yay, mofos!" and jump into a tank of hungry sharks.
     
  4. JDPElGrillo

    JDPElGrillo Chieftain

    Joined:
    Aug 20, 2015
    Messages:
    72
    On a separate matter, I did some digging into the Relations component of Foreign stability and some things seem a bit odd to me. Sorry, this post ended up a bit longer than I first intended.



    In the same Japan game as described earlier (I'm now in the process of fighting America with my Mexican vassal), I saw that my foreign stability was getting a massive -22 from bad relations, and after reading the Civpedia entry I decided to do a bit more digging in Stability.py.

    It was a bit hard to visualize how the functions worked so I added in some quick code to print parts of the calculation in calculateRankedAttitudes:

    Spoiler Original Code :

    Code:
    def calculateRankedAttitudes(iPlayer, lContacts):
        lContacts.append(iPlayer)
        lContacts = utils.getSortedList(lContacts, lambda iPlayer: gc.getGame().getPlayerScore(iPlayer), True)
        iPlayerIndex = lContacts.index(iPlayer)
    
        iRangeSize = 4
        if iPlayerIndex <= len(lContacts) / 5:
            iRangeSize = 3
    
        iRange = len(lContacts) / iRangeSize
        iLeft = max(0, iPlayerIndex - iRange/2)
        iRight = min(iLeft + iRange, len(lContacts)-1)
    
        lStronger = [calculateAttitude(iLoopPlayer, iPlayer) for iLoopPlayer in lContacts[:iLeft] if iLoopPlayer != iPlayer]
        lEqual = [calculateAttitude(iLoopPlayer, iPlayer) for iLoopPlayer in lContacts[iLeft:iRight] if iLoopPlayer != iPlayer]
        lWeaker = [calculateAttitude(iLoopPlayer, iPlayer) for iLoopPlayer in lContacts[iRight:] if iLoopPlayer != iPlayer]
    
        return lStronger, lEqual, lWeaker
    


    Spoiler My added code, just before the return :

    Code:
        #TMZ_DEBUG_RELATIONS
        lStrongerNames = [gc.getPlayer(iLoopPlayer).getCivilizationShortDescription(0) for iLoopPlayer in lContacts[:iLeft] if iLoopPlayer != iPlayer]
        lEqualNames = [gc.getPlayer(iLoopPlayer).getCivilizationShortDescription(0) for iLoopPlayer in lContacts[iLeft:iRight] if iLoopPlayer != iPlayer]
        lWeakerNames = [gc.getPlayer(iLoopPlayer).getCivilizationShortDescription(0) for iLoopPlayer in lContacts[iRight:] if iLoopPlayer != iPlayer]
    
        if utils.getHumanID() == iPlayer:
            CyInterface().addMessage(utils.getHumanID(), True, iDuration, str("Contents of lStronger:"), "", 0, "", ColorTypes(iGreen), -1, -1, True, True)
            for i in range(len(lStronger)):
                CyInterface().addMessage(utils.getHumanID(), True, iDuration, str(lStrongerNames[i]) + ": " + str(lStronger[i]), "", 0, "", ColorTypes(iGreen), -1, -1, True, True)
    
            CyInterface().addMessage(utils.getHumanID(), True, iDuration, str("Contents of lEqual:"), "", 0, "", ColorTypes(iWhite), -1, -1, True, True)
            for i in range(len(lEqual)):
                CyInterface().addMessage(utils.getHumanID(), True, iDuration, str(lEqualNames[i]) + ": " + str(lEqual[i]), "", 0, "", ColorTypes(iWhite), -1, -1, True, True)
    
            CyInterface().addMessage(utils.getHumanID(), True, iDuration, str("Contents of lWeaker:"), "", 0, "", ColorTypes(iRed), -1, -1, True, True)
            for i in range(len(lWeaker)):
                CyInterface().addMessage(utils.getHumanID(), True, iDuration, str(lWeakerNames[i]) + ": " + str(lWeaker[i]), "", 0, "", ColorTypes(iRed), -1, -1, True, True)
    




    Here's the result. The thing that strikes me is that the list lStronger is empty. While intuitively this makes sense, as I have the highest score in the game, the result is that the groups for lEqual and lWeaker are made larger, and the lEqual group has a fixed size of len(lContacts) / iRangeSize, which in this case is 21 / 3 = 7. I can see that there's an adjustment made if the player is in the top 5 for score, such that iRangeSize is reduced from 4 to 3, but it doesn't seem to be sufficient. In this case, the lEqual group becomes the top third of AI civs by score, with the lWeaker group being the rest. Now, it just so happens that due to the world war that's going on, I'm at war with almost every civ in the lEqual group. Next, we need to move on to the calculateStability method, specifically the parts under '# FOREIGN'.

    Spoiler Original code :

    Code:
    # attitude stability
        lStrongerAttitudes, lEqualAttitudes, lWeakerAttitudes = calculateRankedAttitudes(iPlayer, lContacts)
    
        iAttitudeThresholdModifier = pPlayer.getCurrentEra() / 2
    
        iRelationStronger = 0
        iPositiveStronger = count(lStrongerAttitudes, lambda x: x >= 4 + iAttitudeThresholdModifier * 2)
        if iPositiveStronger > len(lStrongerAttitudes) / 2:
            iRelationStronger = 5 * iPositiveStronger / max(1, len(lStrongerAttitudes))
            iRelationStronger = min(iRelationStronger, len(lStrongerAttitudes))
    
        iRelationWeaker = 0
        iNegativeWeaker = max(0, count(lWeakerAttitudes, lambda x: x < -1) - count(lWeakerAttitudes, lambda x: x >= 3 + iAttitudeThresholdModifier))
    
        if iNegativeWeaker > 0:
            iRelationWeaker = -8 * min(iNegativeWeaker, len(lWeakerAttitudes) / 2) / max(1, len(lWeakerAttitudes) / 2)
            iRelationWeaker = max(iRelationWeaker, -len(lWeakerAttitudes)) / pPlayer.getCurrentEra()
    
        iRelationEqual = sum(iAttitude / 5 for iAttitude in lEqualAttitudes if abs(iAttitude) > 2)
    
        iRelationStability = iRelationStronger + iRelationEqual + iRelationWeaker
    


    Breaking this down:
    1. If more than half of the AIs stronger than you have an attitude that's more favorable to you than 4 plus the current era, you'll get a bonus. The bonus can never be larger than the number of civs in the lStronger group. Notably, you aren't punished for these AIs having an unfavorable attitude toward you, so the impact here is capped between 0 and the size of the lStronger group.
    2. Next in the code for lWeaker, there's a bit more going on. If there are more civs in the lWeaker group that like you a lot (3 plus the era modifier) than dislike you (by more than -1), you get no bonus. If there are more civs that dislike you, take the difference, with a fairly small modifier and apply that as your penalty. This is capped again by how many civs there are in the lWeaker group divided by the era number, which in my case is -(15 / 5) = -3. My actual penalty is -1, thanks to all of my vassals in the lWeaker group. So far so good.
    3. Now we come to lEqual.

    Code:
        iRelationEqual = sum(iAttitude / 5 for iAttitude in lEqualAttitudes if abs(iAttitude) > 2)
    
    Here for each civ with a strong attitude (more than -2 to +2) their attitude is divided by 5 and then summed. The bonus or penalty that results is not capped in either direction. Remember who was in my lEqual group?



    No wonder I'm getting -21 in total from them! The AIs that plunged the world into chaos, all over one congress decision, hate me, and my people apparently are taking this as the signal that the glorious People's Republic of Japan is on the verge of catastrophe. Nevermind that Japan is the strongest power in the world, among the most advanced and cultured, whose only apparent misstep in all of this was to refuse a congress decision to give the Dutch back one of their cities in Japan's UHV2 zone in the Philippines :Or to sign those defensive pacts which doomed the world, I suppose

    On a more serious note, I think there are two issues here:
    - Major issue: I think there should be some kind of cap to the stability impact of the lEqual group, just as there is for the lStronger and lWeaker groups. Now that I know this is how it works, it's possible to play around it, but it seems counter-intuitive that it would be the only one of the three that can have such a large impact. For my own playthroughs, I'll be limiting the iRelationEqual term to +/- the current era number to bring it in line with the other modifiers.

    Code:
        iRelationEqual = sum(iAttitude / 5 for iAttitude in lEqualAttitudes if abs(iAttitude) > 2)
        if iRelationEqual > 0: iRelationEqual = min(iRelationEqual, pPlayer.getCurrentEra())
        if iRelationEqual < 0: iRelationEqual = max(iRelationEqual, -1 * pPlayer.getCurrentEra())
    
    - Minor issue: the player grouping concept doesn't quite work once the player is at the top of the scoreboard. While it's true that no civ is stronger than Japan at the moment, it's not quite accurate to say that the next 7 are equal when for all intents and purposes they are weaker, with many having barely half Japan's score.
     
    Last edited: Dec 19, 2019
    trevor and Leoreth like this.
  5. 1SDAN

    1SDAN Brother Lady

    Joined:
    Oct 27, 2014
    Messages:
    2,718
    From a glance at that scoreboard, it's literally you vs the world.

    The only nation that isn't a vassal and doesn't have negative relations are the Ottomans. I can't say I'm surprised you've got -21 foreign stability.
     
  6. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,875
    Gender:
    Male
    Location:
    House of Hades
    It's intentional that only the group of civs most similar to you in power has a significant impact on your impact, and you are quite hated. It's also intentional that you cannot just ignore everyone's opinions just because you are more powerful than them. I can look at the specific numbers here though, and it would help if you can send me the save of that situation.
     
  7. Imp. Knoedel

    Imp. Knoedel Simperator Knoedel

    Joined:
    Nov 11, 2011
    Messages:
    8,783
    Location:
    The cooler Germany
    https://en.wikipedia.org/wiki/World_War_I
     
    Last edited: Dec 19, 2019
  8. Mxzs

    Mxzs Prince

    Joined:
    Aug 16, 2003
    Messages:
    522
    But only one defensive pact was legally invoked in WWI, and that was the British guarantee of Belgian neutrality.

    * There was no defensive alliance between Russia and Serbia. Russia mobilized out of its own interest in the situation.

    * Russia was slow to move in the Balkans for fear that France would interpret Russia's moves as aggressive. There was much doubt whether France would intervene should a Russian declaration trigger a German declaration, as a Russian declaration could be interpreted as voiding the conditions that would trigger their own alliance.

    * Because Russia only mobilized, they did not trigger the defensive alliance between Germany and Austria-Hungary. Germany declared against Russia on its own. That would have been sufficient to trigger a French intervention, only Germany simultaneously pre-empted Paris by declaring on France first.

    * A-H, by declaring on Serbia, and Germany, by declaring on Russia and France, gave Italy an out. Despite having a defensive alliance with the German powers, Italy declared not war but its own neutrality, and it could do so because the war had been started by German and Austrian actions, not by other countries attacking Germany and Austria. That applied as well when Britain declared on Germany. That is how a defensive alliance is supposed to operate.

    * The British guarantee of Belgium was the only treaty that operated according to its formal terms, and it wasn't even a defensive alliance, as Britain's guarantee of Belgium was not (as far as I know) reciprocated with a Belgian guarantee of Britain.

    The First World War was not started by treaty mechanisms clanking into action, but by the empires of Europe operating according to their own self-interest and needs. Russia wanted to protect Serbia. Germany wanted to protect Austria from Russia, and itself from a prolonged two-front war. Britain wanted to protect Belgium and France; France had to fight in order to keep Germany from destroying the Russian counterweight.

    Had there been not one defensive alliance in existence, the Continent still would have collapsed into war, just as it had in the Wars of the Spanish and Austrian Succession, and the Seven Years War, when there were only interests, not treaties, in play.
     
  9. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,875
    Gender:
    Male
    Location:
    House of Hades
    "Mein Kaiser, Russia is mobilising their troops. It is obvious they intend to attack our ally Austria-Hungary. I suggest we mobilise ourselves, and maybe even pre-empt their attack by declaring war first."

    "No. The rules say we must wait until someone attacks."
     
  10. JDPElGrillo

    JDPElGrillo Chieftain

    Joined:
    Aug 20, 2015
    Messages:
    72
    Save attached. There are a few reasons why this outcome doesn't make sense to me:

    1. The asymmetry of it. To all the civs at war with me, due to their relative positions on the scoreboard, Japan is considered to be in the lStronger group, and therefore they're receiving zero foreign stability penalty for Japan's negative attitude toward them. In fact, they're probably getting a net stability bonus because their relative equals include their war allies and they're stacking up a bunch of mutual military struggle modifiers. We're all at war and our total power counting my vassals is fairly close, why is the stability impact so lopsided?
    2. The potential for abuse of the way the lEqual group is defined. Now that I know that it will always be a certain number of civs, one easy solution to this problem, without changing the code, is to get one of my peaceful vassals into the group. In this example, all I'd need to do is gift Mexico some more cities and tech and they would easily have the 1400 score needed. Then their +100 attitude would cancel out all the warring civs, and in times of peace would probably keep me at stable all by itself. In other scenarios, I know that I can safely declare war on a civ in the lWeaker group because the stability penalty is capped, and to avoid declaring war on a civ in the lEqual group accordingly.
    3. It makes playing this kind of world war scenario much less fun. This is partly my fault for not understanding ahead of time how this would work, but after all the war declarations my thinking was "how do we win this war without losing cities in North America, or having vassal Spain eliminated when my forces are all in southeast Asia and the Americans just teched to Battleships vs my Cruisers" not "how do I sign peace ASAP with everyone in the lEqual group and avoid capturing their cities so my stability doesn't suffer". I was having a lot of fun playing out the war turns and felt that I had just broken the Americans with an amphibious fork of Washington and Philadelphia, when I checked the stability adviser and realized that no, I was actually in danger of just collapsing and effectively losing the game.
     

    Attached Files:

    Last edited: Dec 19, 2019
    trevor, bluepotato and Leoreth like this.
  11. 1SDAN

    1SDAN Brother Lady

    Joined:
    Oct 27, 2014
    Messages:
    2,718
    That Mexico thing doesn't exactly sound like an exploit. I'm not exactly sure how to phrase this, but a nation improving the power of their allies for diplomatic means doesn't exactly sound far fetched.
     
  12. JDPElGrillo

    JDPElGrillo Chieftain

    Joined:
    Aug 20, 2015
    Messages:
    72
    I'd consider it exploitative because of how peace vassals instantly get bumped to +100 attitude, leading to the difference between having a peace vassal in 8th place vs in 7th place being worth 20 stability. If this is considered okay, then getting multiple peace vassals into the lEqual group become the single best source of stability available in the mid/late game and should be an immediate priority. One lets me ignore being at war with half the world. The second lets me run ahistorical civics (Oh I'd love to get out of Democracy and back into Republic). The third lets me settle a whole continent.
     
    Last edited: Dec 19, 2019
    trevor likes this.
  13. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,875
    Gender:
    Male
    Location:
    House of Hades
    You're right about vassal attitude, I didn't take this into account (I did not expect vassals to be in this category but of course it's possible). I guess an absolute cap of 20-25 on the considered attitude makes sense. But that's unrelated to the original issue you were reporting.

    I will look into the save to see if this world war is factored into the penalty too harshly and if there are ways to account for that, but overall your description of the situation indicates that the system is working. Relations stability is meant to be a check on aggressive expansion and the disregard of world opinion that comes with being the most powerful civ in the world. You are in the extreme situation of having annoyed all other civs that come close to being your peers, and you are still pushing your war against them even though you are hated for it. Peacing out quickly is a solution to your problem, although of course with some delay until AIs become willing to talk again. This is probably the worst possible place to be in for relations stability and your -20 matches the "worst case scenario" stability penalty from other categories in terms of magnitude.
     
    trevor likes this.
  14. JDPElGrillo

    JDPElGrillo Chieftain

    Joined:
    Aug 20, 2015
    Messages:
    72
    Fair enough. Honestly, even without the congress issue I still would have needed to declare war on Britain and the US to try and slow down their tech rate for UHV3, bringing me into this same scenario. I actually failed to do so in time and have failed UHV3 in the attached save, but decided I'd play out the game anyway for a domination victory and to roleplay creating a Trans-Pacific alliance. It sounds like my best next steps would be to peace out of the current wars, then try to break some defensive pacts or else find a war target in the lWeaker group instead.
     
    trevor likes this.
  15. Michael_Crow

    Michael_Crow Chieftain

    Joined:
    Dec 19, 2019
    Messages:
    4
    Gender:
    Male
    Hello. I have a peculiar issue with slavery. I am able to capture slaves and to sell them, yet I cannot use them. I played as Kongo and as Ethiopia and in both cases, my civics allowed me capturing and selling of the slaves, yet I could never disband them in a city as a slave specialist, or use them in order to build a plantation. The icons for such actions are simply no present where they are supposed to be.

    I remember having it before too, in the version 1.15, then I haven't played the game for quite some time, then I decided to play again, I never uninstalled it, it was the same version, yet the issue was gone. I remember that I could at least "plant" them in cities. I remember having an icon for that. Recently I upgraded the mod to the last official version 1.16 and the issue reappeared. Now I cannot use slaves in any capacity except for selling them.

    Here is a screenshot:
    Spoiler :
    Civ4ScreenShot0000.JPG

    And to demonstrate that I am not a complete idiot and have the right civics there is another one:
    Spoiler :
    Civ4ScreenShot0001.JPG


    And to top it all off, the save file is attached.

    I hope to find a solution to that, because I for all its flaws, I really enjoy this mod very much.
     

    Attached Files:

  16. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,875
    Gender:
    Male
    Location:
    House of Hades
    Slaves can only be used in the New World as settled specialists or for slave plantations. Your use for slaves is to sell them via diplomacy to other civs that control cities there.
     
  17. Mxzs

    Mxzs Prince

    Joined:
    Aug 16, 2003
    Messages:
    522
    I know you're being sarcastic, but that's exactly what the rules say, if you're talking about the rules that govern defensive alliances. It's the reason A-H consulted heavily with Germany before sending Serbia an ultimatum. Because A-H knew that if they acted offensively against Serbia, and Russia then waded in, then Germany would have an ironclad excuse for staying out. "You started it, you finish it."

    No, there was no "rule" saying that Germany had to wait. Germany could act pre-emptively, and it did. But by acting pre-emptively, they voided their defensive alliance with both A-H and Italy. In fact, not only Italy but A-H could have used Germany's pre-emptive declaration against Russia as an excuse to not declare war on Russia. As a legal matter, A-H would have been perfectly within their rights to leave Germany to fight Russia alone; as a practical and moral matter, of course, they couldn't. But we're talking about how a certain kind of legal document—a defensive alliance—works, not how nations for raison d'etat must treat each other as a practical matter.

    If you want a DoC world that can collapse into a world war for the same reasons it did in the early twentieth century, then you need to work on the AI that governs diplomacy and strategy—what the AI takes into account when making war—because it was diplomatic and military strategy that caused the First World War, not legal entanglements. If you leave defensive alliances working under the present logic (which is your prerogative, of course) I repeat what I said above, and point to the above absurdity (countries that try to defend the Netherlands' interests by declaring war on the Netherlands) as justification:

    Only a fool would ever sign this kind of "defensive alliance" with an AI.
     
  18. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,875
    Gender:
    Male
    Location:
    House of Hades
    Rules do not exist in the real world and anyway who lets themselves be rolled over by an initial attack because otherwise you are not "truly" defending yourself? That's just schoolyard logic.
     
    Imp. Knoedel likes this.
  19. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,875
    Gender:
    Male
    Location:
    House of Hades
    Alright, fix comes with the next update.
     
    BaneFire likes this.
  20. Leoreth

    Leoreth Prince of Blood Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,875
    Gender:
    Male
    Location:
    House of Hades
    Not a bug, the route needs to be in your territory (or in the territory of the civ the route starts at). There's a gap between your eastern and western cities in the Taklamakan area.
     

Share This Page