PPQ_Purple
Purple Cube (retired)
- Joined
- Oct 11, 2008
- Messages
- 5,763
So you are saying automation is bad for turn times? I knew it. Automation is the devils tool and now I have proof.
Mutating CvInitCore::setLeader
Mutating CvInitCore::setColor
Mutating CvInitCore::setMinorNationCiv
InitUninit CvPlayer::init
InitUninit CvMap::init
CreateDestroy CvMapGenerator::GetInstance
Mutating CvMapGenerator::generateRandomMap
Mutating CvMapGenerator::addGameElements
InitUninit CvGame::initDiplomacy
Mutating CvGame::setInitialItems
Mutating CvGame::initScoreCalculation
InitUninit CvGame::initEvents
Mutating CvGame::setFinalInitialized
InitUninit CvGlobals::SetGraphicsInitialized
InitUninit CvPlayer::setupGraphical x19
InitUninit CvMap::setupGraphical
InitUninit CvSelectionGroup::reset
Mutating CvGame::getGlobeviewConfigurationParameters
Mutating CvMap::updateSymbolVisibility x2
Mutating CvInitCore::reopenInactiveSlots
Mutating CvGame::setInitialTime
Mutating CvPlayer::setStartTime x19
Python CyArgsList::makeFunctionArgs
Mutating CvMap::updateMinimapColor
CreateDestroy CvPlotIndicatorData::CvPlotIndicatorData
InitUninit CvEventReporter::gameStart
Python CyArgsList::makeFunctionArgs
Mutating CvPlayer::updateHuman x19
Python CyArgsList::makeFunctionArgs
ComplexGetter CvGame::calculateOptionsChecksum
ComplexGetter CvGame::calculateSyncChecksum
Mutating CvGame::update
Python CyArgsList::makeFunctionArgs
CreateDestroy CyUnit::CyUnit
CreateDestroy CyPlot::CyPlot
CreateDestroy CyUnit::CyUnit
Python CyArgsList::makeFunctionArgs
CreateDestroy CvPopupInfo::CvPopupInfo
Mutating CvPopupInfo::operator =
CreateDestroy CvDLLButtonPopup::getInstance
Mutating CvDLLButtonPopup::launchButtonPopup
_ReturnAddress()
. That return address should also let you see the call site in Ghidra and any surrounding logic.You don't need a cache. After all, you need to reevaluate the whole city if a change has happened anyway. So you only need one boolean per city to represent that something, anything has changed and than hook that up into all the functions that change things.Now you just need to stop the AI from automating things.
The real solution of course is to make it fast. There's a huge amount of redundant computation. A city shouldn't have to reevaluate its plots if they didn't change. I wonder if you could have like some sort of centralised cache that maps arbitrary plots to arbitrary values. The hard problem is ensuring correctness. Proper invalidation.
CvGame::update
, so if there are no inter-dependencies, it would be easy to thread that.Honestly, I don't really see the logic for it. Not in this case anyway. If your goal is to make the function that checks where to move workers around in a city faster by making it run less often a cache is plainly overkill. Remember, maintaining caches comes with its own price in terms of memory footprint and CPU work. And fundamentally I just don't really see a reason to pay that if we don't have to.Yes, you could locally cache things. But something like plots which are modified elsewhere, having a centralised caching system may have use. I don't exactly know what's best though, that would be something for somebody with time to figure out. You'd have to really look into the code and find all the data dependencies.
CvCityAI::AI_assignWorkingPlots
and AI_plotValue
within. It's literally a bunch of nested looping on top of whatever else those functions are doing. What you'd do is keep trimming things off of profiling results and hope you can handle whatever needs to be done without any major rearchitecting.I guess it makes sense if you have to work within a 2GB memory limit since caches would add up very quickly. But still, god dam. Honestly just finding a way to rid our self of a memory limit would be huge in its own right if for no other reason than the mods. I wonder if that is even possible though. Probably not since we can't recompile the actual .exe.Yes, the DLL is chock full of recalculation. I don't know how much of it is a good candidate for caching though. I've just been looking atCvCityAI::AI_assignWorkingPlots
andAI_plotValue
within. It's literally a bunch of nested looping on top of whatever else those functions are doing. What you'd do is keep trimming things off of profiling results and hope you can handle whatever needs to be done without any major rearchitecting.
I'm not sure where most memory usage comes from. Probably art assets. My 200 city save loads up at 1.1GB according to heap debugging. 835MB of that is apparently in the engine *and other sources, leaving 291MB from the DLL.I guess it makes sense if you have to work within a 2GB memory limit since caches would add up very quickly. But still, god dam. Honestly just finding a way to rid our self of a memory limit would be huge in its own right if for no other reason than the mods. I wonder if that is even possible though. Probably not since we can't recompile the actual .exe.
_nh_malloc
from VC71 is only 3.65% total CPU time.Okay, but that's not a realistic issueThe next performance issue: If you bring up the city screen enough, it will slow down. Reproduce with rapid Esc, F10 in an end game save.
Not rare at all. It happens all the time in my huge games. UI gets slow, enqueuing production gets slow, I actively avoid going into the city screen unless I need to. You restart the game to get it back to normal.Okay, but that's not a realistic issue
I mean who cares that we can freeze the game by some extreme action? Or is this the symptom of something else?
Player 0 event: The villagers have given you the secrets of a new Technology!
CmdCiv4 log Info void __cdecl CyPopupInfo::addPopup(int): player 0
Player 0 event: You have discovered TXT_KEY_TECH_AGRICULTURE!
addPopup for player 0: What would you like to research next?
Until the point you have to choose between steam and GOG.How deep down the rabbit hole should I go for a proof of concept miniengine.