C2C SVN Changelog

Yeah! on #1. Was hoping that would get sorted out.

JosEPh :)

Edit: Oh Shoot! SO's gonna be *issed cause I posted in this thread again! :mischief:
 
Yeah! on #1. Was hoping that would get sorted out.

JosEPh :)

Edit: Oh Shoot! SO's gonna be *issed cause I posted in this thread again! :mischief:

How can a person get :mad: at you when you only intend to help others out, isn't that all that really matters;) But next time, "BUDDY"
 
Updates
- Changed it so Cities can found on Sword Grass. (Just did not seemed right that you could found on trees but not grass).

C2CTerrain_CIV4FeatureInfos.xml in NewTerrains folder should be changed since new features are defined in it also.
Yes, it's confusing and unnecessary to have two files which function exactly same. They should be merged. :p

EDIT: And updated SVN.
 
Just pushed to SVN, fairly major piece of work, plus a few miscellaneous bug fixes for the recent CTDs reported.

The major thing is that I have added a key sequence (ctrl-shift-R) which will force recalculate ALL modifiers and bonuses based on current assets.

The reason this is (and has been for some time) needed (for modders and SVN users especially) is that in regard to most modifiers (from various sources such as civic, building, trait, etc.) the game only maintains aggregate totals as they apply to various entities (players, teams, cities, areas, plot groups), and dead reckons them by just adding changes to the totals as they occur. What this means is that if assets change between getting something that applies a modifier and losing it again, the amount subtracted when you lose it won't match the amount that was originally added when you first got it, and thus the totals will gradually get more and more distorted (for example, switching into one definition of a civic, and then switching out later when it has a slightly different definition). It also means that any bugs which cause spurious changes to these aggregate values never get corrected.

In the latest build however, if you press ctrl-shift-R and go make a cup of coffee (this is NOT a fast operation - takes about 4 minutes in my late industrial giant map game - which is why it can never be done automatically as part of load), it will recalculate all the aggregates from first principles. It takes account of:
  • Civics
  • Buildings
  • Projects
  • Specialists
  • Worked tiles
  • Trade
  • Leader and Civ traits
  • Events that are purely defined by their XML
It does NOT (and cannot since the game never records what they did) take account of changes made directly by Python calls as a result of some trigger (like an event that relies on Python to do its dirty work). Any changes due to such events will be lost (but I don't think there are any currently).

Internally, this has been a fairly massive change, and I've been debugging it for about 3 days, so take that as a health warning. I have probably missed some contributions, so if you suspect an error post the save game of the before-recalc state together with as much detail as you can of what you think it got wrong. Note that it's actually quite hard to figure out if it got it right or not for any game in which the assets have changed, since quite large changes can actually be entirely correct - I actually spent several hours today trying to pin down why my building gold had dropped so much, but in the end it turned out to be correct - it was just that the save I had had huge distortions built up since I started it (on V15!) which made the difference between solvency and -1700 gold per turn insolvency!
 
Great work as always.:goodjob:

I do have a concern about -
It does NOT (and cannot since the game never records what they did) take account of changes made directly by Python calls as a result of some trigger (like an event that relies on Python to do its dirty work). Any changes due to such events will be lost (but I don't think there are any currently).

The CTD/bug to do with strategic resources and guilds and corporations was solved by having the herd buildings invoke a bit of python that give the resource to the city. IE when the Herd - Horse is built a bit of python using onBuildingBuilt adds the horse resource to the city.

Are we losing this resource now? There are eleven buildings involved here, three are not a herd building. See assets/python/DancingHoskuld/BuildingBonuses.py if you want details.
 
Great work as always.:goodjob:

I do have a concern about -


The CTD/bug to do with strategic resources and guilds and corporations was solved by having the herd buildings invoke a bit of python that give the resource to the city. IE when the Herd - Horse is built a bit of python using onBuildingBuilt adds the horse resource to the city.

Are we losing this resource now? There are eleven buildings involved here, three are not a herd building. See assets/python/DancingHoskuld/BuildingBonuses.py if you want details.

I'll check. To clarify, you're saying that the herd horse building does not provide a free bonus in it's XML? Is that the same with all herds? If so why? I'm sure I can special case it somehow if need be, but I'd like to understand how it works and why better before I decide the best course of action (assming there is a problem, which I'll check)
 
I'll check. To clarify, you're saying that the herd horse building does not provide a free bonus in it's XML? Is that the same with all herds? If so why? I'm sure I can special case it somehow if need be, but I'd like to understand how it works and why better before I decide the best course of action (assming there is a problem, which I'll check)

The herd and other buildings were originally giving a FREE_BONUS. In the horse_herd's case it was the BONUS_HORSE. However this was causing three distinct problems.

1) Infinite loop or CTD
2) Not able to spread a Guild or Corporation that consumes the FREE_BONUS to the city that had the FREE_BONUS building
3) Not able to build the building in a city that had a Guild or Corporation that consumed the FREE_BONUS

The work around suggested was to use the onBuildingBuilt event in Python to assign the bonus to the city.

Not all herd buildings provide a resource because we have reached the limit in resources so have used gods or other mechanisms.

Two of the buildings, seal and walrus hunter's camp, provide resources fur and ivory respecitvely. The Aluminium Co building that should provide aluminium from RoM days wasn't. This method lets it do so.
 
Just pushed to SVN, fairly major piece of work, plus a few miscellaneous bug fixes for the recent CTDs reported.

The major thing is that I have added a key sequence (ctrl-shift-R) which will force recalculate ALL modifiers and bonuses based on current assets.

...skip-skip....
Does that recalculate things for AIs too or only for player?
 
Two of the buildings, seal and walrus hunter's camp, provide resources fur and ivory respecitvely. The Aluminium Co building that should provide aluminium from RoM days wasn't. This method lets it do so.

The seal and walrus camps should not give ivory or fur since the seal camp already activates the Furrier and the Walrus Camp the Bone Worker's Camp. Don't want to have the ability to give Elephant from the Walrus.
 
The seal and walrus camps should not give ivory or fur since the seal camp already activates the Furrier and the Walrus Camp the Bone Worker's Camp. Don't want to have the ability to give Elephant from the Walrus.

I asked you and you said yes, so I did. It can easily be removed if you want. It is only two lines in the code.
 
I asked you and you said yes, so I did. It can easily be removed if you want. It is only two lines in the code.

I know. Sorry for flip flopping. I think its just better to represent ivory and fur as "goods" with multiple resources sources (ex. Elephant or Walrus or Mammoth can contribute to Good (Ivory) even non-specific resources like Narwhal (walrus + whale) can too.

In short please make sure the resources like walrus and seal only provide themselves and not ivory or fur. Same goes for rabbits or mammoths if they provide it as well.
 
there are a few random events that add or substract :) both temporary and not based on python, also things like power/clean power are given through python events and there are bound to be others - not that its terribly important though - if an event result gets lost, so be it.
 
there are a few random events that add or substract :) both temporary and not based on python, also things like power/clean power are given through python events and there are bound to be others - not that its terribly important though - if an event result gets lost, so be it.

If the event provides them via its XML it'll be fine. If only via bespoke Python it'll likely get lost. As we come across cases I'll make changes to address them ( se below).
The herd and other buildings were originally giving a FREE_BONUS. In the horse_herd's case it was the BONUS_HORSE. However this was causing three distinct problems.

1) Infinite loop or CTD
2) Not able to spread a Guild or Corporation that consumes the FREE_BONUS to the city that had the FREE_BONUS building
3) Not able to build the building in a city that had a Guild or Corporation that consumed the FREE_BONUS

The work around suggested was to use the onBuildingBuilt event in Python to assign the bonus to the city.

Not all herd buildings provide a resource because we have reached the limit in resources so have used gods or other mechanisms.

Two of the buildings, seal and walrus hunter's camp, provide resources fur and ivory respecitvely. The Aluminium Co building that should provide aluminium from RoM days wasn't. This method lets it do so.

There is a generic solution, but it needs code for each modifier it applies to (which is to accrue the Python-provided amounts in a separate total and not clear THAT one on recalc). I'll do this for the free bonuses to address DH's issue (it won't rescuse them in existing game cases, but it will rescue them for any newly provided-via-Python values from the point of fix onwards).

If people authroing events etc. can point out important cases I'll add ther necessary code for those modifiers also (eventually we'll get them all done but important ones first)

Does that recalculate things for AIs too or only for player?

Yes
 
If the event provides them via its XML it'll be fine. If only via bespoke Python it'll likely get lost. As we come across cases I'll make changes to address them ( se below).


There is a generic solution, but it needs code for each modifier it applies to (which is to accrue the Python-provided amounts in a separate total and not clear THAT one on recalc). I'll do this for the free bonuses to address DH's issue (it won't rescuse them in existing game cases, but it will rescue them for any newly provided-via-Python values from the point of fix onwards).

If people authroing events etc. can point out important cases I'll add ther necessary code for those modifiers also (eventually we'll get them all done but important ones first)



Yes

The following events that are already present in game use python to set things (some more set hasreligion and add/remove population or buildings - but I guess that is not affected:

doWeddingFeud2 -> temporary happiness in city based on religion in city
doGreatBeast3 > same
doIndependentFilms -> add bonus movies to city
applyClassicLiteratureDone3 -> add science specialist to great library
applySecretKnowledge2 -> add commerce type culture to triggering building
applyCorporateExpansionDone1 -> add commerce type gold to triggering building
applyHostileTakeoverDone1 -> same
doSyntheticFuels4 -> add bonus diesel to city
TriggerHarryPotter2 -> set hurry anger in city
TriggerUnlimitedPower1 -> set power in city
TriggerUnlimitedPower2 -> set clean power in city
TriggerSuperVirus2 -> set eventanger (not sure what that does...)
TriggerSuperVirus3 -> add great scientist specialist to city
TriggerSuperVirus4 -> add great general specialist to city
 
The following events that are already present in game use python to set things (some more set hasreligion and add/remove population or buildings - but I guess that is not affected:

doWeddingFeud2 -> temporary happiness in city based on religion in city
doGreatBeast3 > same
doIndependentFilms -> add bonus movies to city
applyClassicLiteratureDone3 -> add science specialist to great library
applySecretKnowledge2 -> add commerce type culture to triggering building
applyCorporateExpansionDone1 -> add commerce type gold to triggering building
applyHostileTakeoverDone1 -> same
doSyntheticFuels4 -> add bonus diesel to city
TriggerHarryPotter2 -> set hurry anger in city
TriggerUnlimitedPower1 -> set power in city
TriggerUnlimitedPower2 -> set clean power in city
TriggerSuperVirus2 -> set eventanger (not sure what that does...)
TriggerSuperVirus3 -> add great scientist specialist to city
TriggerSuperVirus4 -> add great general specialist to city

ok, I'll work through those cases and make sure they are handled
 
Back
Top Bottom