BETA TEST: History Rewritten 1.22

I'm currently working on solving a design flaw with Apostasy. Basically, once you adopt Apostasy you're unable to change your state religion or have a reformation - i.e., your tenets are stuck that way for the rest of the game. I'll try get a patch for this and other issues out later today or tomorrow.

Got a series of Python errors every time an AI founded and adopted (probably just from adopting, actually) a new religion.

Have fixed, thanks.

After adopting an AI founded religion and reforming to Prosperity and Ceremony, the bonus Commerce for the former was not listed on the Temple tooltip (though it *was* listed on the city's Commerce breakdown), and Stone/Marble were still disabled.

Pretty sure I know what's causing the tooltip issue, will try fixing it later. I forget to re-examine the Stone/Marble issue before issuing the beta, will get on to it.

This one? :D
Spoiler :
Traceback (most recent call last):
File "BugEventManager", line 336, in _handleDefaultEvent
File "CvEventManager", line 1821, in onPlayerChangeStateReligion
File "HR_Religion", line 56, in adoptReligion
File "HR_Religion", line 963, in callReformation
AttributeError: ExpandedBuildingOptions instance has no __call__ method

That's the one, thanks. Same error that Nightstar reported. I've fixed it, will get a patch out to you all soon.

I forgot to put logging on but I found a few issues playing as Arabia. Madrassa requires Madrassa, which makes it impossible to build. It seems School also requires a Madrassa but that might be a related problem.

Edit: ok, this is weird. I checked and I couldn't actually build any library either. I figured you had done away with them for some reason but no, I just wasn't able to build any ever, not sure why.

Ok, found it. In CivilizationInfos, you put the Madrassa as a Library replacement, but then the Madrassa's buildingclass in BuildingInfos is that of the School. I wonder if I can switch this around and still keep playing my current game.

Ah oops. It used to be a Library replacement, but I changed it to School replacement in 1.21. Looks like I made all necessary changes but one. Changing XML often breaks games in progress, but not always. Never know till you try it.

I also can't build an Islamic Mosque - the button on the prophet has no tooltip and no effect is produced upon clicking on it (same for the Zoroastrian grand temple).

That's odd. Did you have enough Temples?

1) "Custom scenario" still crashes for me.

Still mystified by this. Post a crash report though, I'll take another look at it.
 
I was able to keep playing after changing the buildingclass :)

I'm sure I had enough temples - I had 20 cities and a great majority of them had temples. I did some change to the python code to try to make it work, basically ending up with this:
Code:
screen.appendMultiListButton("BottomButtonContainer", gc.getBuildingInfo(iBuilding).getButton(), 0, WidgetTypes.WIDGET_CONSTRUCT, gc.getBuildingInfo(iBuilding).getBuildingClassType(), pCity.getID(), False)
Instead of this (yours):
Code:
screen.appendMultiListButton("BottomButtonContainer", gc.getBuildingInfo(iBuilding).getButton(), 0, WidgetTypes.WIDGET_CONSTRUCT, iBuilding, -1, False)
In CvMainInterface.py - it gives a tooltip to the button while having the prophet selected and it almost work, but it just clears the city's queue instead of doing anything.

I suspected it doesn't work because it fails a canConstruct check in the DLL. I wasn't sure what to do next so I stopped trying :P
 
Randomly test abit and some bugs for you.

1) onBuildingBuilt is pretty screwed.
if BuildingInfo.getReligionType() == pPlayer.getStateReligion():
does not check that the State Religion can be -1.
All the following elif statements for Nazca, Brandenburg etc are all turned off due to this statement.

2) MapScript Tools
Code:
			lx = xrange(x0, x0+3)
			ly = xrange(y0, y0+3)
			if bSide:
				lx.append( x0+3 )
			else:
				ly.append( y0+3 )
xrange cannot append...

3) Hagia Sophia
Already mentioned before. Capture of UB is a screwed effect.
The UB does not count when Building Class is needed for other stuff.
For instance, lighthouse is needed for Great Lighthouse.
Captured lighthouse UB will not allow you to build Great Lighthouse.

4) Advisor Screen
At low resolutions like 1024x768, all the Advisor Screens are truncated. You cannot see everything.

5) Victory Screen
Going to Members is screwed.

6) Insularity Tenet
Will not work due to Apolistic Palace, since it only checks the Capital and assume it is the same for all cities.
Apolistic Palace resolution anger will only affect cities with the religion, which the capital may not be affected.

7) Incapacitate
It doesn't check the victim's ownership.
Which means you may end up stunning your own invisible troops on the loser plot.

8) Great People Bar
self.Y_GREAT_PERSON_BAR += self.H_DEFAULT_BAR - 2
Because of this statement, every time you load a game, the codes are activated and the GP Bar shifts downwards.

9) Incapacitate and Fire
if not pUnit.isNone() or not pUnit.isDead():
Shouldn't it be AND instead

10) Changing Religion via WB will bring up the Tenet page

11) Pollution
All those Pollution Removal Buildings only check when they are built.
When 2 rival cities are nearby, after awhile if a polluted mine becomes under my city culture, it will remain polluted even if I have the respective removal building in the nearby city.

12) Goody Barbarians
Not under water plot check. Screwed for land goodies.

13) setNumRealBuilding
Will not trigger onBuildingBuilt codes.
Thus, all codes using this code and are supposed to have effects onBuildingBuilt are screwed, such as free Temples and Wonders

14) Building Class Count
All those checking BC Count == 1 should be changed to > 0.
Because if I want to create a scenario with multiple copies of World Wonders, I may end up with 2 similar Wonders, which would disable the code.
Similarly, break statements should be removed. Just because a World Wonder is found, does not mean there may not be a 2nd one for scenarios.

15) World Wonders
Most of the XML World Wonders are Team Based, such as Stonehenge will benefit all cities of all team members.
Python World Wonders however, are mostly done as Player only effects. Should consider changing all to team effects.

16) Taj Mahal
Only checks for onGoldenAge and onEndGoldenAge
There should be more checks such as onBuildingBuilt, already in Golden Age.
Else, I don't get a boost if I build TM during GA, but when GA ends, I get a penalty.
Similarly, there should also be checks for vassals spawned during a TM GA, else boost not applied, but penalty will.
Other areas such as razing and wonder change hands blah blah blah.

17) Colonists
Mentioned before, it can be easily screwed, so long as CyInterface().getHeadSelectedUnit() is not Colonist, even though city founded by a Colonist.

18) Capture Research onCityAcquired
Triggered even not by Conquest. Meant to be?
Why should it be so, if I give the city free.

19) onCultureExpansion
Triggered even when a city comes out of disorder.
Culture Level Yield is screwed effect.

20) cannotTrain
if pPlayer.getUnitClassCountPlusMaking(UnitInfo.getUnitClassType()) >= HR_Religion.getMaxReligiousUnit(pPlayer):
This means if Max Limit is 4 =>
When I have 3 of those units, my city can still build a 4th one.
But on the next turn, since getUnitClassCountPlusMaking will now == 4, the city building the 4th one will no longer be able to train it and will be stopped.

21) Great General Bar
What has this gotta do with Anarchy? GG can still spawn during Anarchy
 
Apologies for no patch yet, kept busy with kids, plumbers, and unexpected visitors. Tomorrow hopefully.

I was able to keep playing after changing the buildingclass :)

Good news!

I'm sure I had enough temples - I had 20 cities and a great majority of them had temples. I did some change to the python code to try to make it work, basically ending up with this:
Code:
screen.appendMultiListButton("BottomButtonContainer", gc.getBuildingInfo(iBuilding).getButton(), 0, WidgetTypes.WIDGET_CONSTRUCT, gc.getBuildingInfo(iBuilding).getBuildingClassType(), pCity.getID(), False)
Instead of this (yours):
Code:
screen.appendMultiListButton("BottomButtonContainer", gc.getBuildingInfo(iBuilding).getButton(), 0, WidgetTypes.WIDGET_CONSTRUCT, iBuilding, -1, False)
In CvMainInterface.py - it gives a tooltip to the button while having the prophet selected and it almost work, but it just clears the city's queue instead of doing anything.

I suspected it doesn't work because it fails a canConstruct check in the DLL. I wasn't sure what to do next so I stopped trying :P

Thanks for that fix. I'll investigate further.

You mean the message Windows displays after the crash, right?

Yes. I'm not very familiar with Windows but the error message should contain (or link to?) a lengthy text referring to threads and exceptions and the likes. This is what I need.

Randomly test abit and some bugs for you.

1) onBuildingBuilt is pretty screwed.
if BuildingInfo.getReligionType() == pPlayer.getStateReligion():
does not check that the State Religion can be -1.
All the following elif statements for Nazca, Brandenburg etc are all turned off due to this statement.

Whoops, fixed.

2) MapScript Tools
Code:
			lx = xrange(x0, x0+3)
			ly = xrange(y0, y0+3)
			if bSide:
				lx.append( x0+3 )
			else:
				ly.append( y0+3 )
xrange cannot append...

Heh, I have no idea what's going on in most of that file. That's from a routine I never use in HR, so I'll leave it alone for now.

3) Hagia Sophia
Already mentioned before. Capture of UB is a screwed effect.
The UB does not count when Building Class is needed for other stuff.
For instance, lighthouse is needed for Great Lighthouse.
Captured lighthouse UB will not allow you to build Great Lighthouse.

Aware of that and prepared to put up with it for the time being.

4) Advisor Screen
At low resolutions like 1024x768, all the Advisor Screens are truncated. You cannot see everything.

Decided I can't be bothered trying to fit everything into resolutions that small, nor support scaling for most screens. At least for now. Reasonably safe to assume people are playing with resolutions 1240 x 800 or higher these days, but if there's great demand, I might go back and fix it.

5) Victory Screen
Going to Members is screwed.

Caused by a call to a part of BUG that I removed. Fixed.

6) Insularity Tenet
Will not work due to Apolistic Palace, since it only checks the Capital and assume it is the same for all cities.
Apolistic Palace resolution anger will only affect cities with the religion, which the capital may not be affected.

Ah I meant to address that, but forgot. Thanks for the reminder.

7) Incapacitate
It doesn't check the victim's ownership.
Which means you may end up stunning your own invisible troops on the loser plot.

Didn't consider that. Fixed.

8) Great People Bar
self.Y_GREAT_PERSON_BAR += self.H_DEFAULT_BAR - 2
Because of this statement, every time you load a game, the codes are activated and the GP Bar shifts downwards.

Ah I don't test on low resolutions very often, so I didn't notice that. Fixed.

9) Incapacitate and Fire
if not pUnit.isNone() or not pUnit.isDead():
Shouldn't it be AND instead

Yes. Fixed. Put them in separate statements too, since if pUnit doesn't exist, checking if they're dead will presumably throw an error.

10) Changing Religion via WB will bring up the Tenet page

Noticed that too, fixed.

11) Pollution
All those Pollution Removal Buildings only check when they are built.
When 2 rival cities are nearby, after awhile if a polluted mine becomes under my city culture, it will remain polluted even if I have the respective removal building in the nearby city.

Yeah that's a problem. Will have to think about what to do there.

12) Goody Barbarians
Not under water plot check. Screwed for land goodies.

Oops, indentation mistake. Fixed.

13) setNumRealBuilding
Will not trigger onBuildingBuilt codes.
Thus, all codes using this code and are supposed to have effects onBuildingBuilt are screwed, such as free Temples and Wonders

That explains a few things. I'll just call it manually where needed.

14) Building Class Count
All those checking BC Count == 1 should be changed to > 0.
Because if I want to create a scenario with multiple copies of World Wonders, I may end up with 2 similar Wonders, which would disable the code.
Similarly, break statements should be removed. Just because a World Wonder is found, does not mean there may not be a 2nd one for scenarios.

Not something I expected, but easy enough to fix.

15) World Wonders
Most of the XML World Wonders are Team Based, such as Stonehenge will benefit all cities of all team members.
Python World Wonders however, are mostly done as Player only effects. Should consider changing all to team effects.

I've make a note to review that at some point.

16) Taj Mahal
Only checks for onGoldenAge and onEndGoldenAge
There should be more checks such as onBuildingBuilt, already in Golden Age.
Else, I don't get a boost if I build TM during GA, but when GA ends, I get a penalty.
Similarly, there should also be checks for vassals spawned during a TM GA, else boost not applied, but penalty will.
Other areas such as razing and wonder change hands blah blah blah.

I've added it to onBuildingBuilt. Not bothering with other aspects for now, as its a bonus I'm not particularly fond of. Probably rather replace it than go through the headache of trying to resolve every possible scenario. After 1.22 though.

17) Colonists
Mentioned before, it can be easily screwed, so long as CyInterface().getHeadSelectedUnit() is not Colonist, even though city founded by a Colonist.

On my list to review at some point. As far as I can tell it's only a problem when a human player queues a Colonist's actions, doesn't affect the AI as I've changed the code for that.

18) Capture Research onCityAcquired
Triggered even not by Conquest. Meant to be?
Why should it be so, if I give the city free.

Not all imperialists are conquerors. Rewards expansion of empire by any means.

19) onCultureExpansion
Triggered even when a city comes out of disorder.
Culture Level Yield is screwed effect.

I wondered if something like this was happening. Will have to ponder this one.

20) cannotTrain
if pPlayer.getUnitClassCountPlusMaking(UnitInfo.getUnitClassType()) >= HR_Religion.getMaxReligiousUnit(pPlayer):
This means if Max Limit is 4 =>
When I have 3 of those units, my city can still build a 4th one.
But on the next turn, since getUnitClassCountPlusMaking will now == 4, the city building the 4th one will no longer be able to train it and will be stopped.

Logic of this one is confusing me. Should I be changing the ">=" to just ">" or "=", or should I be using getUnitClassCount() instead?

21) Great General Bar
What has this gotta do with Anarchy? GG can still spawn during Anarchy

Overzealous copy/pasting and desire for symmetry. Will fix.

Thanks for taking the time to look over all this, Platy, really appreciated.
 
2) MapScript Tools
That irritating error pops up every time I start a map lol

4) Low Resolution Screens
Not a choice when playing on laptop where max Resolution is XXXX x 768

7) Incapacitate
Actually, not just your own invisible troops. There may be neutral ones from other players too.
Up to you whether you should just stun victims of the same owner, or any unit belonging to any player at war.
And of course, whether it should ignore invisible units which you can't see, else you may actually stun ghosts...

9) if A and B:
Actually in python, if A is false, it won't bother to check B, so there won't be an error.
But personally, I would separate too.

20) Cannot Train
The solution is to increase the limit by one, or reduce the count by one, if the city itself is training the unit. My old JS Bach Cathedral did something similar with Cathedrals.
 
2) MapScript Tools
That irritating error pops up every time I start a map lol

Weird. Guess I can try comment the offending lines out. Does it give you a traceback, or is considered some sort of syntax error? Mac BTS uses Python 2.3.5 while Windows BTS uses Python 2.4, so that could be why I never see it.

4) Low Resolution Screens
Not a choice when playing on laptop where max Resolution is XXXX x 768

I think the only screen I've set taller than 768 is the Pedia. I'll try set it to scale.

7) Incapacitate
Actually, not just your own invisible troops. There may be neutral ones from other players too.
Up to you whether you should just stun victims of the same owner, or any unit belonging to any player at war.

I set it to check for units belonging to the losing player, Fire too.

9) if A and B:
Actually in python, if A is false, it won't bother to check B, so there won't be an error.
But personally, I would separate too.

Wasn't sure of that, good to know.

20) Cannot Train
The solution is to increase the limit by one, or reduce the count by one, if the city itself is training the unit. My old JS Bach Cathedral did something similar with Cathedrals.

Ah okay, thanks.


Btw, do you know where the production queue popup is generated? The one that appear on the main interface when a city needs new orders. Hoping I can replace a widget there.
 
Didn't bother to test other maps, but you definitely get it on Terra.

Well, my laptop max is 1366 x 768, so the x resolution is pretty screwed for me too :D
But you can ignore me, I am not a player nowadays.

The production popup at the top right?
Doubt controlled by python.
 

Attachments

  • dfdfdf0000.JPG
    dfdfdf0000.JPG
    102.5 KB · Views: 138
Yeah, it's a DLL popup. I remember working on it for FFH.

I can confirm that I have to ESC out of the Pedia because I can't see the buttons at the bottom due to having a 1366*768 resolution too.
 
• Vassals no longer grant happiness to their Masters
maybe it should be good to bring back vassal happiness for civs with Authoritarianism or/and other oppressive civics.
What do you think about happiness bonuses for acquiring culture levels? or what about culture level requirements for some buildings?
 
Natural Wonder Eisriesenwelt does not show up graphically on the map.
 
Didn't bother to test other maps, but you definitely get it on Terra.

Ah that one does call it. I forgot that I replaced the original Terra with the MapScriptTools Terra. I've commented those lines out and the Himalayas still seem to be generated as expected.

Well, my laptop max is 1366 x 768, so the x resolution is pretty screwed for me too :D
But you can ignore me, I am not a player nowadays.

Same for me with the Civilopedia. I have a rather big resolution (don't remember the exact numbers).

I can confirm that I have to ESC out of the Pedia because I can't see the buttons at the bottom due to having a 1366*768 resolution too.

I've changed the height of the pedia from 854 to 768. Everything scaled down fine and looks good so I'll leave it that way. With all the recent layout changes I've made, the extra vertical space isn't needed anymore.

The production popup at the top right?
Doubt controlled by python.

Yeah, it's a DLL popup. I remember working on it for FFH.

Suspected as much. Tooltips there will just have to show Prophet GPP instead of Faith.

Nazca Lines is not producing GP for me, Not much else to say it just doesnt

There are a number of building/wonder that aren't being applied. Platy spotted the problem, will be fixed in the forthcoming patch.

maybe it should be good to bring back vassal happiness for civs with Authoritarianism or/and other oppressive civics.

It's not something that can be switched off in some circumstances and on in others.

What do you think about happiness bonuses for acquiring culture levels? or what about culture level requirements for some buildings?

There are already plenty of sources of happiness available, but culture level requirements is definitely an interesting idea. I'll need to solve the problem Platy pointed out (Creative and Industrial trait bonuses) first though.

Natural Wonder Eisriesenwelt does not show up graphically on the map.

It's designed to be placed on a Peak and will be underground if placed on any other terrain. Can't be seen if there's a second Peak in front of the one you place it on though.
 
There are already plenty of sources of happiness available
It could be a reason to rebalance happiness at all. Or, for example, create a culture level requirement for getting happiness from some luxury resources, such as dye, ivory, amber, and higher culture level requirement for getting happiness from stone and marble.
 
It could be a reason to rebalance happiness at all. Or, for example, create a culture level requirement for getting happiness from some luxury resources, such as dye, ivory, amber, and higher culture level requirement for getting happiness from stone and marble.

My original plan, way back when I added the new resources and resource-using buildings, was for the resources themselves to not provide happiness and health, and happiness and health from them to come only from the buildings. Unfortunately, the AI couldn't cope with that at all, and this places a significant restriction on what I can do in terms of rebalancing happiness.

So in this case, it should be possible to make the buildings that use resources require a certain culture level, but not not the resources themselves. I'd have to think about the implications of that, but it's not something I'll be looking at for 1.22.
 
Planned to get this patch out several days ago, but kept finding new things to fix! Download and unzip the attachment. Inside the resulting folder are a Python folder and an XML folder. Delete the existing ones found in /History Rewritten/Assets/ and replace them with the ones from the patch.


Changes

• Arabia: fixed issue preventing construction of Libraries or Madrassas
• Creative Trait: fixed several issues with Culture Level bonus
• Financial Trait: Corporation specialist bonus changed to Corporation Golden Age bonus
• Industrious Trait: fixed several issues with Culture Level bonus
• Fixed an error when the AI triggers a reformation
• First player to switch to no state religion no longer gets a free reformation
• Apostasy now requires Scientific Method
• Great Prophet can now be used to Repent Apostasy
• Great Prophets can now construct Great Temples correctly
• Fixed several building/wonder effects not applying after construction
• Fixed an error with the Terra mapscript
• Fixed quote display on Tech Splash screen
• Fixed error on Members page of Victory Advisor
• Further pedia improvements and tweaks, no longer as tall
• Many other fixes and tweaks​


Issues Remaining

• Art files still unpacked, expect long loading times
• Repentance button is missing (because adding art files to a patch is a pain)
• Some tooltips still display Prophet GPP instead of Faith (build options, add Priest button)
• May still be some problems accessing Stone/Marble when switching away from Idolatry
• Mapsize scaling of Missionary/Inquistors is still a bit flaky​
 
Dont know if is alredy reported.

-In custom game. Fast start: There is no buton for ADD TECH in Tech page.

-Cant get acess to Paved road desc. in Civilopedia.

-Again Nazca Lines dont give GP.

+How about dam idea that Barbarian states unite into land? Its stupid idea but i mentione it.

+Some pictures are still small compare to others.

+Dit anyone notice that in fast start AI use theirs point in pretty stupid way?. Try autobuild oder.
 
No changes to leaders or capital locations, right?

No, that's all for 1.22. Planning to add more leaders and maybe even a civ or two in 1.23.

-In custom game. Fast start: There is no buton for ADD TECH in Tech page.

I must have broken that when I changed the Tech Chooser. Will investigate.

-Cant get acess to Paved road desc. in Civilopedia.

None of the Routes have pedia entries yet. I'll add them eventually, probably not in 1.22 though.

-Again Nazca Lines dont give GP.

Hmm, I had that working, guess I broke it again subsequently. Will investigate.

+How about dam idea that Barbarian states unite into land? Its stupid idea but i mentione it.

I'd like to do more with Barbarians, just not sure what's possible yet. On my wishlist.

+Some pictures are still small compare to others.

Yeah, there's a few such icons in the pedia. Been too busy with everything else to find or create better sized versions.

+Dit anyone notice that in fast start AI use theirs point in pretty stupid way?. Try autobuild oder.

I have no idea if that's possible. I've never really looked into the Advanced Start mechanics before.
 
Back
Top Bottom