Discussion in 'Rhye's and Fall - Dawn of Civilization' started by Leoreth, Sep 11, 2014.
I am working on this bug right now, but a save from another mod is useless for that.
My city have emigrated to America!
Firefox blocked the images for a potential security risk. Could someone drag and drop them into the message box as direct attachments?
Same thing happens with the Tibetan UHV display (Buddhism 25% goal). Which probably means that all religion spread displays are bugged.
Yeah not sure but might be related to the moving of a city in worldbuilder or that was a coincendence?
Error after peace with Portugal.
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.
Ah then it is related to the conquest I did on it.
Congrats, this save also contains a secret crash for some reason.
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?
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.
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.
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.
Save from previous turn that allows reproducing the errors is needed. Your logs did not include PythonErr.log, so not helpful either.
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:
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.
Separate names with a comma.