Technical documentation

I think that it would be pretty fun to play the Zengids atleast; I can think of atleat 2 UHVS that can work
 
What is the purpose of the "barb regions" in the DLL?

Those are provinces where players can't have cultural borders beyond level 2 (or 3, don't remember). This prevents exploits such as building cities in/near Thrace or Georgia to stop barbarians from spawning there.
 
Thanks :)

What is the difference between Normal and Broader regions? I noticed there actually grouped together in the game, ie in the region tooltip, you always see Broader, whether it's actually Normal or Broader.

So far I only gathered that Normal regions give +5 for AIWars and Broader only +2. Then the major difference occurs in the case of respawn, since Normal regions can be flipped.

Any other difference I missed?
 
Edead, thanks for this great guide, it was really helpful in importing some SoI features into my mod. My question is this: Do you have/ can you make a list of the all the areas in the code involved in making the kill the infidels option and in making the religious persecutor?
 
What is the difference between Normal and Broader regions? I noticed there actually grouped together in the game, ie in the region tooltip, you always see Broader, whether it's actually Normal or Broader.

So far I only gathered that Normal regions give +5 for AIWars and Broader only +2. Then the major difference occurs in the case of respawn, since Normal regions can be flipped.

Any other difference I missed?

It's RFC-compatibility/leftover really. From human player's POV there's pretty much no difference, that's why I streamlined Rhye's three zones into two. Apart from what you noted, there's also spawn plot search mechanic, i.e. if a civ can't spawn in its core, it will try to flip/spawn in normal area, then if that fails, a settler should spawn in free broader area (doesn't really happen in SoI). There are also tiny differences in stability mechanics, but nothing that should concern a player. Stuff like, city in Broader area is more likely to go indep than in Normal etc.

Edead, thanks for this great guide, it was really helpful in importing some SoI features into my mod. My question is this: Do you have/ can you make a list of the all the areas in the code involved in making the kill the infidels option and in making the religious persecutor?

I'll try to in 1-2 days when I get more time (the two are spread over a dozen files)
 
Okay, thanks. I think I'll try my hands at changing this stuff, if only to understand its intricacies.
 
Something else!

In WorldBuilder, in the Terrains tab, I can select Salt Lakes and place them even though they're graphicalOnly in the XML. In my mod, they don't appear in WorldBuilder and it actually causes significant problems since they aren't skipped; the next entry in the XML is Coast, so in WB, Coast actually places Salt Lakes!

Did you do something to fix that?

EDIT: Tsk! Nevermind, I found your edited bit in the DLL, in CvGameTextMgr.cpp :)
 
How hard would it be to set everything up for a second scenario, like the 600 AD one in RFC?
 
Edead, do you know when you might get around to that request I made earlier?
 
Edead, thanks for this great guide, it was really helpful in importing some SoI features into my mod. My question is this: Do you have/ can you make a list of the all the areas in the code involved in making the kill the infidels option and in making the religious persecutor?

The decision to massacre or not is done in the DLL (popup for the player, dice roll for the AI) and passed with onCityAcquiredAndKept to Python, where you can code whatever effects you want.

DLL:
Right-click on CvGameCoreDLL folder, select Search... and type "massacre".
This will list all files involved in massacre the disbelievers part. Search for the same keyword inside files to find the particular snippets.

massacreProb array in CvRhyes.cpp is % chance that the AI will massacre the disbelievers when able.

Python:
1. onCityAcquiredAndKept in CvRFCEventHandler.py - extend the argsList (new var: bMassacre); this also includes call to Religions.py, and you can ignore the iVictims variable as it's for Timurid UP
2. onCityAcquiredAndKept in CvEventManager.py and any other files that use this event handler - just extend the argsList
3. onCityAcquiredAndKept in Religions.py has the actual massacre code; note that it has a lot of SoI-specific stuff, e.g. piety, religions and civs, so you'll have to remove or modify some parts
4. If you reuse the part with persecution order, remember to add it to Consts.py (tPersecutionOrder = order of most hated religions, for each religion)

Religious persecutor - later.
 
How hard would it be to set everything up for a second scenario, like the 600 AD one in RFC?

Use Rhye's code, i.e. (re)merge all code the that checks whether Egypt is playable both in C++ & python. There's some trickery involved, like separate arrays for early and late starts, but you'll see it all in those snippets.
 
Edead, there's an area in the DLL that makes bMassacre false for Orthodox/ Catholics. How come, then, it's repeated in Religions.py?

Code:
for iReligion in lReligions:
				if city.isHasReligion(iReligion) and iReligion != pOwner.getStateReligion() and not city.isHolyCityByType(iReligion):
					if iReligion == con.iCatholicism and pOwner.getStateReligion() == con.iOrthodoxy: 
						continue
					if iReligion == con.iOrthodoxy and pOwner.getStateReligion() == con.iCatholicism: 
						continue

What's the point of the lines above, in other words?
 
What's the point of the lines above, in other words?

The DLL part is responsible for the popup, so there will be no popup if you're Orthodox and the city only has Orthodoxy and/or Catholicism.

But if it has other religions as well, once you make the decision to massacre, the Python part does the actual killing, and the above lines just make sure that if you're Orthodox and the city has, say, Sunnis + Jews + Catholics, only Sunnis & Jews will be killed.
 
Oh cool, thanks!

Will a search for the word purge work for finding all the inquisitor stuff?
 
Oh cool, thanks!

Will a search for the word purge work for finding all the inquisitor stuff?

I'm not even using the word purge, instead, the persecutor is called either persecutor, prosecutor or inquisitor, since persecution mechanics are a mix of my own code with that from Charlemagne scenario and RFCE. It's probably the most messy code in SoI, I mean, it works great but I'm kind of sorry for the mess :p

CvCustomEventManager.py
- import Religions
- self.rel = Religions.Religions() in __init__
- all the stuff with number 7626 in it

Religions.py
- eventApply7626

StoredData.py
- lPersecutionData, lPersecutionReligions, getPersecutionData, setPersecutionData, getPersecutionReligions, setPersecutionReligions

RFCUtils.py
- showPersecutionPopup, doPersecution

CvMainInterface.py
- parts that start with "edead: start Charlemagne inquisitor code" and "edead: Inquisitor button"
- make sure you import RFCUtils/utils and StoredData/sd

Consts.py
- tReligiousTolerance, tPersecutionOrder, iInquisitor, religion consts

CvGameUtils.py
- AI_unitUpdate, doInquisitorCore_AI, doInquisitorMove

CvCityAI.cpp::AI_chooseUnit
- the code by 3Miro & myself

CvRhyes.h
- all RELIGION_* enums, UNIT_PROSECUTOR, UNIT_PROSECUTOR_CLASS (consistency ftw), buildProsecutorProb array

CvDllTranslator.cpp
- all Religion icons

CvUnitAI::AI_update
- persecutor code by myself + comment block by Sephi; note that the whole python callback is basically disabled for game speed, unless the unit is a persecutor; it's important if your mod uses AI_unitUpdate callback (it shouldn't, it should be done in C++ but, the hack works fine and at this point I don't feel like moving it all to C++ just so the code it neat)

It's really a perfect example of how NOT to code new features, but my excuse is that parts of it were added successively in a timespan of more than a year, and well, it works :D
 
Top Bottom