Bug Reports and Technical Issues

:sad:
 
Firefox blocked the images for a potential security risk. Could someone drag and drop them into the message box as direct attachments?
 
Error after peace with Portugal.
 

Attachments

  • Anmerkung 2020-08-15 103807.png
    Anmerkung 2020-08-15 103807.png
    21.3 KB · Views: 36
  • Anmerkung 2020-08-15 103846.png
    Anmerkung 2020-08-15 103846.png
    101 KB · Views: 30
  • Anmerkung 2020-08-15 103907.png
    Anmerkung 2020-08-15 103907.png
    51.8 KB · Views: 29
  • Anmerkung 2020-08-15 104037.png
    Anmerkung 2020-08-15 104037.png
    42.2 KB · Views: 35
  • Anmerkung 2020-08-15 104056.png
    Anmerkung 2020-08-15 104056.png
    43.2 KB · Views: 34
  • Anmerkung 2020-08-15 104119.png
    Anmerkung 2020-08-15 104119.png
    42 KB · Views: 33
  • Anmerkung 2020-08-15 104219.png
    Anmerkung 2020-08-15 104219.png
    71.2 KB · Views: 27
  • Anmerkung 2020-08-15 104241.png
    Anmerkung 2020-08-15 104241.png
    91.7 KB · Views: 33
  • Harun al-Rashid Error.CivBeyondSwordSave
    1.6 MB · Views: 30
Yeah not sure but might be related to the moving of a city in worldbuilder or that was a coincendence?
I think the error can occur whenever a city object is destroyed and recreated, which happens when a city is moved, but also when a city changes hands in any way.
 
Could be.
 
Las Git update (August 17 1:07AM). Started a new English game, 3000BC Heir Normal: some 275 python exeptions.
 

Attachments

  • Victoria AD-0820 Turn 203 Heir Normal 3000BC Start.CivBeyondSwordSave
    617.3 KB · Views: 27
  • Logs.zip
    29 KB · Views: 28
Las Git update (August 17 1:07AM). Started a new English game, 3000BC Heir Normal: some 275 python exeptions.
Loaded the game, founded London, ended the turn. No exceptions for me. Is there anything in particular you did?
 
After Judaism was founded many python exceptions have shown up. Save attached.
Okay, this one is too weird not to share in detail.

The error is not about Judaism being founded at all. Superficially, China discovers a new tech, among others this triggers a dynamic name check and a stability check. To do this, all Chinese cities need to be iterated. Something weird is happening here: China's city list has two cities, but only one of them is actually a city, the other an invalid value (None). When the stability/dynamic name code tries to do anything with that None value, an error occurs.

How can the game think China has two cities, but one of them isn't really a city? Looking into the save, China only has its capital. I quickly considered the likely reason: you can get the city list from the player itself, or you can get the city from the plot it's on. My get cities by owner function kind of does boths for reasons of... code sharing I think (maybe I need to reconsider this). Analysis shows: the player thinks there is a second city, but the plot it should be on says there shouldn't be a city.

This is weird because, when a city is founded, it should be added to its plot as well to its player, before the game proceeds and anything else can happen. In particular, all of that should happen before China can discover a tech.

Took me a while to figure out how that could possibly make sense. First clue: I realised the city was founded through the "AI China gets cities immediately when it builds a settler" rule. Second clue: the city is added to its plot a little later than it is added to its player. This led to me looking into the code being executed in the meantime and I noticed another thing happening there: the tile the city is on is set to be owned (culture covered) by its owner.

This gave me an idea and I checked the game to confirm: there is indeed a tribal village on the tile before the city gets founded on it. Tribal villages get popped when they are culture covered, and building a city cultured covers its tile before the city gets associated with the plot. The tribal village happened to give China a free tech, triggering the tech discovery code mentioned at the beginning, before that city is properly assigned to its plot. This could only happen because of the special Chinese autofounding rule because normally, tribal villages cannot be popped in the middle of building a city - the settler would have already popped it when moving into the tile before founding the city.

The solution: make sure to culture cover the tile pre-emptively before founding the city, so all the potential tech related stuff can be resolved earlier.

But the more interesting aspect is that this is the perfect illustration of the pitfalls of software development and the weird corner case you can run into that nobody could ever anticipate. But also, that I am still somewhat responsible for because I am doing something not really anticipated by the game (founding a city without having a unit on the tile) and writing code that is (probably needlessly) vulnerable to this particular error: listing cities requires both the player list and the plot city functionality. Oh what fun.
 
Loaded the game, founded London, ended the turn. No exceptions for me. Is there anything in particular you did?
In order to save the game I had to click on all the exception warnings. That's why I attached the logs, if you want to recreate the errors you have to start a new 3000BC game on Heir/Normal. No errors on Regent.
 
Congrats, this save also contains a secret crash for some reason.
yeah, that game was played on the version some commits ago, after I updated the mod on my machine I'm getting the crash as well. ah well.
 
In order to save the game I had to click on all the exception warnings. That's why I attached the logs, if you want to recreate the errors you have to start a new 3000BC game on Heir/Normal. No errors on Regent.
Save from previous turn that allows reproducing the errors is needed. Your logs did not include PythonErr.log, so not helpful either.
 
yeah, that game was played on the version some commits ago, after I updated the mod on my machine I'm getting the crash as well. ah well.
Can you tell me which version that was?
 
Is there a way to check pull history on the local repo?
Yes. It's called the reflog. I'm not sure which client you are using, in the command line you should get something like this:
Screenshot from 2020-08-18 14-36-52.png

This is on a local repo on my work laptop, where I checked out DoC on v1.16.2 a while ago and just did another pull. Latest is on top. To the left you can see the abbreviated commit SHA.

You can do the same with TortoiseGit, here's a link with more info. Not sure how to access it, but the docs mention that it's called "Reference Log" and you need to shift right-click the directory to make it show up in the context menu. It's probably best if you just screenshot what is shown and upload it here.
 
I discovered what the bug causes with the culture notices in red. Mainly if you move a city and a religion vanishes you get a culture loss of a little, due to the monastery/temple vanishing, in my test case Judaism almost always vanishes when you move or even in rare when you capture a city as well. Game calculates as if the religious buildings aren't gone, so you get a culture difference of few culture.

sadly then adding the religion/building doesn't fix it.
 
Last edited:
Top Bottom