[Religion and Revolution]: Bugs and Todos

That bug is most likely related to Python logic.
(Somewhere in CvRandomEventInterface.py)

Similar bugs had happened in the past, when Python-Events were removing higher amounts of a certain yield, than there was available.

The only explanation I would have is that one of the changes (for new Gamespeeds) from Barthoze is buggy.
Although I did not see any problems when checking the commits. :dunno:

Don't have a lot of time to go searching though.
(Easiest way to test be would to trigger the corresponding event with cheat menu: Ctrl + SHIFT + E)
 
Ok, I took a look and I am pretty sure that I now know what is wrong.
It was indeed caused by the GameSpeed changes. (A small copy paste error.)

Edit:

It is now corrected again.
(New revision available in SVN.)
 
Oh, what a pitty...it does not work with savegames. However, I will start a new game. Thanks ray!

Actually it should.
The fix was all just Python.

It will of course not correct the negative Yields in a savegame (from the bugged Pyhton event file before my last commit).
But if you have a savegame before the event was triggered, everything should work fine with the new corrected Python file.
 
Religion & Revolution 2.4 (rev 1032 -27.02.15)

File GlobalDefinesAlt.xml

I found double definition of SCORE_FATHER_FACTOR

Code:
	<Define>
		<DefineName>SCORE_FATHER_FACTOR</DefineName>
		<iDefineIntVal>2000</iDefineIntVal>
	</Define>

and

Code:
	<Define>
		<DefineName>SCORE_FATHER_FACTOR</DefineName>
		<iDefineIntVal>3000</iDefineIntVal>
	</Define>
 
Ah ok thanks.
That isn't critical at all though.

You're right, it's not critical. I accidentally found this small bug when adjusted RaR 2.4 for my own needs.

My idea was to fully remove iFatherScore from TotalScore calculations:

Code:
		int iSubTotal = iPopScore + iLandScore + iFatherScore;

I'd like to have TotalScore that depends only on Population and Land size.

P.S. maybe somebody here could create a special "RaR modifications" section where everybody could propose own variants.
 
Hello everybody! First I want to say: This Mod is great! I love it!
This is my first post and I'm from Austra, so my English is not the yellow from the egg...
Although I really enjoy playing the mod I recognized something which disturbs me:

When I build a farm on turkeys I should get a bonus on food, but for a farm I have to chop down the wood and the bonus for turkeys gets lost.

When I build a trapperhut I don't lose the food bonus of turkeys and get a little food bonus, but then I get less food than with a farm. A great farmer doesn't compensate this.

I would recommend that the bonus for turkeys shouldn't get received by a farm but by a trapperhut. I would also give the expert hunter a bonus for turkeys (because turkeys can't be planted on farms but be hunted in a trapperhut).

Best regards!
ederl
 
I would recommend that the bonus for turkeys shouldn't get received by a farm but by a trapperhut. I would also give the expert hunter a bonus for turkeys (because turkeys can't be planted on farms but be hunted in a trapperhut).

Turkeys are reared in farms, much like many poultry species and farm animals. Farms are not necessarily "fields", it can also be farmsteads with pens and such. Trapper huts I imagine are for wild animals. Turkeys are easy enough to capture and raise without trapping them using snares and traps, so i think it is ok as it is.
 
Yes, I can see your point, vetiarvind.
But now the problem is, that to get a bonus from turkeys, I'm not allowed to cut down wood, otherwise I lose the bonus and building farms cause a cutdown of wood. So with building a farm I get the maximum of food, but then what do I need the resource tukeys for?

So there are 3 ways to solve the problem:
1) Turkeys do not lose their bonus when wood is cut down
2) A farm doesn't cause cut down wood
3) Give the trapperhut and expert hunters a bonus for turkeys

Thank you!
 
1) Turkeys do not lose their bonus when wood is cut down

Actually I thaught that would be the case already.
If not, that is a very very simple xml change.

However, development of the base mod has ended and there won't be any further releases.

Maybe somebody will provide the xml snipplet here.
 
I have a problem with Salt production.

Game version: Religion & Revolution 2.4 (rev 1032 -27.02.15), no changes

I have a Hill with 3 Salts. Salt Bonus is absent on this tile. There are only three options to build or Monastery, or Fort, or Route.

NoMine.jpg

Why I cannot build Mine to produce Salt?

I don't need a fix. Please, just explain the reason. Thank's.
 
Why I cannot build Mine to produce Salt?
Looks to me like you could have some local modifications because I can't trigger this with the released XML files. Anyway the explanation is in XML.

CIV4ImprovementInfos.xml
Code:
<Type>IMPROVEMENT_MINE</Type>
	<Description>TXT_KEY_IMPROVEMENT_MINE</Description>
	<Civilopedia>TXT_KEY_IMPROVEMENT_MINE_PEDIA</Civilopedia>
	<ArtDefineTag>ART_DEF_IMPROVEMENT_MINE</ArtDefineTag>
	<PrereqNatureYields>
		<YieldIntegerPair>
			<YieldType>YIELD_ORE</YieldType>
			<iValue>1</iValue>
		</YieldIntegerPair>
[COLOR="Red"]		<YieldIntegerPair>
			<YieldType>YIELD_RAW_SALT</YieldType>
			<iValue>1</iValue>
		</YieldIntegerPair>[/COLOR]
	</PrereqNatureYields>
I think adding the red text should fix it. It will then build if the plot produces either ore or salt. You could argue that it would be correct to add silver as well.
 
Why I cannot build Mine to produce Salt?

This looks like you did modifications of your own.
On the hill you should have Yield Ore as well.

Either we have a bug in our last release or you have been lying about "no changes".
Please be honest about your own changes to the base mod.

Also, please don't post issues of your private modifications in our thread for "Bugs and Todos".
Please use our thread for "Feedback and Questions".

I think adding the red text should fix it.

No, it won't.

That change will make it only worse.
Because it will then require both Yields (Ore and Salt) to build a mine.
 
That change will make it only worse.
Because it will then require both Yields (Ore and Salt) to build a mine.
Are you sure? Looking at CvPlot::canHaveImprovement(), it checks for this setting.
Code:
bool bPrereq = false;
bValid = false;
for (iI = 0; iI < NUM_YIELD_TYPES && !bValid; ++iI)
{
	int iRequired = GC.getImprovementInfo(eImprovement).getPrereqNatureYield(iI);
	if (iRequired > 0)
	{
		bPrereq = true;
		if (calculateNatureYield(((YieldTypes)iI), eTeam) >= iRequired)
		{
			bValid = true;
		}
	}
}
if (bPrereq && !bValid)
{
	return false;
}

return true;
Looks to me like it will set bPrereq if it requires one or more yields and bValid if a required yield is present. More interestingly, it has no way of setting bValid to false once the loop starts meaning once just one yield set it to true, it will be true.

Naturally we can only be completely sure if somebody actually test this. There could be code somewhere else, which rejects the build even if it is ok here.
 
Looks to me like you could have some local modifications because I can't trigger this with the released XML files.

I'm afraid you are wrong. I have CIV4ImprovementInfos.xml file

Size 88,0 KB (90121 bytes)
Modified 27.02.2015, &#8207;19:44:16

I downloaded mod Religion & Revolution 2.4 (rev 1032 -27.02.15) only 02.03.2015, &#8207;8:51:24 that is few days later.

In any case I will redownload Religion & Revolution 2.4 and test Salt production on Mine again.

Anyway the explanation is in XML.

CIV4ImprovementInfos.xml
Code:
<Type>IMPROVEMENT_MINE</Type>
	<Description>TXT_KEY_IMPROVEMENT_MINE</Description>
	<Civilopedia>TXT_KEY_IMPROVEMENT_MINE_PEDIA</Civilopedia>
	<ArtDefineTag>ART_DEF_IMPROVEMENT_MINE</ArtDefineTag>
	<PrereqNatureYields>
		<YieldIntegerPair>
			<YieldType>YIELD_ORE</YieldType>
			<iValue>1</iValue>
		</YieldIntegerPair>
[COLOR="Red"]		<YieldIntegerPair>
			<YieldType>YIELD_RAW_SALT</YieldType>
			<iValue>1</iValue>
		</YieldIntegerPair>[/COLOR]
	</PrereqNatureYields>
I think adding the red text should fix it. It will then build if the plot produces either ore or salt. You could argue that it would be correct to add silver as well.

No, it doesn't work. I already tested this variant.
 
Are you sure?

Quite sure. (99%)
But I am also wrong sometimes. :)

I have CIV4ImprovementInfos.xml file

The problem is not caused by that file.
(It is much more likely caused in Yield balancing of the Terrains.)

Did you modify any XML file in your version ?
Because you say "no changes" and I don't believe that, sorry.
 
Are you sure? Looking at CvPlot::canHaveImprovement(), it checks for this setting.

Looks to me like it will set bPrereq if it requires one or more yields and bValid if a required yield is present. More interestingly, it has no way of setting bValid to false once the loop starts meaning once just one yield set it to true, it will be true.

Naturally we can only be completely sure if somebody actually test this. There could be code somewhere else, which rejects the build even if it is ok here.

OK, maybe in this case to be easier just to remove PrereqNatureYields from CIV4ImprovementInfos.xml

Code:
<Type>IMPROVEMENT_MINE</Type>
	<Description>TXT_KEY_IMPROVEMENT_MINE</Description>
	<Civilopedia>TXT_KEY_IMPROVEMENT_MINE_PEDIA</Civilopedia>
	<ArtDefineTag>ART_DEF_IMPROVEMENT_MINE</ArtDefineTag>
	<PrereqNatureYields>
		<YieldIntegerPair>
			<YieldType>YIELD_ORE</YieldType>
			<iValue>[B][COLOR="Red"]0[/COLOR][/B]</iValue>
		</YieldIntegerPair>
		<YieldIntegerPair>
			<YieldType>YIELD_RAW_SALT</YieldType>
			<iValue>[COLOR="red"][B]0[/B][/COLOR]</iValue>
		</YieldIntegerPair>
	</PrereqNatureYields>


After that we exclude this part from

Code:
 bool CvPlot::canHaveImprovement(ImprovementTypes eImprovement, TeamTypes eTeam, bool bPotential) const

[COLOR="Red"]	bool bPrereq = false;
	bValid = false;
	for (iI = 0; iI < NUM_YIELD_TYPES && !bValid; ++iI)
	{
		int iRequired = GC.getImprovementInfo(eImprovement).getPrereqNatureYield(iI);
		if (iRequired > 0)
		{
			bPrereq = true;
			if (calculateNatureYield(((YieldTypes)iI), eTeam) >= iRequired)
			{
				bValid = true;
			}
		}
	}

	if (bPrereq && !bValid)
	{
		return false;
	}[/COLOR]
 
The problem is not caused by that file.
(It is much more likely caused in Yield balancing of the Terrains.)

Did you modify any XML file in your version ?
Because you say "no changes" and I don't believe that, sorry.

As I told earlier, I will redownload Religion & Revolution 2.4 and test Salt production on Mine again.
 
Top Bottom