DLL - Various Mod Components

Don't know; don't play with the mod. From reading the steam page, broken saves seems to be a "feature" introduced by the mod. I can't get any valid save files (all around 17Kb) and if the game is not saving correctly, then no number of minidumps will reveal the issue. I'd start by pointing the finger at the "fixinator" sql - as anything that renumbers tables without great care is going to be dangerous. A lot of the DLL code assumes that routes, builds, etc have known values - renumbering those without care is not going to work. At the very least, every SELECT TYPE ... subclause in that file should have an ORDER BY ID component.
 
Hello,

Finding that VMC v96 is consistently causing Capitals to not be relocated to Cities which are either Puppeted or in Resistance.

Images:
Spoiler Neither Cities are given the Palace because they were both in Resistance when the Original Capital was captured (before my turn started and ended the single turn of Resistance) :


Spoiler Here I Annexed Almaty and then waited for it to leave Resistance before losing my Capital :


Spoiler And I then consequently Puppeted Tyre and waited for it to leave Resistance :


Spoiler Capital relocation still works fine for Settled Cities which will be neither in Resistance nor Puppeted :


Spoiler Mod list :


Can also speak from experience to say that the problem is not related to Original Capitals, nor from there being multiple Cities of the same Population size or anything such.

This is obviously problematic, not just for code which assumes that an alive Player has a Capital City but also because the AI is capable of trading said last City away and eliminating themselves.

Spoiler Observe how the Peace Treaty is invalidated and the Made Peace notification gives no Player name because the AI Player has eliminated themselves through the forfeiting of their last City in the peace deal, which they were allowed to do because this last City was Puppeted (though out of Resistance) and thus not made into their Capital. Note also that this City wasn't an Original Capital. :


This Lua function should remedy the problem for anyone silently suffering from this issue, delivered in incomprehensible single-line form for easy FireTuner execution:
Code:
GameEvents.CityCaptureComplete.Add(function(oldID) local pPlayer = Players[oldID] if pPlayer:IsAlive() and (not pPlayer:GetCapitalCity()) then local tCity = {pCity = false, iPop = -1} for pCity in pPlayer:Cities() do local iPop = pCity:GetPopulation() if iPop > tCity.iPop then tCity.pCity = pCity tCity.iPop = iPop end end if tCity.pCity then tCity.pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_PALACE"], 1) end end end)

And if you're using a Civ which has a unique Palace then well unlucky you I guess.
 
I had a similar issue where an AI Player only had one city remaining after I took their capital and it happened to be an eliminated AI Player's former capital city, so the AI Player's capital would not transfer to that city. Upon taking that final city, instead of eliminating that capital-less AI Player from the game, it instead crashed to desktop (CTD). I think I still have that saved game somewhere if anyone is interested in debugging it.
 
Hello,

Finding that VMC v96 is consistently causing Capitals to not be relocated to Cities which are either Puppeted or in Resistance.

Images:
Spoiler Neither Cities are given the Palace because they were both in Resistance when the Original Capital was captured (before my turn started and ended the single turn of Resistance) :


Spoiler Here I Annexed Almaty and then waited for it to leave Resistance before losing my Capital :


Spoiler And I then consequently Puppeted Tyre and waited for it to leave Resistance :


Spoiler Capital relocation still works fine for Settled Cities which will be neither in Resistance nor Puppeted :


Spoiler Mod list :


Can also speak from experience to say that the problem is not related to Original Capitals, nor from there being multiple Cities of the same Population size or anything such.

This is obviously problematic, not just for code which assumes that an alive Player has a Capital City but also because the AI is capable of trading said last City away and eliminating themselves.

Spoiler Observe how the Peace Treaty is invalidated and the Made Peace notification gives no Player name because the AI Player has eliminated themselves through the forfeiting of their last City in the peace deal, which they were allowed to do because this last City was Puppeted (though out of Resistance) and thus not made into their Capital. Note also that this City wasn't an Original Capital. :


This Lua function should remedy the problem for anyone silently suffering from this issue, delivered in incomprehensible single-line form for easy FireTuner execution:
Code:
GameEvents.CityCaptureComplete.Add(function(oldID) local pPlayer = Players[oldID] if pPlayer:IsAlive() and (not pPlayer:GetCapitalCity()) then local tCity = {pCity = false, iPop = -1} for pCity in pPlayer:Cities() do local iPop = pCity:GetPopulation() if iPop > tCity.iPop then tCity.pCity = pCity tCity.iPop = iPop end end if tCity.pCity then tCity.pCity:SetNumRealBuilding(GameInfoTypes["BUILDING_PALACE"], 1) end end end)

And if you're using a Civ which has a unique Palace then well unlucky you I guess.

Just want to add a new bizarre observation:

Here we see that upon the Ethiopian capital of Addis Alem being captured, their Palace is not relocated to Addis Ababa as one might expect based on its population but rather to the far-flung, occupied, small city of Delhi which is in the process of being razed.

Spoiler :





I don't know why this has happened, or what this apparent contradiction means for my above testing. I don't really want to test more thoroughly when the problem will presumably be solved by consequence of the initial problem. All I know is that it isn't my Lua fix causing it to happen, as it's finding the Ethiopians to already have a Capital when CityCaptureComplete is called and thus isn't acting to fix the problem.

Spoiler The errors are from an unrelated mod, and event. If my function was being executed, then there would be a "Calling Capital finder for 3" print made by CityCaptureComplete. :


Idk not a very helpful bug report this time but there you go.
 
Try the attached, it should fix both the "no capital if only occupied/puppet cities" and the "use an occupied/puppet city over a settled city" bugs

EDIT: V97 with this fix is now available from my web site and github
 
Last edited:
Try the attached, it should fix both the "no capital if only occupied/puppet cities" and the "use an occupied/puppet city over a settled city" bugs

Looks like it works :thumbsup:
 
I am using a lot of mods, including non-VMC mods.
Bypassing it doesn't work and according to the logs, it is still trying to process auto-movement of units etc. for that city state.
Hi @Zakara, I've been encountering with the same CTD problem for several times. Have you solved the issue?

@whoward69 Thanks for your work and I enjoy playing civ5 with your dll mods very much. however I'm experiencing a CTD problem which is triggered when one CS is captured during AI turn (not in every game but quite often). I tried the lastest v97 dll mod but the issue still occurs. I'm not familiar with custom dll modding and knows little about crash debugging, can you have a look at this 'bug' when it's convenient to you? and I'm wondering what information of file should I provide for debugging? thanks.
 
Without a repeatable sequence of events (see what Chrisy15 did above) it's almost impossible to debug something as abstract as "sometimes X doing Y causes a CTD, but not always".

Is there a .mdmp file from the v97 dll just after the CTD, if so, I may be able to glean something from it.
 
Without a repeatable sequence of events (see what Chrisy15 did above) it's almost impossible to debug something as abstract as "sometimes X doing Y causes a CTD, but not always".

Is there a .mdmp file from the v97 dll just after the CTD, if so, I may be able to glean something from it.
Hi whoward, thanks for your reply. do you mean CvMiniDump.dmp in the main game folder? you can find the file in mega clound storage: https://mega.nz/file/mmxgiBLJ#aHw9fdgGIWYwsVv72FUOWUHJgevYPgbcjN9TKBBrRB0
 
@whoward69, is your Diplomacy - CivIV Features broken? I try to install it? but it requires CIV4 Features itself. But Civ4 Features blocks VMC mod)) If I try manually load in CustomModOptions DIPLOMACY_CIV4_FEATURES set to 1 it does nothing
 
@whoward69, is your Diplomacy - CivIV Features broken? I try to install it? but it requires CIV4 Features itself. But Civ4 Features blocks VMC mod)) If I try manually load in CustomModOptions DIPLOMACY_CIV4_FEATURES set to 1 it does nothing

It's unfortunate that the support was removed, as the Community Patch has since then removed its own C4DF support that WH references, but it is what it is.
 
@mayuyu from what I can see in that CvMiniDump file, the City State is in a defensive pact with a major civ - and that should never happen!

I'll add a note to the code to defend against the possibility if/when I next do an update
 
I mixed a huge number of components with version 92. And I won't even remember all of them for sure. I noticed that neither I nor the AI can not trade the lsые copy of luxury resources. Can you tell me which of the components may be responsible for this moment? And I'll dig around and see why this is happening.
 
I mixed a huge number of components with version 92. And I won't even remember all of them for sure. I noticed that neither I nor the AI can not trade the lsые copy of luxury resources. Can you tell me which of the components may be responsible for this moment? And I'll dig around and see why this is happening.
My crystal ball is currently broken
 
I'll answer a different way. You can't be bothered to see which mods you have and look at their descriptions to see if they affect AI trading, but you expect me to second guess all the combinations you might possibly be using and divine if any such combinations might cause a problem. Not going to happen.
 
Top Bottom