Bug Reports and Technical Issues

Ending turn should lead to the rebirth of the Chinese civ, regardless of whether you say yes or no to their flip, you will get a python error for your trouble.

SHA-1: 133c9bc60a23e51bf14e2f761a75aa6911edd0eb
Mentioning that it's from the riseandfall branch would have helped, but fixed.
 
Just confused me for a bit. Unfortunately I don't know the sha by heart yet.
 
I'm one git version behind. Python errors pop up *after* I complete the buildings UHV.

Defensive pacts are disabled even when declaring war on independents.
 
I'm one git version behind. Python errors pop up *after* I complete the buildings UHV.
Please upload a save.

Defensive pacts are disabled even when declaring war on independents.
You mean that declaring war on independents cancels your active defensive pacts?
 
I wanted to start a 1700 AD game as Spain but for some reason I have an insane amount of debt.

Also, here's a random save where that Python error I mentioned could be there. Not sure if it got fixed in the current version though.
 

Attachments

I'd like to report two Python bugs; one bug is in RFCUtils.py on line 987 as of commit ac3fb91c on branch riseandfall, and one is in History.py on line 614 as of commit 468f8886 also on branch riseandfall (History.py on line 635 as of latest commit ac3fb91c as of this post).

The first bug, which is the function flipOrRelocateGarrison, I could sort of fix by catching the thrown exception from the function. I have reproduced the original code below:
Code:
def flipOrRelocateGarrison(city, iNumDefenders):
    lRelocatedUnits = []
    lFlippedUnits = []
   
    for plot in plots.surrounding(city, radius=2).where(lambda p: not p.isCity() or location(p) == location(city)):
        for unit in units.at(plot).owner(city.getOwner()).domain(DomainTypes.DOMAIN_LAND):
            if unit.canFight() and len(lFlippedUnits) < iNumDefenders:
                lFlippedUnits.append(unit)
            else:
                lRelocatedUnits.append(unit)
                   
    return lFlippedUnits, lRelocatedUnits

By wrapping the for loop with a try and except, I was able to avoid the Python exception (it was something about city being None, which I could not figure out. The original bug occurred one turn before a very large AI-controlled Roman Empire collapsed, but I forgot to save a copy of the save file as I had sort of fixed the bug as described below:
Code:
def flipOrRelocateGarrison(city, iNumDefenders):
    lRelocatedUnits = []
    lFlippedUnits = []
    
    try:
        for plot in plots.surrounding(city, radius=2).where(lambda p: not p.isCity() or location(p) == location(city)):
            for unit in units.at(plot).owner(city.getOwner()).domain(DomainTypes.DOMAIN_LAND):
                if unit.canFight() and len(lFlippedUnits) < iNumDefenders:
                    lFlippedUnits.append(unit)
                else:
                    lRelocatedUnits.append(unit)
    except TypeError:
        return lFlippedUnits, lRelocatedUnits

    return lFlippedUnits, lRelocatedUnits

The second bug, which is in the function handleColonialAcquisition, seems to be attempting to access the None variable dColonialAcquisitionCities, which is causing the array access to fail. I checked where the other defines are set (following the name pattern such as dRespawnCapitals, dBirthArea, etc.) and found that there was no variable definition for dColonialAcquisitionCities either in this file or anywhere in the copy of RFC DoC that I had downloaded. Only three results occur for this variable, all of which are in History.py in the functions acceptColonialAcquisition, refuseColonialAcquisition, and handleColonialAcquisition. I have reproduced a reduced version of the original code here for your convenience:
Code:
def handleColonialAcquisition(iPlayer):
    pPlayer = player(iPlayer)
    iCiv = civ(iPlayer)
    
    ...

    for iTarget in targetPlayers:
        if player(iTarget).isHuman():
            askedCities = cityPlots.cities().owner(iTarget)
            askedCityNames = askedCities.format(formatter=CyCity.getName)
                    
            iAskGold = askedCities.count() * 200
            
            data.dColonialAcquisitionCities[iPlayer] = askedCities
            
            ...
 
    ...
    
    pPlayer.setGold(max(0, iNewGold))
 
I'd like to report two Python bugs; one bug is in RFCUtils.py on line 987 as of commit ac3fb91c on branch riseandfall, and one is in History.py on line 614 as of commit 468f8886 also on branch riseandfall (History.py on line 635 as of latest commit ac3fb91c as of this post).

The first bug, which is the function flipOrRelocateGarrison, I could sort of fix by catching the thrown exception from the function. I have reproduced the original code below:
Code:
def flipOrRelocateGarrison(city, iNumDefenders):
    lRelocatedUnits = []
    lFlippedUnits = []
 
    for plot in plots.surrounding(city, radius=2).where(lambda p: not p.isCity() or location(p) == location(city)):
        for unit in units.at(plot).owner(city.getOwner()).domain(DomainTypes.DOMAIN_LAND):
            if unit.canFight() and len(lFlippedUnits) < iNumDefenders:
                lFlippedUnits.append(unit)
            else:
                lRelocatedUnits.append(unit)
                 
    return lFlippedUnits, lRelocatedUnits

By wrapping the for loop with a try and except, I was able to avoid the Python exception (it was something about city being None, which I could not figure out. The original bug occurred one turn before a very large AI-controlled Roman Empire collapsed, but I forgot to save a copy of the save file as I had sort of fixed the bug as described below:
Code:
def flipOrRelocateGarrison(city, iNumDefenders):
    lRelocatedUnits = []
    lFlippedUnits = []
  
    try:
        for plot in plots.surrounding(city, radius=2).where(lambda p: not p.isCity() or location(p) == location(city)):
            for unit in units.at(plot).owner(city.getOwner()).domain(DomainTypes.DOMAIN_LAND):
                if unit.canFight() and len(lFlippedUnits) < iNumDefenders:
                    lFlippedUnits.append(unit)
                else:
                    lRelocatedUnits.append(unit)
    except TypeError:
        return lFlippedUnits, lRelocatedUnits

    return lFlippedUnits, lRelocatedUnits

The second bug, which is in the function handleColonialAcquisition, seems to be attempting to access the None variable dColonialAcquisitionCities, which is causing the array access to fail. I checked where the other defines are set (following the name pattern such as dRespawnCapitals, dBirthArea, etc.) and found that there was no variable definition for dColonialAcquisitionCities either in this file or anywhere in the copy of RFC DoC that I had downloaded. Only three results occur for this variable, all of which are in History.py in the functions acceptColonialAcquisition, refuseColonialAcquisition, and handleColonialAcquisition. I have reproduced a reduced version of the original code here for your convenience:
Code:
def handleColonialAcquisition(iPlayer):
    pPlayer = player(iPlayer)
    iCiv = civ(iPlayer)
  
    ...

    for iTarget in targetPlayers:
        if player(iTarget).isHuman():
            askedCities = cityPlots.cities().owner(iTarget)
            askedCityNames = askedCities.format(formatter=CyCity.getName)
                  
            iAskGold = askedCities.count() * 200
          
            data.dColonialAcquisitionCities[iPlayer] = askedCities
          
            ...
 
    ...
  
    pPlayer.setGold(max(0, iNewGold))
Please upload saves that allow me to reproduce these errors.

Edit: fixed the second one without a save, but one for the first report would still be very helpful.
 
Last edited:
Recently I have run into this bug where on 3000 BC games the starting civs begin with surpluses of over 40K in food, production, and science. Just to be sure I started a game as Babylon and sure enough it happens for me, not just the AI. I have no idea what went wrong or how to remedy it.
 

Attachments

Recently I have run into this bug where on 3000 BC games the starting civs begin with surpluses of over 40K in food, production, and science. Just to be sure I started a game as Babylon and sure enough it happens for me, not just the AI. I have no idea what went wrong or how to remedy it.
Oh yeah sorry, that's a pretty severe bug. I pushed a fix.
 
I wanted to start a 1700 AD game as Spain but for some reason I have an insane amount of debt.
Same for this situation, fixed with the latest commit.
 
Is anyone else having trouble downloading from GitHub?

I had had no issue until today. It downloads slowly and with a damaged file.

EDIT: Fixed. It appears it had to do with me being connected to a WiFi extender rather than directly to the modem.
 
Last edited:
The github status page looks good.
 
The Turkic goal of creating an overland route from China to the Mediterranean isn't being completed. (All of the route is in under my culture.)
Spoiler An excuse to take a photo of my empire :
20211221224808_1.jpg
 

Attachments

Back
Top Bottom