Advanced Civ

Oh, one more thing.
Can you look at NE?
I suspect the doubled points are all getting converted to artist points? (so a merchant gives 3 merchant points and 3 artist points each round)
And it's been that way a while.

I've got a city that I KNOW has ran nothing but Merchants since it's last birth (it's not on auto, and it's been stagnant or starving the entire time), plus the NE artist contamination.
3200/3600 points, and it's 60% odds for an artist.

Non-NE cities appear to get the correct odds.
 
Can't run airstrikes from carrier-based fighters on ground units (I can bombard cities though).
 
Got this popup on turn 107. I had selected the scout, hit g, and moved the mouse over Hammurabi's unexplored territory. Can't remember exactly which tile. No output from the console. About half a dozen identical copies of the popup were generated. Saves are from immediately after and 3t before.
 

Attachments

  • before.CivBeyondSwordSave
    before.CivBeyondSwordSave
    143.7 KB · Views: 145
  • after.CivBeyondSwordSave
    after.CivBeyondSwordSave
    146.7 KB · Views: 146
  • exception-popup.png
    exception-popup.png
    1.1 MB · Views: 161
@carp: No immediately luck reproducing that error. I'll look into it more tomorrow(-ish).
Can't run airstrikes from carrier-based fighters on ground units (I can bombard cities though).
Because of its damage limit, the Fighter gets mistaken for a Siege unit that tries to attack amphibiously. Easy to fix.
Can you look at NE?
I suspect the doubled points are all getting converted to artist points? (so a merchant gives 3 merchant points and 3 artist points each round)
And it's been that way a while.
[...]
Non-NE cities appear to get the correct odds.
Apparently, GP rate modifiers (in BtS and AdvCiv) have no impact on birth probabilities:
Spoiler :
Code:
void CvCity::doGreatPeople()
{
   // ...
   // Total progress
   changeGreatPeopleProgress(getGreatPeopleRate());
   for (int iI = 0; iI < GC.getNumUnitInfos(); iI++)
   {
       // Progress per GP
       changeGreatPeopleUnitProgress((UnitTypes)iI,
               getGreatPeopleUnitRate((UnitTypes)iI));
   }
   // ...
}
Total progress includes modifiers,
Code:
int CvCity::getGreatPeopleRate() const
{
   if (isDisorder())
       return 0;
   return (getBaseGreatPeopleRate() * getTotalGreatPeopleRateModifier()) / 100;
}
but per-unit progress does not:
Code:
int CvCity::getGreatPeopleUnitRate(UnitTypes eIndex) const
{
   return m_paiGreatPeopleUnitRate[eIndex];
}
So specialists that generate 6 GPP after completing the NE do not have greater weight than those generating just 3 GPP pre-NE. That's highly counterintuitive to me; might be an oversight. Anyway, my code for computing the displayed birth probabilities assumes that the total progress value is the sum of the per-unit progress values, hence the highly inaccurate results in cities with a high GPP modifier. I'll correct both unless someone objects.
Giving muskets first strikes is near-useless. They'll typically be fighting Knights, who are immune.
If we want them to be garrison units, how about giving them the warrior (untyped +25% city defense) bonus?
You had described this stack of Cannons and Macemen. I was thinking that at least some of those Maces could be Muskets if Muskets were less inefficient. And then help with revolts or join an attack stack again. True – first strike and an anti-melee bonus would work mostly against the same units: Maceman, Pikeman. The first strike would help (a little) against Longbow in addition.
Speaking of first strikes, how hard is it to make a unit ignore the first two first strikes (without giving it first strikes of its own)?
Adding any new abilities is a chore (XML tags, game text, other documentation) and an ability like this would require both code for combat resolution and the calculation of combat odds. Not challenging though, I expect, being just a variation of first strike/ first-strike immunity.
 
Last edited:
Not quite, the issue is that the game tracks overall progress to a new great person in general separately from the progress/probability of a specific type of great person ("great person unit type"). Modifiers like National Epic (apparently, this surprised me too) only modify the former, but not the latter. So if you run an artist for the first ten turns and a merchant for the next ten turns after building a NE (assuming a GP costs 90 GPP), you will still have a 50% chance for each. Basically the NE only modifies how a specialist contributes to the speed of generating a new GP but not the probabilities.

I agree though that this is counterintuitive and should be changed.
 
The (quite literally) nightly build (edit: no longer the latest):
https://github.com/f1rpo/AdvCiv/.../CvGameCoreDLL.dll
(To be combined, as before, with this full download - or the assets on GitHub, a couple of which are slightly more recent.)
Fixes GP birth odds, air strikes from Carriers, a mixup in AI leader animations and a mixup in savegames that had (sometimes) had an effect akin to "new random seed after reloading".

Not fixed:
Got this popup on turn 107. I had selected the scout, hit g, and moved the mouse over Hammurabi's unexplored territory. [...]
A crash in CvGameTextMgr::getPlotHelp would look exactly like that. I've added some code there a while ago, but I'm not getting a crash, and I'm gathering that you can't reproduce it either. If it's a memory layout issue, CvSelectionGroup would seem like the only candidate, but I don't see how that could be it either.
 
Last edited:
f1rpo said:
but I'm not getting a crash, and I'm gathering that you can't reproduce it either. If it's a memory layout issue, CvSelectionGroup would seem like the only candidate, but I don't see how that could be it either.
Yeah, can't reproduce that one. Is there a way you can cause the uncaught exception to be displayed, either from the C++ itself or via the Python wrapper?

Meanwhile, I ran into a reproducible game-crasher in diplo. I've kept a before save file and the Visual Studio dump file.
Spoiler Instructions :
Enter negotiations with Boudica.
Put Open Borders on the table.
Exit diplomacy.
(on my machine) Game crashes.


Speaking of that save, I'm not sure how Beijing is trade-connected to the river to its west, or how Guangzhou is in the network at all without Sailing.
 

Attachments

Last edited:
New DLL looks good for GP points.
4 merchants vs the single point for NE gives 8% artist odds. 12:1, so right on.
 
In Rise and Fall, the dotmap leaks info between chapters:
dotmap-info-leak.png
Neither civ had their world map centered, and tiles revealed while I was playing didn't overlap, so there's no other way I could have known the relative location of Korea and China.

It would be nice to remember the dotmap in case I return to a given civ, but losing it in that case wouldn't be the end of the world.
 
Latest DLL: (edit - no longer the latest)
GitHub.com/f1rpo/AdvCiv/.../CvGameCoreDLL.dll
Fixes a major bug in the AI war evaluation code. In all the pre-release builds, the AI had ignored its NoWarAttitudeProb values, i.e. it had mostly declared wars regardless of attitude. Also (probably) fixed: the last crash reported by carp. That had only affected the Rise&Fall game option. In Assets\Python\Screens\CvVictoryScreen.py, I've fixed two minor issues with the Rise&Fall Score tab that I noticed in carp's savegames.
Meanwhile, I ran into a reproducible game-crasher in diplo. [...]
I hope that you've also asked Boudica to "make this deal work" because that's how I can reproduce it. Caused by an accidental copy of a list object. (I've made the list non-copyable now.)
Yeah, can't reproduce that one. Is there a way you can cause the uncaught exception to be displayed, either from the C++ itself or via the Python wrapper?
The DLL call (probably) comes from the EXE in this case, i.e. from Python code compiled into the EXE. The Python code for displaying (popup) and logging the error might be available; I'll try to check.
Speaking of that save, I'm not sure how Beijing is trade-connected to the river to its west, or how Guangzhou is in the network at all without Sailing.
It looks like this change (which apparently isn't covered by the main section of the manual)
Spoiler Manual :
Tiles workable by a civ which doesn't own any cities on the tile's landmass can be connected to
adjacent water tiles through a route. This means, a resource on an island within the workable
radius of a (mainland) city doesn't require a fort in order to be connected.
is missing the part that checks for 0 local cities. :cringe: If I can confirm that, then I'll fix it in the next DLL. Edit: A check for water might also be missing -- anyway, will investigate.
 
Last edited:
heya,

im not sure if this is related to my ranged stuff,
but when i ran some tests(latest commit)
i placed an enemy stack, 2 steps from my swordsman, emeny had 2 catapults, 1 artillery and some swordsmans and axemans,
i kept seeing - MISSIONAI_RETREAT ( they kept going back to the city) if the debug alt or shift key.
why retreat? it used city attack unit ai. seems odd, i would expect swift kill for my single swordsman.
no cities of mine on enemy island. was at war of course).
something in the AI_retreatToCity?

also -
im seeing some assertions on game load, map generation after savegame - plot(ix,iy) something and some more stuff (cant load the save).
another test,
enemy horse , 10 str, got the key of stranded, when it was just standing on a swamp (just a terrain feature i got).
same goes for a large stack with 2 catapults and 5+ emeny units, on a remote island, my warrior just stood and the enemy stack didnt move, for as long as i moved on turns.
 
Last edited:
Minor pathing bug:
odd-pathing.png
In this case, I'd expect SE-SE, but the game shows E-SE-S, which is mechanically equivalent but odd-looking.
 

Attachments

Updated version of the mod attached. (Edit: no longer the latest.) For fixing the last crash, a game text file needs to be changed, so I've uploaded a standalone download and (alternatively) one that only includes the files that have changed since the first pre-release version. The trade connection bug is also fixed.
[...] Speaking of that save, I'm not sure how Beijing is trade-connected to the river to its west, or how Guangzhou is in the network at all without Sailing.
This seems to be correct though, on closer examination. I'm attaching a screenshot. Beijing is connected to the lake and so are the rivers. (I haven't confirmed in the debugger that this is how it works; just my understanding of the trade rules.)
 

Attachments

Last edited:
[...] Is there a way you can cause the uncaught exception to be displayed, either from the C++ itself or via the Python wrapper?
Not being well familiar with the Python/C interface and Python in general, I don't think I can get a core dump with reasonable effort, or even a fault signal. Seems quite likely that CvGameText::getPlotHelp gets called, but of course that doesn't imply that it's the root of the problem. Fwiw, my conjecture regarding the sequence of events is:
Spoiler :
CvMainInterface.updateHelpStrings (CvMainInterface.py)
->
CyInterface.getHelpString (Python in EXE; probably checks whether the mouse is on any widget and gets the mouse-over plot)
->
some C++ function in the EXE (frame on the call stack; perhaps doing part of the above)
->
CvGameText::getPlotHelp (CvGameTextMgr.cpp; crashes?)
In Rise and Fall, the dotmap leaks info between chapters: [...]
Neither civ had their world map centered, and tiles revealed while I was playing didn't overlap, so there's no other way I could have known the relative location of Korea and China.
It would be nice to remember the dotmap in case I return to a given civ, but losing it in that case wouldn't be the end of the world.
I think the dotmap is a BUG feature (as opposed to BULL), i.e. all-Python. So I don't think I want to figure out how to store that per player; will have to clear it. I'll add it to my dotmap to-do list:
Spoiler :
Overlay isn't cleared when regenerating the map. And stays disabled after AI Auto Play. And doesn't store the most recently selected color in savegames. And appears to be cleared when Python scripts are reloaded.

[...] 2 saves on successive turns, crashes in both of them.
Thanks. That was caused by the raze-city popup. I've added some text there to let the player know when a conquered city can only be liberated directly through the popup. When the city has had more than one previous owner, BtS computes the target for liberation a bit differently, with a bias for the original owner, but only when liberating through the popup. I've considered eliminating that obscure (apparently deliberate) special rule, but then there would be one fewer reason for ever liberating upon conquest. (Just thought I'd mention that apropos.)

I've taken a look at the revolt probabilities in the savegame and noticed that all cities that are having problems with revolts (Delft, Amsterdam, Rotterdam, Middleburg) have hurry anger. Now I'm not sure if you were not aware that this increases revolt probabilities, or whether you already had all those Archers and just didn't mind in this situation. With hurry anger, Delft needs 40 garrison strength to be fully pacified, without it only 11. That'll have to be dialed down (the 40 with anger I mean). Also, whether or not you were aware, it needs to be communicated better. Adding a note "increased because of cruel oppression anger" to the nationality bar hover text is easy enough to do. Edit - for reference:
AdvCiv manual (f1rpo) said:
"Cruel oppression" anger in a city makes revolts considerably harder to suppress. (Otherwise, Slavery would be a too obvious answer for anger from foreign culture.)
Other considerations:

Marathon speed - Culture spread isn't speed-adjusted, so, in a way, acculturation of conquered cities should be relatively fast. Then again, there is also much more time than on Normal speed for the old culture to spread prior to conquest. And the duration of hurry anger is actually speed-adjusted, so perhaps the effect of anger on revolt chance should be decreased on slow settings.

Era - If the previous owner is still alive, then revolt strength scales with that player's current era. The Dutch in this case are defeated, so the game era counts, which is Medieval, but your units are all pre-Medieval. I guess that's fair enough, but something to reckon with perhaps.

Map size - As I mentioned earlier, a slight adjustment could make sense in order to "allow" faster expansion when there is much room.

I suppose it's intended that all terrain is Grassland? Well, you probably would've let me know if that was happening by accident ...

i placed an enemy stack, 2 steps from my swordsman, emeny had 2 catapults, 1 artillery and some swordsmans and axemans,
i kept seeing - MISSIONAI_RETREAT ( they kept going back to the city) if the debug alt or shift key.
why retreat? it used city attack unit ai. seems odd, i would expect swift kill for my single swordsman.
no cities of mine on enemy island. was at war of course).
I can reproduce that, at least pretty much, but I haven't debugged it. I guess AI city attack stacks really don't like to go out of their way far. Wouldn't want them to chase after some distraction. Note karadoc's comment (and iRange for AI_anyAttack being 1) in AI_attackCityMove:
Code:
// K-Mod (changed to allow cities, and to only use a single unit, but it is still a questionable move)
if (AI_anyAttack(1, 60, iMoveFlags | MOVE_SINGLE_ATTACK))
In this specific situation, it would probably be best to dispatch, say, a single Artillery and an Axeman to destroy your unit – before you might be able to reinforce or evacuate it. I'm not all that well familiar with the tactical AI. Seems like one of probably many instances in which more flexibility would benefit the AI. Some care would have to be taken with respect to performance. I'd feel more motivated to address this particular example if it had occurred in an actual game.
im seeing some assertions on game load, map generation after savegame - plot(ix,iy) something and some more stuff (cant load the save).
You can't load the initial autosave? If this happens with DotO, then it could very well be a DotO issue; you have a fair amount of extra savegame data. If I had adopted the "We the People" savegame format, then such errors would probably be much easier to debug or wouldn't occur in the first place. As it is, one can only set breakpoints in the various read functions, perhaps, for a start, CvInitCore, CvGame, CvMap, CvTeam, CvPlayer and narrow down where the crash occurs and where the loaded data starts looking nonsensical.
 
Last edited:
I can reproduce that, at least pretty much, but I haven't debugged it. I guess AI city attack stacks really don't like to go out of their way far. Wouldn't want them to chase after some distraction. Note karadoc's comment (and iRange for AI_anyAttack being 1) in AI_attackCityMove:
yes, its pretty easy to reproduce. i can understand the logic not to chase, but, in the test i did, mu unit was 3 tiles away... and both enemy stack and my warrior stayed still, without moving for several turns.
i did see a split of a horse archer from another stack in similar situation, where the horse took out the single unit, after it exited the source stack, but, then it got stranded for no reason,

I'd feel more motivated to address this particular example if it had occurred in an actual game.
yes, i agree with this notion, i did use the WB, kept replacing the dll with updated versions, and some xml i think....
but better to keep eyes open. ill try to see how it goes in a game with more "meat" on it.

You can't load the initial autosave? If this happens with DotO, then it could very well be a DotO issue
well, like i said, i kept on changing the dll xml, sometimes loaded the same save. i play around and see if happens again. i did use a debug, i saw the source errors, they all were from advc code. i added only the ranged strike since 096e.
but again, ill play around some more, just wanted to raise it here just in case.


p.s.
im thinking of letting go of the ranged attack , you have enough to do and i dont have much civ time my self, better use time i have to update according to advc basis and the stuff i had in doto and simple xml stuff.
later on ill try it, hopefully.
 
Last edited:
I've taken a look at the revolt probabilities in the savegame and noticed that all cities that are having problems with revolts (Delft, Amsterdam, Rotterdam, Middleburg) have hurry anger. Now I'm not sure if you were not aware that this increases revolt probabilities, or whether you already had all those Archers and just didn't mind in this situation. With hurry anger, Delft needs 40 garrison strength to be fully pacified, without it only 11. That'll have to be dialed down (the 40 with anger I mean). Also, whether or not you were aware, it needs to be communicated better. Adding a note "increased because of cruel oppression anger" to the nationality bar hover text is easy enough to do. Edit - for reference:

That would explain why cities are wandering in and out of stability... Stuff defenders in, city says "may revolt if 4 are removed", then a couple turns later it wants another half-dozen units. Probably because I whipped a courthouse. And then the revolt damages them all (which is fine), but then you need even more defenders to get it back out of revolt because they are weakened. (or have to wait several more turns for them to heal). So I spend several minutes every turn scooting a stack of units around to whichever city is in revolt that turn.

So you can't whip the city down, but everyone in it is foreign-culture angry and/or you may be short tiles to work due to enemy culture, so it just starves anyway. And costs you 80gpt in maintenance while it does. (well, maybe not in that save, but it does later in the game)
And no, I built all those archers to hold revolts down.
Guess if I'm stuffing a dozen archers in every city, I might as well use Monarchy all game.
I already find myself forced to use Monarchy from about Steam Power until the end of the game anyway, it's either that or run 60% culture to knock down some of massive pile of pollution unhappiness. The AI is happily beelining Attack Helicopters, while I'm trying to get Recycling Centers online to make my people happy.

Other considerations:

Marathon speed - Culture spread isn't speed-adjusted, so, in a way, acculturation of conquered cities should be relatively fast. Then again, there is also much more time than on Normal speed for the old culture to spread prior to conquest. And the duration of hurry anger is actually speed-adjusted, so perhaps the effect of anger on revolt chance should be decreased on slow settings.

Era - If the previous owner is still alive, then revolt strength scales with that player's current era. The Dutch in this case are defeated, so the game era counts, which is Medieval, but your units are all pre-Medieval. I guess that's fair enough, but something to reckon with perhaps.

Wait, what? A dead civ gets harder to pacify when the game era advances? But if I leave him a size1 foodless city somewhere it doesn't?

Map size - As I mentioned earlier, a slight adjustment could make sense in order to "allow" faster expansion when there is much room.

I suppose it's intended that all terrain is Grassland? Well, you probably would've let me know if that was happening by accident ...

Map is from "random script map" (leader and civ were also random). Not actually sure which one it chose, and I didn't notice.

Oh, one more thing. I usually just use State Property. Actually went corps instead on the below screenshot. Have corp costs always been this insane and I just forgot? Yes, I'm in Free Market.
I also got the -25% inflation event this game.
My victory was in doubt earlier. It's not now. I got far enough ahead I abandoned this game.
1978.jpg


I'm making half that back from my HQs (in wall street city, so 688+200%), but it's still expensive. Not as expensive as the culture slider though. That's why I'm chasing Genetics instead of advanced flight or composites or something, I want that +3 health for the happiness.
 
Last edited:
@f1rpo: Sorry for the spurious report about the trade connections. I updated to latest and tried to recreate the problem without the road to Guangzhou, and couldn't, so chalk that up as either FIXED or NOTABUG.

As for other river-trade stuff, where is the intended behavior documented? I don't want to tug your sleeve with a dozen whatabouts unless that's necessary.

As for the dotmap stuff, I know Python pretty well. I could try and whittle down that to-do list if you'd like.
 
Last edited:
yes, its pretty easy to reproduce. i can understand the logic not to chase, but, in the test i did, mu unit was 3 tiles away... and both enemy stack and my warrior stayed still, without moving for several turns.
On that uninhabited island. I'm assuming that those units also had "city attack" AI. It's the default AI type for siege units, and siege units have a high priority when it comes to leading an AI stack. I think there's only that range-1 AI_anyAttack call in AI_attackCityMove for dealing with enemy units on neutral ground. For friendly territory, there are AI_defendTerritory calls. I guess it would be a good thing to check for nearby enemies toward the end of AI_attackCityMove, but the current behavior is consistent with how I read the code, so it doesn't suggest to me that something is fundamentally broken. Here's the tail of AI_attackCityMove:
Spoiler :
Code:
   if (AI_offensiveAirlift())
   {
       return;
   }

   if (AI_retreatToCity())
   {
       return;
   }

   // K-Mod
   if (AI_handleStranded())
       return;
   // K-Mod end

   if (AI_safety())
   {
       return;
   }

   getGroup()->pushMission(MISSION_SKIP);
}
After AI_retreatToCity, an AI_anyAttack or AI_stackVsStack call could be inserted. Or perhaps before AI_retreatToCity.
well, like i said, i kept on changing the dll xml, sometimes loaded the same save.
XML changes can obviously break savegame compatibility, but you were probably only experimenting with the range attack tags, which should be ... safe. :) So, dunno.
i play around and see if happens again. i did use a debug, i saw the source errors, they all were from advc code. i added only the ranged strike since 096e. but again, ill play around some more, just wanted to raise it here just in case.
Thanks. I'd need to know at least which assertion it is to do anything about it.
im thinking of letting go of the ranged attack , you have enough to do and i dont have much civ time my self, better use time i have to update according to advc basis and the stuff i had in doto and simple xml stuff.
later on ill try it, hopefully.
I don't think you need my assistance to work on the ranged AI code, but if you don't really have time either, that could be an obstacle. If some AI stack isn't behaving as intended, someone will have to step through the relevant AI code in the debugger. Squinting at the code ... well could also help but will generally take even longer I think.
 
Back
Top Bottom