Feedback: Civics

I hate to double-post, but has there been any progress on tracking down either of these issues? My current game is on hold until the Progressive cottage growth problem in particular can be addressed.
 
I hate to double-post, but has there been any progress on tracking down either of these issues? My current game is on hold until the Progressive cottage growth problem in particular can be addressed.

Cottage growth problem is an easy fix, I accidentally assigned it to Traditional instead. Still trying to track down the Paganism issue. I'll work on it a bit more and update you later tonight.
 
Attached a fix for Progressive's Cottage growth bonus. Replace the file of the same name at /History Rewritten/Assets/Python/HR.py. It shouldn't break saved game compatibility.

I haven't got a solution for the Paganism bug yet. It's quite puzzling as you can see the total food by the progress bar and the total food in the yield breakdown display (same panel as trade route income) are not in sync. Unfortunately this means that if you switch away from Paganism or switch to no state religion you're likely to lose another food from each city.

At some point in your game the extra food wasn't added when it should have been, or an extra one was removed when it shouldn't have been, and from that point its been out of sync. To solve it I need to find out when that point was, but unfortunately I haven't been able to reproduce the situation in a new game yet.
 

Attachments

Sure enough, when I switched to Orthodoxy, all the cities with my state religion lost one food, even though they *weren't* getting the +1 for Paganism.

Abandoned that game to start a new one, and it's happening again!

Saved game is attached below. Note that Edo (the holy city) *is* getting the extra food for Paganism, but Kyoto isn't, nor is Kagoshima (where the the state religion of Shinto just spread naturally this turn). The other cities have Buddhism instead of Shinto, so they're unaffected.
 
Sure enough, when I switched to Orthodoxy, all the cities with my state religion lost one food, even though they *weren't* getting the +1 for Paganism.

Abandoned that game to start a new one, and it's happening again!

Saved game is attached below. Note that Edo (the holy city) *is* getting the extra food for Paganism, but Kyoto isn't, nor is Kagoshima (where the the state religion of Shinto just spread naturally this turn). The other cities have Buddhism instead of Shinto, so they're unaffected.

Do you have any saved games from just before the food was lost? Had you been changing civics or state religion around that point?

EDIT: Nevermind, I have an idea what what be happening. Testing.
 
Ok, I think I've solved it. Try the attached fix, it replaces the file at /History Rewritten/Assets/Python/CvEventManager.py. While it won't break a game in progress, it won't correct the missing food - just prevent it happening again (hopefully).
 

Attachments

Should some Civics have a synergy component to them? For example, if you adopt Fascism but also have Free Speech would their be a negative attribute associated with the conflicting ideals? If Fascism is adopted with Propoganda, should their be a positive attribute assigned for agreeing Civic's?
 
Ok, I think I've solved it. Try the attached fix, it replaces the file at /History Rewritten/Assets/Python/CvEventManager.py. While it won't break a game in progress, it won't correct the missing food - just prevent it happening again (hopefully).

That seems to have done the trick, thanks. What, exactly, was the problem?
 
Should some Civics have a synergy component to them? For example, if you adopt Fascism but also have Free Speech would their be a negative attribute associated with the conflicting ideals? If Fascism is adopted with Propoganda, should their be a positive attribute assigned for agreeing Civic's?

I prefer any synergy to come from the combination of existing bonuses, rather than adding additional encouragement or discouragement. The AI wouldn't be able to understand such extras anyway.

That seems to have done the trick, thanks. What, exactly, was the problem?

I thought the code that checks for civics changing would account for state religion spreading to (or being removed from) new cities under Paganism, but my logic was faulty. I had to add some code to deal with it explicitly.
 
I really don't think civics that are defunct IRL should get bonuses that justify holding onto them in late game. Actually, I'd suggest the having certain technologies actually improve or nerf civics (i.e. industrial mechanization would make equal rights more feasible, printing press would affect the religious civics, authoritarianism would become more costly after the internet is invented, etc) but I'm not sure if the AI would know how to work with that,
 
I really don't think civics that are defunct IRL should get bonuses that justify holding onto them in late game. Actually, I'd suggest the having certain technologies actually improve or nerf civics (i.e. industrial mechanization would make equal rights more feasible, printing press would affect the religious civics, authoritarianism would become more costly after the internet is invented, etc) but I'm not sure if the AI would know how to work with that,

I cannot alter civics via techs or similar means, at least not in a way the AI could cope with. I also don't feel it's necessary or desirable. Most civics are already tailored somewhat to suit the era they're unlocked in and while some will retain usefulness long past it I think this is reasonable. There are countless points in history where the world could have turned out very differently and we'd have a different array of civics dominating world politics, for better or worse. Messing with this is too deterministic for my liking and reduces strategic options.
 
I think I just encountered a problem with the Clan Warfare civic. In my current game I joined the Mongols in their war against the Tibetans (who were running Clan Warfare). Since the two of them were both on a separate continent with each other, I never actually engaged in any combat and just left the Mongols (who had already eaten India on the same continent) to deal with them. They had no problem doing just that and wiping them out, but the anger penalty for being at war with a civ running Clan Warfare remained even after Tibet ceased to exist!
 
I think I just encountered a problem with the Clan Warfare civic. In my current game I joined the Mongols in their war against the Tibetans (who were running Clan Warfare). Since the two of them were both on a separate continent with each other, I never actually engaged in any combat and just left the Mongols (who had already eaten India on the same continent) to deal with them. They had no problem doing just that and wiping them out, but the anger penalty for being at war with a civ running Clan Warfare remained even after Tibet ceased to exist!

Ah I neglected to account for players being defeated while running Clan Warfare. Will work on a fix.
 
Any progress on this?

No, I haven't tackled it yet.

As a general heads up, our second child was born earlier this week so sleep has been quite hard to come by. I'm still working on 1.20 when I get the chance but I'm deliberately sticking to the more straight forward tasks for a while, trying to do any coding at the moment would likely lead to more errors than it would solve!
 
Where I spread my corporation, I got 2:yuck:2:mad: fine, then when I change my civic from centralization to free market, the penalty become 4:yuck:4:mad:! Where I spread the same corporation to new cities, the penalty is still 2:yuck:2:mad:. Now different cities have different penalties. It is certainly a bug

you can try the save file, change civic to free market check Gdansk's health and happiness penalty. Remember the change will not be applied this turn, click next turn and you will see the effect)
 

Attachments

Ignore corporation civics for now, too many things to fix.
A) Num of Foreign Corps calculation error

B) No codes onCityAcquired to account for
1) HQ(s) change hands resulting in foreign corp status
2) New benefits/penalty based on new owner's civics

C) No codes onCityRazed to account for razing of HQ(s)

Will rewrite corporation codes if I am free tomorrow
 
No, I haven't tackled it yet.

As a general heads up, our second child was born earlier this week so sleep has been quite hard to come by. I'm still working on 1.20 when I get the chance but I'm deliberately sticking to the more straight forward tasks for a while, trying to do any coding at the moment would likely lead to more errors than it would solve!

I can tell you why.
The reason is that codes for this civic is only done onchangewarstatus, which is only triggered when war or peace is declared.
However, when the rival is completely wiped off, peace is not declared, and thus codes are not triggered and the penalty remains.

The simple solution is to add codes oncityacquired, such that if previous owner no longer has cities left, treat him as dead and remove penalty.

The more complex but complete solution is to take into account the game option complete kills and not just check that he has no cities, but also no units.
At the same time, codes must be added to onunitlost to treat him as dead when last unit gone, when complete kills enabled.

However, onunitlost requires python callback enabled, so it is better to simply redesign the effect or disable complete kills
 
Where I spread my corporation, I got 2:yuck:2:mad: fine, then when I change my civic from centralization to free market, the penalty become 4:yuck:4:mad:! Where I spread the same corporation to new cities, the penalty is still 2:yuck:2:mad:. Now different cities have different penalties. It is certainly a bug

you can try the save file, change civic to free market check Gdansk's health and happiness penalty. Remember the change will not be applied this turn, click next turn and you will see the effect)

Yeah I screwed up the code for foreign corporations, meaning the Centralization civic will give some silly results.

Ignore corporation civics for now, too many things to fix.
A) Num of Foreign Corps calculation error

B) No codes onCityAcquired to account for
1) HQ(s) change hands resulting in foreign corp status
2) New benefits/penalty based on new owner's civics

C) No codes onCityRazed to account for razing of HQ(s)

I think the reason I neglected to add any checks to onCityAcquired is I assumed the extra happiness/health wouldn't be cleared when a city changed hands.

I didn't consider HQs being conquered.

Will rewrite corporation codes if I am free tomorrow

That would be fantastic, thank you. Hope they make sense, it was the first time I ever attempted anything that complex in Python.

I can tell you why.
The reason is that codes for this civic is only done onchangewarstatus, which is only triggered when war or peace is declared.
However, when the rival is completely wiped off, peace is not declared, and thus codes are not triggered and the penalty remains.

The simple solution is to add codes oncityacquired, such that if previous owner no longer has cities left, treat him as dead and remove penalty.

The more complex but complete solution is to take into account the game option complete kills and not just check that he has no cities, but also no units.
At the same time, codes must be added to onunitlost to treat him as dead when last unit gone, when complete kills enabled.

However, onunitlost requires python callback enabled, so it is better to simply redesign the effect or disable complete kills

I think it will be fine for this civic to consider a player defeated once they have no more cities. The only catch would be if they have a surviving settler or manage to conquer a city with surviving units but I guess we could check for that. Requiring Complete kills is off by default I think?
 
Good news is Corps Civics is 90% fixed.
Bad news is there is still a logic error when switching from No Foreign Civic directly to another that affects corps, such as Environment or +2 Commerce one.

This one is hard to tackle lol
 
Back
Top Bottom