[Religion and Revolution]: Bugs and Todos

Same text on either option:

Nobles and citizens are following the example of their King.
Demand for our colonial goods is raising (should be spelled "RISING").

The first option should have the following text:
"Nobles and citizens are following the example of their King.
Demand for our colonial goods is DECLINING"

The second option should have the following text:
"Nobles and citizens are NOT following the example of their King.
Demand for our colonial goods is RISING"





This bug is still present
 
The version in SVN should be identical with the last public version.
(uploaded by HermanHeydt and linked here).

As far as I know the last activity on SVN (map corrections of Marla_Singer) became part of the public download.

Afterwards I sometimes took a look to see if anything had occured on SVN but it was completely without any activity.

So if the public download does work for you and the SVN version does not, that would be a bit strange.
(But you could simply use the public download then.)
 
Make a diff (winmake) from the svn source and the source code shipped with the installer and you can see if the sources are different.

Or just look into svn log ...

PS:
The source code shipped with the installer works fine. I compiled and tested it yesterday.
 
I don't know. For some reason, my mod-mod with the latest SVN works fine. However, without my mod-mod the pure R&R 2.2 from SVN crashes. (just to clarify, I created a new game, did not load a mod-mod game) I haven't tested with the public download, and I assume it's working fine for others...Well cuz otherwise this board will be flooded.
 
I have tested a fresh install and the download at the link is definitely working ok
~1 hr running now...

No other probs reported about thus far, must be local :(
 
Another issues which i believe was posted about before was where monasteries did not grow to large monasteries even though it had a missionary fortified on it. The missionary converted natives, but it did not develop at all. (it was outside the 2 tile radius as well). I noticed forts growing when fortifying units on it, but not monasteries. A small issue, but have seen this occur more than once. Maybe monasteries need to be worked on by city workers? That's not what the help page says.
 
I have no idea what the problem should be with "Monastery" growing to "Large Monastery".
(I am very sure, that I had tested that feature properly and that I had gotten "Large Monasteries" several times in my games.)

I just tested it again with Release 2.2 and it was working perfectly.
(It works as designed.)

I fortified a Missionary on it. (Make sure, the Unit does have the Profession Missionary.)
And at the next turn, the growth counter started.
After the timer was over, the Monastery turned into Large Monastery.

It does take 50 rounds though for a "Monastery" to grow to a "Large Monastery".
(Mouse Over at the Monastery will give you the remaining rounds until growth.)

It sounds like you are just not patient enough and did not figure out "Mouse Over" to see the growth timer.
But I really don't see any bug.

Maybe I just don't understand your problem though. :dunno:
 
^Not to sound preachy but "i tested it once and it works perfectly" isn't solid reasoning. There are corner cases that appears to be missed.
Here is a screenshot just after a turn finished. On the left, you will notice fortify bonus on 25% (so more than 5 turns have been occupied by the missionary). However, the status will say "Settlement must work to become a large monastery". Again, my guess is monastery growth only works within the city radius and you may have missed monasteries built within cultural borders outside city radii.

Also, like I said, this monastery has converted more than 2 natives already, so it works. I was just surprised to find the status "not been worked on" even though it's obviously doing it's thing.
 
After I had read your post I had tested it again with clean Release 2.2 and it worked perfectly for me. :dunno:

Just as I wrote:
"I just tested it again ..."

In my last test, the Monastery was several plots outside of my land.
(I usually build them quite far away from my cities.)

However, I did not test "outside city radius and still within culture borders".

Maybe you can verify that that is the exact problem (by using World Builder)?
(Is it working outside cultural borders ?)

But even if there still was a bug with this:
Work on this mod has ended months ago, sorry. :(

The only realiscitc chance for further development (or bugfixes) I see, is within modmods of other people (like you).
 
Reading about the Monastery problem, the first potential issue could be that upgrading improvements could be done by city code. The issue would then not be about cultural borders, but rather distance to nearest city regardless of owner. The bug could then be from placing a monastery too far from native settlements.

If so, then the turn count code is called in the wrong place. I would say that CvPlot::doTurn() would be a good place to handle this as it is called for all plots. Possibly the function doMonasteries would be better, but it is only called from doTurn, which delivers the same result. If it is only called here, we will check all plots each turn and only once each turn.

I don't know how it is called right now as I didn't read the code just to write this post. I remember the code well enough to propose a possible cause and solution.

Another interesting question: could forts suffer from the same issue? In quite a number of ways, the code looks fairly similar.
 
In my last test, the Monastery was several plots outside of my land.
(I usually build them quite far away from my cities.)
I thought you could only build monasteries inside owned land :confused:
However, I did not test "outside city radius and still within culture borders".

Maybe you can verify that that is the exact problem (by using World Builder)?
(Is it working outside cultural borders ?)

But even if there still was a bug with this:
Work on this mod has ended months ago, sorry. :(

The only realiscitc chance for further development (or bugfixes) I see, is within modmods of other people (like you).
That is sad to hear, but if we could get a confirmation from you reg. the issue, it would be better of course as you know this code better than anyone else.
 
Reading about the Monastery problem, the first potential issue could be that upgrading improvements could be done by city code.
Not exactly but seems to be a good starting point.
------------------------------------------------------------------
I think I have pinpointed the source of the bug, but have some questions too.
CvPlot.cpp file has a doTurns() method:

Code:
if (!isOwned())
{
	doImprovementUpgrade();
}
I don't know why this is !isOwned instead of isOwned()...So if something is within cultural borders, it won't be processed for upgrades? Anyway, going into doImprovementUpgrade(), this calls method calls
Code:
if (isBeingWorked())//do upgrades now
whose code is dependent on checking if it belongs to a city's plot.
Spoiler :

Code:
//isBeingWorked() code:
CvCity* pWorkingCity = getWorkingCity();
if (pWorkingCity != NULL)
{
	return pWorkingCity->isUnitWorkingPlot(this);
}
return false;

//which calls to see if the plot is first within city bounds
bool CvCity::isUnitWorkingPlot(const CvPlot* pPlot) const
{
	int iIndex = getCityPlotIndex(pPlot);

	if (iIndex != -1)
	{
		return isUnitWorkingPlot(iIndex);
        }

	return false;
}


As Nightinggale pointed out, this should occur for forts too.
However, I still don't know yet where the logic for checking for a "missionary being fortified" comes from.
 
I thought you could only build monasteries inside owned land :confused:

No, Monasteries and Forts can be built outside cultural borders.
(That is in fact the way I mainly use them - and even intended them to be used.)

I don't remember the exact code of "Growing Improvments" anymore.
It is too long ago that I have been working on it and I am not modding anymore.
 
No, Monasteries and Forts can be built outside cultural borders.
(That is in fact the way I mainly use them - and even intended them to be used.)
Guess that's another bug then. I definitely remember not being able to build a fort outside cultural borders, although I think it might have been enemy dominated area. (haven't tested with monasteries yet but assumed the same)

By outside cultural borders, do you mean, just "neutral" lands? Also, could you clarify the question in my prev. post about the if(!isOwned()) code, if you do remember about it.
 
In clean Release 2.2 it is definitely possible to build Monasteries and Forts outside of your own cultural borders (if you have enough money of course).
(I did that in my last tests yesterday and usually built Monasteries and Forts like that in my games.)

And sorry, I am not analyzing any code anymore.
(As I said, I stopped modding. Currently I am not even playing Civ4Col anymore.)

I can only repeat:
In my last tests (yesterday, with clean Release 2.2) I did not find any bugs with Monasteries.
(I could build them outside of my cultural borders, they grew as expected, their features were working, ...)

Maybe there are some special cases though, which I oversaw since I do not use Monasteries like that in my style of playing. :dunno:

Also, please be sure, that bugs reported are not caused by your modmod.
(Please do testing with clean Release 2.2 when reporting bugs.)

Edit:
And yes, with "outside own cultural borders" I am talking about "neutral land".
It would be pretty strange, if the feature would allow building Forts (or Monasteries) in other nations territory.

Edit 2:
It is possible to build Forts and Monasteries "inside your own cultural borders" as well.
So that would also not be a bug. It is simply not the way I usually use those Improvments myself.
(I do consider Forts and Monasteries as "outposts in the wilderness".)
 
Rather than depending on the output of isOwned(), I would propose the following setup:


Code:
CvPlot::doMonastery()
{
...
	if (!hasMonasteryMissionary)
	{
		return;
	}
	[B]doImprovementUpgrade();[/B]
doImprovementUpgrade() will then only be reached if unit present and improvement meets the required conditions and not care for anything like plot ownership or any other data, which appears to be irrelevant from a player's point of view. The same approach can be used for forts.

Also plots being worked by a city should not call doImprovementUpgrade() on forts and monasteries as this could make them get called twice. Maybe adding a bool as argument to doImprovementUpgrade() to tell if those improvements should be upgraded or not.
 
Nightinggale - It's not as simple as that, although you're definitely on the right track.
If you look at the code within doImprovementUpgrade()
Code:
if (isBeingWorked())
{
	changeUpgradeProgress(/*improvement dependent rate*/);

	//now check whether to upgrade
}
else if (GC.getImprovementInfo(eImprovementUpdrade).isOutsideBorders())
{
	changeUpgradeProgress(1);

	//now check whether to upgrade
}
As you can see, there is a "no man's land" between the "outside" borders and the "working on tiles" that isn't covered by the improvement logic...So we can't use this function to perform updates at all. What we need to do is to write an equivalent function just for Forts and Monasteries that does this called from doMonasteries() and doForts() as you suggested and then block the improvements for Forts and missions at the city plot level (which internally calls doImprovementsUpgrade())

Spoiler :
Code:
//what our new non-worker improvements will look like at the core
upgradeNonWorkerImprovements()
{
       changeUpgradeProgress(1);

	if (getUpgradeProgress() >= GC.getGameINLINE().getImprovementUpgradeTime(getImprovementType()))
	{
		setImprovementType(eImprovementUpdrade);
	}
}

To block doImprovementInfo() from checking for forts and monasteries:
Let's just cache the variable from the existing code as a separate variable and call it "improvementInfo":
ImprovementTypes eImprovementUpdrade = (ImprovementTypes)GC.getImprovementInfo(getImprovementType()).getImprovementUpgrade() //take out the bold part into a new variable

Now we can just make a seperate check to exclude monasteries and forts from the doImprovementUpgrade() method...

by changing the existing check
Code:
if (eImprovementUpdrade != NO_IMPROVEMENT)
into
Code:
if (eImprovementUpdrade != NO_IMPROVEMENT &&  !improvementInfo.isMonastery() && !improvementInfo.isFort() )


EDIT 1:

After testing with the above changes, I find that monasteries are working as expected, but forts are not growing either within tile radius or outside borders. The only time they're growing is when a city worker is working on them.
I believe that there is some sort of issue with the isFort() method, since worker-related upgrades should no longer affect this. Maybe, I will take a look later, when I'm less tired and fix both issues.
 
In my last tests (yesterday, with clean Release 2.2) I did not find any bugs with Monasteries.
(I could build them outside of my cultural borders, they grew as expected, their features were working, ...)

Edit 2:
It is possible to build Forts and Monasteries "inside your own cultural borders" as well.
So that would also not be a bug. It is simply not the way I usually use those Improvments myself.
(I do consider Forts and Monasteries as "outposts in the wilderness".)

I guess this is going off-topic, but the help page on "Forts" clearly states they can be built near cities to ward off native raids. Your "outposts in the wilderness" seems to be a personal style, and is not how has been projected on the help page. Perhaps for monasteries it makes sense as why would someone waste a city tile for making a monastery when there are many better spots on the map.
---------------------------------------------------------------------
Also, the help page says "forts" help deter attacks, but what happens in the code is that natives target the fort instead. That seems fine. I was wondering out of realism if a fort should instead have a "threat level" that makes raiding natives turn away, similar to how monasteries can sometimes pacify raiding ones..Since natives who're raiding are out looking for scalps or money, not necessarily just do damage.
 
After testing with the above changes, I find that monasteries are working as expected, but forts are not growing either within tile radius or outside borders. The only time they're growing is when a city worker is working on them.
I believe that there is some sort of issue with the isFort() method, since worker-related upgrades should no longer affect this. Maybe, I will take a look later, when I'm less tired and fix both issues.

Ok, so it looks like the above breakage is not because of my bug fix, but an existing issue in the fort's codebase. This just keeps getting more interesting. :mischief:

The logic for determining if a fort has a defender in CvPlot.cpp::doFort() is broken, causing the rest of the function to get skipped. This is why, when I had written an upgrade to happen when a unit was fortified, it did not work, but the upgrade worked when I did it before checking if a unit was present.

Maybe forts did work with the old units, but don't just work for new R&R 2.2 units such as "light artillery" or "colonial militia"..I guess I will test these conditions and edit this post tomorrow...

EDIT:
It appears that only musket-armed foot soldiers can really make use of a fort. All other units do not use the fort, nor make it grow, other than the tile defense bonus for siege units.
 
Top Bottom