Bug Reports and Technical Issues

Yes, I implemented a rule to limit extra specialist food to +1 overall fairly recently.
 
Can you explain a bit more where the road issue is? The roads appear graphically but don't actually affect the tile? Which parts are correctly working and which aren't?

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.
 
Does the current state of the code not already fix this issue for you?
 
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.
 
That's normal. The roads should be visible already before building a city.
 
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.
 
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).
 
This popup appeared when I built the Trading Company as the Spanish (Marathon speed).
Spoiler Python Exception :
20200720155515_1.jpg
 
Sorry for interrupting but here is a problem in my game 1.16 release.

In my every game, Canada and Turks always have no music on diplomacy screen or a zoom-in check of their cities. I checked both the XML civ4leaderhead.info and the assets/sounds/diplomacy in the mod folder but found no errors. The peace music themes have been perfectly written in the XML while none of them being played in the games. On top of that, I found that San Martin's theme in my game is actually Peron's, while in the XML it is absolutely named ''San Martin intro''.

I wonder why? Maybe this is not the real XML that works in the game? But when I remove it from the game folder the game cannot run, so the probability is excluded. At least I think so.

Also I can't find Oda Nobunaga or Kammu in the XML but Tokugawa, leaving me more confused. And Rahman's and Rajerha's themes are in the same location as the canada's and Turk's do but still function perfectly. So I don't think it's a path problem.

Oh and maybe for a hint every time I start the game I get a XML error saying that line 1490 "French" doesn't have a TXT end. But I assume it not involved.

Here is the XML if you need it.
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?
 
Sorry for interrupting but here is a problem in my game 1.16 release.

In my every game, Canada and Turks always have no music on diplomacy screen or a zoom-in check of their cities. I checked both the XML civ4leaderhead.info and the assets/sounds/diplomacy in the mod folder but found no errors. The peace music themes have been perfectly written in the XML while none of them being played in the games.

On top of that, I found that San Martin's theme in my game is actually Peron's, while in the XML it is absolutely named ''San Martin intro''.

I wonder why? Maybe this is not the real XML that works in the game? But when I remove it from the game folder the game cannot run, so the probability is excluded. At least I think so.

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.

Also I can't find Oda Nobunaga or Kammu in the XML but Tokugawa, leaving me more confused. And Rahman's and Rajerha's themes are in the same location as the canada's and Turk's do but still function perfectly. So I don't think it's a path problem.

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.
 
If someone wants to make a PR correcting these XML keys it would be welcome.
 
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)?
 
I renamed him to Shahuji at one point for whatever dumb reason, but Shivaji is definitely better. I thought I had reverted that already.
 
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.
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.
 
2.) Progressing to the Renaissance era as the Moors doesn't take away the "+1 :food: on food improvements on plains tiles".
This seems to work fine. I end the turn in your save and plains farms are down to 2 food.
 
This seems to work fine. I end the turn in your save and plains farms are down to 2 food.
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
 
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:
Crash bug after I press the next round button. Might have to do with me completing the UHV.
Build: v1.16 official release (no github modifications or other modmods etc.)

Is there a way to fix this myself? Would love to continue the game.
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?
 
Hello I believe I am using the latest update but I want to inquire if this is bugged or working as intended.

In this latest game, twice happening civs are "reborning" in someone else's faction core, while they are still alive. (or at moment of collapse, IDK)

The two examples I have:

1. Poland as a vassal of mine had low stability, and the HRE who was dead "reborn" into krakow as their capital. This killed the poland. (it had danzig and krakow as its only cities, and they both went HRE)

2. HRE who was dead, reborns into Italy civilization, with their capital in venice. This killed the italy. I think italy had low stability at the time, but I am not sure.

They just seem like very weird ways to reborn.

(also, in a byzantime game I went to like 1700s, and with the stability pointer being upward (so I had good stability), ottomans all of a sudden reborn itself in constantinople and most of its cities after I had already defeated them)

Should I try to get a save game for this second HRE reborn thing? or is it working as intended

The image is the turn hre reborn into italy

Spoiler :

2jyLtsi.png

I looked into this and it is technically working as intended, but this helped me discover a number of issues. What happened here is that in both cases, Poland and Italy collapsed and Holy Rome/Austria had a claim on their cities. In the first situation, they had the best claim to get Gdansk and Krakow, which brought them back. They then received Vienna and Budapest because they were independent at the time. Same situation with Italy, they had the best claim on Venica and could then also take Vienna and Budapest on top.

I see multiple issues with this:
- Poland should not be in the Holy Roman respawn area
- Venice should not be in the Austrian respawn area
- in the Poland case, I don't think the initial respawn (not considering extra cities awarded later) should succeed if it has no own core cities and only core cities of the collapsing civ (this also applies to the Italy case)
- in the Italy case, I also don't think a respawn should succeed when it only has one city (unless the full respawn area has only one city)

I corrected these issues in 1.16.2, but they only further complicated the "respawn from collapse" code. The problem here is also in part that these limitations were already in place for "normal" respawns, but the code handling collapses wasn't using it. So on develop I will probably reimplement the respawn from collapse code to share more logic with the normal respawn code, including these new rules.
 
Back
Top Bottom