Feature Requests and Discussion

I'm pretty sure the religionweights get applied as a percentage to the number of cities with that religion present in your empire when AIs evaluate which state religion to choose. so -100 means even if all of them have it, to an AI it still "looks" like that religion is not present in the empire, therefore they will never adopt it. MC could probably explain this better though :)


Improvements to the AI religion choosing would be the next big step for MNAI in my opinion. Wildmana did a pretty good job of teaching them the importance of religious heroes, so leaders without strong flavour values would act "opportunistic" and convert to religions with heroes still available. current MNAI behaviour seems close to vanilla FFH, with the early religions generally dominating ( it's especially visible on huge maps with lots of civs, RoK is usually the most popular due to the usefulness of mining tech )
 
There are 3 places where the ReligionWeightModifier is used in the code.

1) Under CvPlayer::canDoReligion, an AI civ is simply flat-out barred from adopting a religion when they have a ReligionWeightModifier of -100 or less (I think I'll comment this out for my next release - Agnostic is already taken care of in the lines above this)

2) In CvPlayerAI::AI_techValue, the ReligionValue is modified by ReligionWeightModifier, so an AI with a -100 ReligionWeightModifier will zero out any religious value that might be assigned to that tech

3) In CvPlayerAI::AI_religionValue, the overall value for the religion is also modified by ReligionWeightModifier, but at the very end of the function so a -100 weight will always give that religion a value of 0
 
Excellent! Couple of issues I noticed.

Attachment 1 - some of the widgets are overly large. Looks like they're taking up two rows instead of one

Attachment 2 - A lot of the button text has these boxes at the end

The widget size seems to automatically change in order to fill the full column. I'm not really sure what I can do about it, without adding new widgets or making the columns shorter and moving some things around.

(Adding the line self.m_tabCtrlEdit.addSectionLabel("", 0) seems to be able to push the following parts of a data screen onto the next column, but it does nothing for resizing the widgets.)

Edit: What do you think of the attached layout?


The button texts all look fine on my machine. I have no idea what is going on there.

Hmmm. I'll see what I can do there. I think the religionWeights are mainly just used for flavor. If so, I'll consider just disabling them for higher difficulties, though that will also require some improvements to the AI religion-choosing code.

I would rather you not do this, as I suspect it would mess up my modmod. I do not use the Agnostic Trait, but I use a lot of ReligionWeightModifiers of -100 to block leaders from adopting certain religions. All leaders have <ReligionWeightModifier>-100 towards The Cult of the Dragon and The Children of the One. Auric has <ReligionWeightModifier>-100 towards every religion except The White Hand. Cassiel still cannot adopt any religion, but I removed the trait so that it does not hinder the spread of Children of the One.


However, this concern won't really matter any more once you implement Feature Request #121: Add a python callback for canDoReligion().


[to_xp]Gekko;12669657 said:
I'm pretty sure the religionweights get applied as a percentage to the number of cities with that religion present in your empire when AIs evaluate which state religion to choose. so -100 means even if all of them have it, to an AI it still "looks" like that religion is not present in the empire, therefore they will never adopt it. MC could probably explain this better though :)


Improvements to the AI religion choosing would be the next big step for MNAI in my opinion. Wildmana did a pretty good job of teaching them the importance of religious heroes, so leaders without strong flavour values would act "opportunistic" and convert to religions with heroes still available. current MNAI behaviour seems close to vanilla FFH, with the early religions generally dominating ( it's especially visible on huge maps with lots of civs, RoK is usually the most popular due to the usefulness of mining tech )

I believe that the percentage which the ReligionWeightModifiers modify technially apply to the human players as well as the AI. A ReligionWeightModifier of -100 toward a religion is supposed to make it impossible for even a human player to adopt said religion. I believe that Kael once said a ReligionWeightModifiers of -99 should still prevent an AI from ever adopting the religion, but not prevent a human from doing so.

I'm not sure if it is still the case, but I recall a while back having some issues related to how BtS lets players adopt religions not present in your cities if they are present in a teammate's cities. I'm thinking that ReligionWeightModifiers were preventing a player from "seeing" the religion in his own cities, and but not stopping him from adopting it based on its ally's cities.


Edit: When I decide to actually look through the MNAI dll source code, I got a rather different impression.


It appears that the only part that matters to a human player is this, which just blocks the religion if the ReligionWeightModifier is -100 (or less).


Code:
bool CvPlayer::canDoReligion(ReligionTypes eReligion) const
{
	if (GET_TEAM(getTeam()).getHasReligionCount(eReligion) == 0)
	{
		return false;
	}

//FfH Traits: Added by Kael 08/02/2007
    if (isAgnostic())
    {
        return false;
    }

	if (!isHuman())
	{
		if (GC.getLeaderHeadInfo(getPersonalityType()).getReligionWeightModifier(eReligion) <= -100)
		{
			return false;
		}
	}
//FfH: End Add

	return true;
}

The only other places where the ReligionWeightModifier values seem to be used are in CvPlayerAI.cpp. These lines at the end of AI_religionValue would reduce the value to 0 if the ReligionWeightModifier is -100, but it is applied after various other modifiers rather than immeidtely after counting up how present the religion is in the player's cities.

Code:
int CvPlayerAI::AI_religionValue(ReligionTypes eReligion) const

...............



//>>>>Unofficial Bug Fix: Added by Denev 2010/03/11
	iValue *= 100 + GC.getLeaderHeadInfo(getPersonalityType()).getReligionWeightModifier(eReligion);
	iValue /= 100;
//<<<<Unofficial Bug Fix: End Add

	return iValue;

There are similar lines in int CvPlayerAI::AI_techValue( TechTypes eTech, int iPathLength, bool bIgnoreCost, bool bAsync, int* paiBonusClassRevealed, int* paiBonusClassUnrevealed, int* paiBonusClassHave, bool bDebugLog ) const that effect how a player values a technology based on the religion it grants.

Edit: oh, I guess you found where ReligionWeightModifier is used on your own before I submitted this comment.
---

Mentioning religions and techs reminded me that I'd really like it if the great person bulb order could change based on circumstances to be more useful and lore appropriate.

I'm mostly thinking that Great Prophets should be more useful at founding new religions rather than giving you the tech for a religion that is already founded. I also think that the player's Favorite Religion and maybe ReligionWeightModifier could be taken into account when it would be possible to research multiple religion founding techs. (For Hannah the Irin, Message from the Deep should definitely be higher on the list than Way of the Forests or Way of the Earthmother.)

Alignment could effect the priority of some techs too, like Righteousness and Malevolent Designs.

I have no idea how to implement this, however, and it is probably not a very high priority.
 
Edit: What do you think of the attached layout?

Looks good!

The button texts all look fine on my machine. I have no idea what is going on there.

Weird. Is there something in place of the boxes?


I would rather you not do this, as I suspect it would mess up my modmod. I do not use the Agnostic Trait, but I use a lot of ReligionWeightModifiers of -100 to block leaders from adopting certain religions.

And looking at Kael's mod-modder's guide, that is what that tag is supposed to be used for. I'll see if I can't figure out another way to take care of gekko's request. Maybe if I just set the weights to -99 for my mod that will work.

Mentioning religions and techs reminded me that I'd really like it if the great person bulb order could change based on circumstances to be more useful and lore appropriate.

I doubt that I will make any DLL changes in this regard. For any modders who want to alter the Tech Discovery order, it is based on this formula:

Code:
for (int iJ = 0; iJ < GC.getNumFlavorTypes(); iJ++)
{
	iValue += (GC.getTechInfo((TechTypes) iI).getFlavorValue(iJ) * GC.getUnitInfo(eUnit).getFlavorValue(iJ));
}

So to change the order, you would edit the flavor weights for the Great People and/or the Techs.
 
Just replace all the "\b" with " " and it should be fixed.
 
Replacing all the "\b" with " " made some buttons look oddly off center to me.

Why don't you see first if it looks alright with this latest version of worldbuilder, which is included in the latest version of Magister Modmod.

This includes platyping's latest update and Xyth's Platy WB for BUG. (The art folder is no longer needed, as it now used BUG's attitude icons.)

It also adds features like letting you set a unit as being the avatar of a leader or not, letting you set a player as having or not having the feats that control whether its world spell, Sirona's Touch, and Trust are available. Below the unit's scenario counter is a description of the unit type to which it refers. (The scenarios use this to distinguish Decius from an ordinary commander, to let werewolves shift back and forth between other unit types. I have started using it to let a single type of Sluagh store the resurrection data for any unit. )
 
1 /b is not equivalent to 1 space though.
I remembered I replaced all in latest version with about 10 to 12 spaces
 
It looks to me like in the version I downloaded yesterday that CvWorldBuilderScreen.py uses " " (6 spaces) under def setGameOptionEditInfo but still uses "\b\b\b\b\b\b" elsewhere.
 
Spoiler :
Code:
## Game Option Screen ##
	def setGameOptionEditInfo(self):
		initWBToolEditCtrl()
		self.m_tabCtrlEdit = getWBToolEditTabCtrl()

		iNumColumns = 4
		self.m_tabCtrlEdit.setNumColumns(iNumColumns)
		Visible = []
		Hidden = []
		All = []
		lOptions = [All, Visible, Hidden]
		for i in xrange(gc.getNumGameOptionInfos()):
			GOInfo = gc.getGameOptionInfo(i)
			if GOInfo.getVisible():
				Visible.append(i)
			else:
				Hidden.append(i)
			All.append(i)
		bHasHidden = True
		if len(Visible) == len(All):
			bHasHidden = False
		iTotal = len(lOptions[self.m_iVisibleOption])
		iColumnLength = max(iTotal / (iNumColumns - bHasHidden), (3 + (self.m_iVisibleOption == 2) *2))
		if iTotal % iNumColumns > 0:
			iColumnLength += 1
		self.m_tabCtrlEdit.setColumnLength(iColumnLength)
		self.m_tabCtrlEdit.setSize(min(self.xResolution, iNumColumns * 200), min(self.yResolution, max(5, iColumnLength) * 41))

		self.m_tabCtrlEdit.addTabSection(localText.getText("TXT_KEY_WB_HELP2",()))
		if bHasHidden:
			self.m_tabCtrlEdit.addSectionRadioButton(localText.getText("TXT_KEY_WB_SHOW_ALL",()), "CvScreensInterface", "WorldBuilderHandleVisibleOptionsCB", "ShowAll", 0, self.m_iVisibleOption == 0)
			self.m_tabCtrlEdit.addSectionRadioButton(localText.getText("TXT_KEY_WB_SHOW_VISIBLE",()), "CvScreensInterface", "WorldBuilderHandleVisibleOptionsCB", "ShowVisible", 0, self.m_iVisibleOption == 1)
			self.m_tabCtrlEdit.addSectionRadioButton(localText.getText("TXT_KEY_WB_SHOW_HIDDEN",()), "CvScreensInterface", "WorldBuilderHandleVisibleOptionsCB", "ShowHidden", 0, self.m_iVisibleOption == 2)
			if self.m_iVisibleOption == 2:
				self.m_tabCtrlEdit.addSectionLabel("            " + localText.getText("TXT_KEY_WB_DEFAULT_ON",()),  0)
				self.m_tabCtrlEdit.addSectionLabel("            " + localText.getText("TXT_KEY_WB_DEFAULT_OFF",()),  0)
			for i in xrange(iColumnLength - 3 - (self.m_iVisibleOption == 2) *2):
				self.m_tabCtrlEdit.addSectionLabel(" ",  0)
		for i in lOptions[self.m_iVisibleOption]:
			sVisible =""
			if self.m_iVisibleOption == 2:
				GOInfo = gc.getGameOptionInfo(i)
				sVisible = " (O)"
				if GOInfo.getDefault():
					sVisible = " (X)"
			sText = gc.getGameOptionInfo(i).getDescription() + sVisible
			self.m_tabCtrlEdit.addSectionCheckbox(sText, "CvScreensInterface", "WorldBuilderHandleEditGameOptionCB", str(i), 0, CyGame().isOption(i))
		for i in xrange((iNumColumns - bHasHidden) * iColumnLength - iTotal):
			self.m_tabCtrlEdit.addSectionLabel(" ",  0)

		if (not self.m_tabCtrlEdit.isNone()):
			self.m_normalPlayerTabCtrl.enable(False)
			self.m_normalMapTabCtrl.enable(False)
			self.m_bCtrlEditUp = True
		return
## Game Option Screen ##

There are 12 spaces there in my file.
As for the rest of the codes, I probably reuploaded the same version with the spaces instead of /b awhile later, but didn't bother to mention it, because there is nothing wrong with /b in the first place.

In fact, it is easier for me to count how many there are using "/b" rather than " "
 
Could you expose int CvPromotionInfo::getAIWeight() const to python?

I would like to make certain spells (including Domination) take into account the promotions units have when choosing which unit to target. It seems like checking for the unit's promotions' AI weights would be the easiest way to determine whether a promotion should make the unit more or less valuable, and by how much.

I tried using iValue += gc.getPromotionInfo(iProm).getAIWeight() in hopes that this was already exposed despite being absent from the API, but got the error "AttributeError: 'CvPromotionInfo' object has no attribute 'getAIWeight' "
 
Do the Luchuip do anything specifically to get the pieces of Barnaxus back? Maybe they should demand the return of pieces of Barnaxus from a civ and if that civ refuses to return pieces of Barnaxus then a large diplo penalty is imposed.
 
For the Horde currently kills the Clan of Embers. They cast it early and they quickly run into money trouble because of it due to the excessive upkeep. This hinders research and they are forced to get rid of units because of the upkeep, therefore making the spell useless. I suggest what (if I remember correctly) they did in RiFE which is make the newly converted units with the spell have no upkeep. It makes the spell actually useful instead of just draining cash.
 
I was pretty sure I requested this long ago, but I don't see it on the list:

Could you please allow python to set Overcouncil/Undercouncil resolutions as having been passed or not passed?
 
there are not many useful duties for very late units - luonnotars - except for sacrificing for AoL. My idea - give to them griori-specific resurrection: resurrects dead grigori heroes but as "adventures" w/o experience...
 
or maybe they could have an 'inspire' spell.
that gives hero to a target unit... while losing a level for the luonnatar.. (or losing the whole luonnatar)
 
I just now noticed that you told me to make this change quite a while back in order to prevent certain summons from being giftable.

However, if you're manually summoning units via python, then you will probably also need to use the setPermanentSummon(bool newvalue) call for the summoned unit.

Unfortunately you advise is impossible to follow, as the function is not exposed to python.

Could you go ahead and expose both bool CvUnitAI::isPermanentSummon() and void CvUnitAI::setPermanentSummon(bool newvalue) to python for me?
 
Could you suppress the <PromotionCombatApply> messages when the promotion is not actually applied, due to another promotion granting immunity to that promotion?

It is mildly annoying to get such messages saying that your Paladins have become Plagued when their Immune to Disease promotion actually prevented that.
 
Back
Top Bottom