[Religion and Revolution]: Bugs and Todos

Hi Folks,

good news: I solved the problem. It was necessary to rebuild the unit completely (work in blender and nifskope), but it was worth to do it. Now the unit works fine!

I will upload a bugfix shortly for all heavy artillery units.

EDIT: Please find attached the "emergency bugfix". :)

Copy the files directly into your "Mod" Folder (please have in mind that you maybe will have to change the name of own your RaR folder if you have changed the name of your mod to your personal taste).
Great! :goodjob:

I've tested it for all civs and it works well.
Just so that you know for the SVN, the Dutch royal artillery actually uses the heavy artillery graphics. So this file should be corrected too.
 
I have another bug, yeee. Don't know if it's been reported before (there is a lingering deja vu about this), but the issue is:

When a city revolts and comes back to order, some of the plot-workers "disappear". They haven't really died as the city shows them, but they're nowhere to be found. You will have to click on "turn on\off citizen automation" to bring them back. This is a bummer of a bug when first encountered as you think they are lost forever.

Attached is an image to show this here: The population on the title doesn't correctly represent the workers in the city. (only 3 shown in a population of 7). They are still there, but buried in some "unknown" profession.
 
The bug is known already for quite a long time.
(I even believe the bug is Vanilla. Although I am not sure.)

Currently I don't have any idea how to fix it though. :think:
(And as you said, there is a quite simple workaround.)

Thus I'd be thankful for any help or useful suggestions for a fix.

Edit:
Will be gone most of the day on a family visit.
 
The bug is known already for quite a long time.
(I even believe the bug is Vanilla. Although I am not sure.)

Thus I'd be thankful for any help or useful suggestions for a fix.

My first idea would be this place in CvCity.cpp's doTurn() method:
Spoiler :

Code:
if (getOccupationTimer() > 0)
{
	changeOccupationTimer(-1);
}

for (uint i = 0; i < m_aPopulationUnits.size(); ++i)
{
	m_aPopulationUnits[i]->doTurn();
}


I would change it to:
Spoiler :

Code:
if (getOccupationTimer() > 0)
{
	changeOccupationTimer(-1);
}

[B]if(getOccupationTimer() == 0)[/B]
    for (uint i = 0; i < m_aPopulationUnits.size(); ++i)
	m_aPopulationUnits[i]->doTurn();

Basically, just process a population unit if a city is in order.
 
Basically, just process a population unit if a city is in order.

If that solves the problem, that would be fine.
(Although I am not sure if that might not have side effects.)

Another idea would be to simply turn on "Worker Automatization" if a City goes into unrest. <--- Basically trying to do the workaround (that solves the issue) within the logic.
(Although I am just guessing that this might solve the issue. Also it should be implement for the human player only.)

I guess we would simply need to implement the variants and see what happens. :dunno:
 
I have been pondering on implementing a feature where a unit remembers which plot you assigned it to. If it can't use the plot (I was thinking of pirates) it will automate, but each turn it will check if it can go back to what you assigned it to do. However I never really got any further than early planning. It sounds it like could be useful for this case as well.
 
Professions automation within a city is not particularly good. It's been probably studied by Ray but well, it looks like there is something fishy in the way some units are allocated.

Just for testing purpose, I've saved my quite advanced savegame as a worldbuilder scenario, just to check how the AI would allocate the professions of my citizens. The problem seems to be the most important about carpenters and students (they don't go in their dedicated buildings).

But anyway, I've been observing a lot the AI since yesterday and I was considering making a thread in the general "Civ4Col - Creation & Customization" thread. Maybe I will do that now.
 
Professions automation within a city is not particularly good. It's been probably studied by Ray but well, it looks like there is something fishy in the way some units are allocated.
I noticed that as well. Not long ago I trapped an AI and prevented him from founding new colonies. He left colonists outside on the city plot because he ran out of room (ok, I guess), but as it turned out, he left experts idle while inside the colony non-experts were doing the job of those professions.

I have been wondering if I could improve on this to improve the AI and/or make a warning to players when experts aren't doing their expert job and non-experts are doing those jobs. It turns out that it quickly becomes rather complex and I propose not to do much, if anything regarding this issue for 2.3.
 
If that solves the problem, that would be fine.
(Although I am not sure if that might not have side effects.)

Another idea would be to simply turn on "Worker Automatization" if a City goes into unrest. <--- Basically trying to do the workaround (that solves the issue) within the logic.

Hi, sorry about the first post. I had typed it out just before heading out for the pool and never tested the idea. The code I was working after I came back coincidentally looks similar to your suggestion...I tried reproducing the issue after doing this, and the bug seems to have gone...
Code:
bool isInOrder = getOccupationTimer() == 0;
for (uint i = 0; i < m_aPopulationUnits.size(); ++i)
{
	if(!isInOrder)//R&R mod, vetiarvind, bug fix to unlock colonists during rebellion
		m_aPopulationUnits[i]->setColonistLocked(false);
	m_aPopulationUnits[i]->doTurn();
}

I think the root cause of the bug is that rioting makes the culture go back to 0. So, now "locked" units who are unable to work on plot tiles (as we are no longer the owner of the surrounding plot tiles) sort of just disappear...However, setting the colonists to locked(false) makes the AI automate the placement of the units and they don't disappear. The drawback of this is that sometimes the free colonists can get assigned elsewhere and you lose Learn-by-Doing benefits.


Alternative proposal:
Rioting should not modify culture at all. Which means plot tiles will still be owned by human player (for whom rioting is applicable) and therefore there will be no change in worker's professions.
 
Alternative proposal:
Rioting should not modify culture at all. Which means plot tiles will still be owned by human player (for whom rioting is applicable) and therefore there will be no change in worker's professions.
I vote for this solution. It's likely the easiest one to implement and I have a feeling that it is also the easiest one to get bugfree.
 
I noticed that as well. Not long ago I trapped an AI and prevented him from founding new colonies. He left colonists outside on the city plot because he ran out of room (ok, I guess), but as it turned out, he left experts idle while inside the colony non-experts were doing the job of those professions.

I have been wondering if I could improve on this to improve the AI and/or make a warning to players when experts aren't doing their expert job and non-experts are doing those jobs. It turns out that it quickly becomes rather complex and I propose not to do much, if anything regarding this issue for 2.3.
I agree. This should be left aside 2.3.


Alternative proposal:
Rioting should not modify culture at all. Which means plot tiles will still be owned by human player (for whom rioting is applicable) and therefore there will be no change in worker's professions.
I vote for that solution too. Firstly because if Nightingale tells it's the one which has the easiest chance to be bug free, then I trust him and that's the most important. Secondly, the concept of losing culture between riots have always been weird to me. It doesn't seem to fit on what culture is supposed to represent in Civ games.

Now you should know that cities also use the "riot" mechanism when you conqueered them from a foreign power. That's probably the reason why culture has been thought as disappearing during riots, to avoid a conqueered city to directly generate it. But frankly, if a conquered city would directly earn that culture, I would hardly be shocked.
 
Alright, I don't want to implement something new, but just share thoughts with you.

As it is currently, the most efficient attacking strategy is to build a large stack of heavy artillery with just a single land unit needed to grab the city once all the ennemy units are destroyed. It's true that building armies consisting strictly in artillieries wasn't the initial intent with the new combat system.

It's been a very long time I haven't played civ4 or BTS, but I seem to remember a feature of which with some bombard units, you could damage the opponents instead of attacking them. So instead of using artilleries as attacking units, they could be used exclusively as bombard units (damaging the opponents both in attack and defence). I'm pretty convinced Civ4 bombers operate this way, is my memory getting obscured or is that real?

If the AI mechanism does exist, work properly, and could be used in RAR, maybe that could be an interesting evolution for the artillery units. If those three conditions aren't met, then let's drop it off and continue the way it is.
 
I vote for this solution. It's likely the easiest one to implement and I have a feeling that it is also the easiest one to get bugfree.

Yeah the code is fairly simple (just remove an if check):
Spoiler :

Code:
void CvCity::updateCultureLevel()
{
	if (getCultureUpdateTimer() > 0)
	{
		return;
	}

	CultureLevelTypes eCultureLevel = ((CultureLevelTypes)0);

	[B]if (!isOccupation())[/B] //remove this check
	{
		for (int iI = (GC.getNumCultureLevelInfos() - 1); iI > 0; iI--)
		{
			if (getCulture(getOwnerINLINE()) >= GC.getGameINLINE().getCultureLevelThreshold((CultureLevelTypes) iI))
			{
				eCultureLevel = ((CultureLevelTypes)iI);
				break;
			}
		}
	}

	setCultureLevel(eCultureLevel);
}
 
It's been a very long time I haven't played civ4 or BTS, but I seem to remember a feature of which with some bombard units, you could damage the opponents instead of attacking them. So instead of using artilleries as attacking units, they could be used exclusively as bombard units (damaging the opponents both in attack and defence). I'm pretty convinced Civ4 bombers operate this way, is my memory getting obscured or is that real?

Maybe this should go to "Mod development"? Anyway, I remember Civ4 bombers as having some strength (however i think it was purely defensive). There were the "old" bombers and then "Stealth bombers" and fighters had more "Strength" than either of them although their bombard strength was lower than the bomber's. Civ2 had them too but I don't think they had introduced the bombard feature at that point.
 
Yeah the code is fairly simple (just remove an if check):

Ok, then let us go with that approach to fix the issue. :thumbsup:

@vetiarvind:

Please commit to SVN:

1. Fix for "Disappeared Workers"
2. Fix for Forts not growing inside cultural borders
3. Your balancing changes to increase military FF points gained.
4. Your balancing change of Crosses Max Limit set to 400 (instead of currently 800).
5. Any fixed you did in XML (e.g. Units <-> Unitclasses)
6. Fixes in CvPlot.cpp due to wrong asserts.

Please do a separate commit for each of them.
(Will make it easier for me to check.)

These two features we will need to discuss:
(I will need more explanation to your work here.)

7. Trade Groups for Automation
8. Adaptation of Super Forts

This could be interesting as well (although it does not exist yet):

9. Trilateral navigation between Europe->Port Royal->Africa

Tomorrow I will implement and upload the following 2 fixes:

10. Monasteries (and Forts) will require a minimal distance of 2 Plots to Euroean Cities and Native Villages. (Cannot be built directly next to them.)
11. Loosing a City will not cause confusing "Abandoning City"-Message anymore.
 
@Ray Sure, i've tested the "disappearing workers" after the fix and can't get it to happen :)
Since you want the fix for "forts not growing inside cultural border"...I assume you and schmiddie are not planning on releasing any new features (like the super forts one)?

My fort bug fix and "super forts" are touching the same area and there will be a merge conflict as i have done some refactoring of that code area as part of "super forts". Things like having a common method to check if a missionary exists on a monastery or a defender on a fort, as well as some small tweaks to select the "best defender" and "expert missionary" in a group instead of "first missionary" of the group.

Anyway, I guess we can just go ahead with the fixes you have listed. If someone wants "super forts" they can get it from my to be released new mod-mod version.

Tomorrow I will implement and upload the following 2 fixes:

1. Monasteries (and Forts) will require a minimal distance of 2 Plots to Euroean Cities and Native Villages. (Cannot be built directly next to them.)
2. Loosing a City will not cause "Abandoning City"-Message.
:thumbsup:
 
I assume you and schmiddie are not planning on releasing any new features (like the super forts one)?

I simply do not know yet. :dunno:
(I first need to understand better what you did.)

Also, I really first want to take care of all fixes and corrections before starting to talk about new features.
(Please let us go step by step.)
 
Please explain...
7. Trade Groups for Automation
8. Adaptation of Super Forts

Sorry, but I won't write about these again as I don't have infinite time. ;) "Super forts" has been written about on "Mod development". "Trade groups" on my mod-mod thread. Basically, it allows you to "Save" a group of trade routes that you have selected for a unit as one group. You can then load it at a later point for that unit or another unit. You can also delete that unit. I will be ok to clarify on any questions though :)
 
Top Bottom