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. Cosmos1985

    Cosmos1985 King

    Joined:
    Sep 20, 2008
    Messages:
    648
    Location:
    Aarhus, Denmark
    Was this changed recently? I'm positive I played a Dutch game just a few months ago where I came across this combo and indeed got 2 food pr. artist :confused:
     
  2. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,328
    Gender:
    Male
    Location:
    Leblanc
    Yes, I implemented a rule to limit extra specialist food to +1 overall fairly recently.
     
  3. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,797
    Location:
    The city of the original vlaai
    The same problem occurs for me as well. I investigated it a bit and I think the following is happening. First of all, I think it is just a graphical bug. The road is indeed present. Opening the WB confirms this by making the roads visible. Exiting the WB makes them invisible again.

    If you remove the road and placing it again, the road becomes visible. Setting plot.setRevealed() also makes the road visible. I investigated these functions and I noticed the plot.setRevealRouteType() function. Based on the name of the function, it could very possibly be connected to the error.

    When the road is built in Resources.py, the plot.setRouteType(eTeam, eRoute) executes the plot.setRevealRouteType() function for all living teams. (Notice that it is a team parameter and not a player parameter) The Mongols are not yet alive, so the revealed route type is not updated for them, leaving it at the previous route type, which is usually NO_ROUTE.

    Code:
    @handler("BeginGameTurn")
    def createRoutesBeforeSpawn(iGameTurn):
        for iCiv in dSpawnRoutes:
            if iGameTurn == year(dBirth[iCiv]) - 1 and data.isCivEnabled(iCiv):
                for tile in dSpawnRoutes[iCiv]:
                    plot(tile).setRouteType(iRouteRoad)
    When a civ spawns, the code below is executed. plot.setRevealed() does also include a trigger of plot.setRevealedRouteType(). I expected that this would update the revealed route type, but it doesn't. However, as you can see in the code the initBirth is triggered during a range of turns. The first is the turn 2 turns before the proper spawn date and 1 turn before the road is build. Maybe it doesn't update the revealed route type because it is triggered before the road is build. The turn later the road is build (but the revealed route type is not updated for the Mongols as they aren't alive yet). However, I would expect that it would update during the next turns, as the initBirth should also trigger then. (I haven't seen something that prevents initBirth from executing when the civ has just spawned, so I expect it to execute during all turns in the range)

    Code:
    @handler("BeginGameTurn")
    def checkBirths():
        for iLoopPlayer in players.major().where(lambda p: dBirth[p] > scenarioStartYear()):
            if year(dBirth[iLoopPlayer]) - turns(2) <= year() <= year(dBirth[iLoopPlayer]) + turns(6):
                rnf.initBirth(dBirth[iLoopPlayer], iLoopPlayer)
    
    [...]
    
        def initBirth(self, iBirthYear, iPlayer):
    
            [....]
                  
            # Leoreth: reveal all normal plots on spawn
            for plot in plots.normal(iCiv):
                plot.setRevealed(team(iPlayer).getID(), True, False, -1)
    A very simple fix for this is by placing the road not 1 but 2 turns before spawn. This way it is guaranteed that the road is build before plot.setRevealed() in initBirth() is triggered. I tested it and it works.

    During this investigation I noticed that he plot.setRevealed() function uses iPlayer as the first argument, while it should be the teamID. I made a PR with this fix.
     
  4. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,328
    Gender:
    Male
    Location:
    Leblanc
    Does the current state of the code not already fix this issue for you?
     
  5. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,797
    Location:
    The city of the original vlaai
    I must have missed that part of the changelog.

    I just checked it and it seems partially workiing. At spawn the roads are still invisible. When I build Karakorum, all roads outside the BFS do become visible, but the ones in the BFC are still invisible.
     
  6. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,328
    Gender:
    Male
    Location:
    Leblanc
    That's normal. The roads should be visible already before building a city.
     
  7. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,797
    Location:
    The city of the original vlaai
    That is currently not the case. Before building a city the roads are NOT visible. After building the city only SOME (the ones outside the BFC) become visible.
     
  8. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,328
    Gender:
    Male
    Location:
    Leblanc
    The problem always is with the ones directly surrounding the capital tile. Before the capital is founded, the other tiles are not in your vision anyway (unless your capital is on a hill, but that is not the case for Mongolia).
     
  9. Hickman888

    Hickman888 Warlord

    Joined:
    Oct 13, 2019
    Messages:
    174
    Gender:
    Male
    Location:
    Texas
    This popup appeared when I built the Trading Company as the Spanish (Marathon speed).
    Spoiler Python Exception :
    20200720155515_1.jpg
     
    1SDAN and Leoreth like this.
  10. Mosguito

    Mosguito Chieftain

    Joined:
    Jul 21, 2020
    Messages:
    5
    I have experimented on it recently and found the canadian can successfully play the other music into which I change on the XML, which means this problem may stem from the MP3 itself?
     
  11. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,797
    Location:
    The city of the original vlaai
    You're right about San Martin using Peron diplo music. I made a PR with a fix.

    Here is why. The name in the XML key (AS2D_DIPLO_SAN_MARTIN_INTRO) doesn't tell which audio file should be used. Instead, it points to an XML entry in Audio2DScripts.xml. (The one in the spoiler below.) It has the name San Martin in the tag because that makes it easy to see what it is used for. But it could be any name, as long as the key in both LeaderHeadInfos and Audio2DScripts are the same.

    Spoiler :
    Code:
        <Script2DSound>
            <ScriptID>AS2D_DIPLO_SAN_MARTIN_INTRO</ScriptID>
            <SoundID>DIPLO_SAN_MARTIN_INTRO</SoundID>
            <SoundType>GAME_MUSIC</SoundType>
            <iMinVolume>75</iMinVolume>
            <iMaxVolume>75</iMaxVolume>
            <iPitchChangeDown>0</iPitchChangeDown>
            <iPitchChangeUp>0</iPitchChangeUp>
            <iMinLeftPan>-1</iMinLeftPan>
            <iMaxLeftPan>-1</iMaxLeftPan>
            <iMinRightPan>-1</iMinRightPan>
            <iMaxRightPan>-1</iMaxRightPan>
            <bLooping>0</bLooping>
            <iMinTimeDelay>0</iMinTimeDelay>
            <iMaxTimeDelay>0</iMaxTimeDelay>
            <bTaperForSoundtracks>0</bTaperForSoundtracks>
            <iLengthOfSound>0</iLengthOfSound>
            <fMinDryLevel>1.0</fMinDryLevel>
            <fMaxDryLevel>1.0</fMaxDryLevel>
            <fMinWetLevel>0.0</fMinWetLevel>
            <fMaxWetLevel>0.0</fMaxWetLevel>
            <iNotPlayPercent>0</iNotPlayPercent>
        </Script2DSound>


    The XML entry in the spoiler above also doesn't point to the audio file, but only has some settings. In it, you see <SoundID>DIPLO_SAN_MARTIN_INTRO</SoundID>. This tag points to the another XML entry, this time in audioDefines.xml. If we search for that we find what is in the spoiler below. Here is the path to the audio file defined. As you can see, the path of San Martin leads to the Peron audio file.

    Spoiler :
    Code:
            <SoundData>
                <SoundID>DIPLO_SAN_MARTIN_INTRO</SoundID>
                <Filename>Sounds/Diplomacy/Peron_Intro</Filename>
                <LoadType>DYNAMIC_RES</LoadType>
                <bIsCompressed>1</bIsCompressed>
                <bInGeneric>1</bInGeneric>
            </SoundData>


    This is why the game plays Peron's audio, while all keys in the XML are correctly called SOMETHING_SAN_MARTIN. The there is an error in the path to the audio file. As I mentioned, I made a PR (pull request) that fixes this.

    The entry of Tokugawa is in fact the entry of Oda Nobunaga. The names in the XML keys can sometimes be a bit misleading. LEADER_JIMMU is actually Kammu, although that isn't obvious from the name in the keys.
     
    Mosguito likes this.
  12. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,328
    Gender:
    Male
    Location:
    Leblanc
    If someone wants to make a PR correcting these XML keys it would be welcome.
     
  13. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,797
    Location:
    The city of the original vlaai
    With the "replace in files" option of notepad++ that is a very quick task. I have one small question about one of the Indian leaders. Should it be Shuhaji (current name) or Shivaji (current XML keys and pedia)?
     
  14. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,328
    Gender:
    Male
    Location:
    Leblanc
    I renamed him to Shahuji at one point for whatever dumb reason, but Shivaji is definitely better. I thought I had reverted that already.
     
    1SDAN and merijn_v1 like this.
  15. Mosguito

    Mosguito Chieftain

    Joined:
    Jul 21, 2020
    Messages:
    5
    Wow...that's a lot in my favor. Thanks a lot. I think I probably know the trick. When I searched for "Bumin" "Alparslan" or "canada" in the XML above I got none. Incredible instruction for me.
     
  16. Dominus the Mentat

    Dominus the Mentat Warlord

    Joined:
    Oct 29, 2018
    Messages:
    122
    This python exception has show up right after Protestantism was founded.

    Civ4ScreenShot0399.JPG
     
  17. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,328
    Gender:
    Male
    Location:
    Leblanc
    This seems to work fine. I end the turn in your save and plains farms are down to 2 food.
     
    Hickman888 likes this.
  18. Hickman888

    Hickman888 Warlord

    Joined:
    Oct 13, 2019
    Messages:
    174
    Gender:
    Male
    Location:
    Texas
    The hover icon shows the "correct" amount of food. But when you turn on tile yields, or check out how much food/turn the city is pulling in, it shows the bugged yield.
    Spoiler Food Bug :
    20200723222634_1.jpg 20200723222639_1.jpg
     
  19. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,797
    Location:
    The city of the original vlaai
    The problem is that normally entering a new era does not change the yield, so they are not updated and therefor the yield symbols are also not updated. I made a PR that updates the yields (and therefor also the symbols) when you enter a new era, which solves this.
     
    Last edited: Jul 24, 2020
  20. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,328
    Gender:
    Male
    Location:
    Leblanc
    Sorry for checking this so late, but I am having no issues ending the turn. You win the UHV and the game ends as expected. Do you still want the turn after that?
     

Share This Page