RFCE 1.3 Playtest Feedback

The file isn't really a fix. I just made every unit ignore building defenses. This temporarily solves many CTD, but at a costs that Walls have become completely obsolete.

However, this info can point us in the right direction where to find the bug.

EDIT: And Star Forts have permanent defence bonuses which may cause the third condition?

I had some thoughts myself that the Star Fort could be the cause of the CTD. Maybe the game can't handle the permanent defense in combination with a city attack bonus and bombardable defense?
 
The file isn't really a fix. I just made every unit ignore building defenses. This temporarily solves many CTD, but at a costs that Walls have become completely obsolete.

However, this info can point us in the right direction where to find the bug.



I had some thoughts myself that the Star Fort could be the cause of the CTD. Maybe the game can't handle the permanent defense in combination with a city attack bonus and bombardable defense?

That explains why it is still happening in the late game - I played a bit with the Dutch, and WBed around to see what was happening, and star forts still provided 25% defence IIRC.

The star fort explanation would make sense, but then why did the original CTD usually happen back in the 900s before star forts came around? That would imply that back then it was walls and castles which were causing the problem. In fact, possibly just castles as the CTD never happened in the period from 500-900AD despite the barbs regularly razing Thessaloniki in this period?
 
That explains why it is still happening in the late game - I played a bit with the Dutch, and WBed around to see what was happening, and star forts still provided 25% defence IIRC.

The star fort explanation would make sense, but then why did the original CTD usually happen back in the 900s before star forts came around? That would imply that back then it was walls and castles which were causing the problem. In fact, possibly just castles as the CTD never happened in the period from 500-900AD despite the barbs regularly razing Thessaloniki in this period?

The new star fort ability was introduced in around rev 665. (And the sourcecode uploaded in rev 677)

I got a crash capturing independent London so I think walls are part of the problem as well.

That save of yours provided the base setting for the testing I did.
 
The new star fort ability was introduced in around rev 665. (And the sourcecode uploaded in rev 677)

What about removing the star fort 25% ability and its sourcecode and seeing if that solves the problem?

Imo star forts are not so important that it's worth compromising the overall stability of the mod. Maybe just give star forts give a further 50% reduction to bombard effectiveness and a stability bonus rather than the current 25% permanent defence if that might be a source of problems?
 
Why would it cause a crash though? Is there some sort of bizzare combat calculation going wrong? Do you know at what point it's crashing?
 
I did some testing with a similar setting. A CTD will only happen the following conditions (all 3) are met:

1. The attacking unit has a positive city attack modifier.
(City attack from CR promotions don't cause a CTD)
2. The attacking unit doesn't have the <bIgnoreBuildingDefense>.
3. The defending city has a Wall or another defense raising building.

If one of the conditions isn't met, you don't get a CTD.



I've attached a test file. Unzip it in the Assets/XML/Units folder of the mod. Can someone check if you still get CTD with this file? (Latest SVN)

Looks very promising :king:
 
Success! One more CTD in 1570, then a full Dutch autoplay, all the way through with no CTD. Great work merijn, the issue isn't 100% fixed, but definitely good enough to work on the other aspects of the mod and look towards 1.3 imo.

The file isn't really a fix. I just made every unit ignore building defenses. This temporarily solves many CTD, but at a costs that Walls have become completely obsolete.

However, this info can point us in the right direction where to find the bug.

Indeed
This is some very important information
I have some clues where to look, hopefully will be able to find the cause itself
 
Indeed
This is some very important information
I have some clues where to look, hopefully will be able to find the cause itself

Is it worth putting in a temporary SVN with star forts removed, or their 25% bombardment proof ability removed? We could run a few tests on that one too and see if it has any effect, could help see if it actually is linked to the star fort.
 
Ok, I tried some Dutch games with Merijn's unitinfos in SVN 1157.

First of all, I changed the SVN 1157 DLL with the 1026 one, as the only difference is in autosaves during autorun. In this way I would reload autosaves before the CTD.
Three different games, all crashed around 1356 AD, even reloading a previous autosave (for example, 1320, 1332 AD) I couldn't get the game to start.

Then I used the SVN 1093 DLL.
The first game crashed in 1504. I reloaded from 1485 and it came to the end, pardon, to the start.
The second game crashed in 1502. I had to reload from 1476, but then it was ok.
The third game didn't crash, it just went smooth.

Hope this makes sense.
 
:woohoo::woohoo::woohoo::woohoo:
I've got some great news. I found the source of the CTD!!! Fix is uploaded to the SVN (rev 1158) If you had my temporary fix, you can revert it back to the original file.

What was the bug?
Sometimes when you attack a city, you see a siege tower animation. According to the code, this will only happen if:
(Do you see the similarities with the list of conditions a put up earlier)
1. The attacking unit doesn't ignore defensive buildings.
2. The attacking unit has a city attack modifier bigger than what is defined at "MIN_CITY_ATTACK_MODIFIER_FOR_SIEGE_TOWER" in the GlobalDefines.xml (which is 10 in this mod)
3. The city has buildings who boost the defense (no matter if it's at full strength or bombarded away)
Actual code: (CvUnit.cpp)
Spoiler :
Code:
			if (getDomainType() == DOMAIN_LAND
				&& !m_pUnitInfo->isIgnoreBuildingDefense()
				&& pCombatUnit->plot()->getPlotCity()
				&& pCombatUnit->plot()->getPlotCity()->getBuildingDefense() > 0
				&& cityAttackModifier() >= GC.getDefineINT("MIN_CITY_ATTACK_MODIFIER_FOR_SIEGE_TOWER"))
			{
				CvDLLEntity::SetSiegeTower(true);
			}
What I did to fix it, is setting the value of "MIN_CITY_ATTACK_MODIFIER_FOR_SIEGE_TOWER" to 999. As no unit has such a big city attack modifier, the checks won't pass and the siege tower doesn't need to show up, which causes the CTD.

I "disabled" the siege tower animations for now. But I have some ideas how to bring it back.


EDIT:
I did manage to bring the siege tower back. The whole bug was the unitartinfo of the siege tower missing in UnitArtInfos.xml. MIN_CITY_ATTACK_MODIFIER_FOR_SIEGE_TOWER has been set to the original value.
 
Awesome, this is a huge step in the right direction, even if it's still not the direct cause in the source code. :goodjob:
Was looking through the c++ files in the last 2 days, trying to run through all the recent changes (recent as in the last couple hundred revisions), will continue it for some other clues
In the meantime I'm very curious for some feedback about the fix, whether it solves all the recent ctd's, or only most of them
 
Awesome, this is a huge step in the right direction, even if it's still not the direct cause in the source code. :goodjob:
Was looking through the c++ files in the last 2 days, trying to run through all the recent changes (recent as in the last couple hundred revisions), will continue it for some other clues
In the meantime I'm very curious for some feedback about the fix, whether it solves all the recent ctd's, or only most of them

I'm not really sure if there really is a cause in the source code. The CTD didn't happen because of a bug in the source code, but because it try to load a UnitArtInfo which didn't exist. A long time ago we had exactly the same problem.
 
I tried SVN 1159, Dutch game.
So far, three times started correctly and four times crashed during autorun.

In the save I attached, Portugal is about to attack the Scottish capital Dornach (!) with two bombards, a knight and a pikeman.
Deleting the knight in WB avoids the CTD.
Dornach has no walls, the knight has only a Combat II promotion.
 

Attachments

  • Willem van Oranje AD-1638 Turn 369 QuickSave.CivBeyondSwordSave
    1.5 MB · Views: 54
I tried SVN 1159, Dutch game.
So far, three times started correctly and four times crashed during autorun.

In the save I attached, Portugal is about to attack the Scottish capital Dornach (!) with two bombards, a knight and a pikeman.
Deleting the knight in WB avoids the CTD.
Dornach has no walls, the knight has only a Combat II promotion.

I get no crash when loading the save. If you load the game a few times, without doing anything (not removing the Knight), do you still get a CTD?
 
CTD for me when clicking end turn on PinkPallin's game:
 

Attachments

  • Capture.jpg
    Capture.jpg
    264.9 KB · Views: 129
I get no crash when loading the save. If you load the game a few times, without doing anything (not removing the Knight), do you still get a CTD?

I tried several times, always had a crash ending the turn if I didn't remove the knight.
 
Breaking news: my CTD happens only on Windows 10.
I set a Windows 7 virtual machine and I didn't get it. And I also couldn't get Civ 4 BtS running properly in a Windows 7 virtual machine on a Windows 10 host, whilst everything runs smooth in a Windows 7 VM on a Windows 7 host.
 
Breaking news: my CTD happens only on Windows 10.
I set a Windows 7 virtual machine and I didn't get it. And I also couldn't get Civ 4 BtS running properly in a Windows 7 virtual machine on a Windows 10 host, whilst everything runs smooth in a Windows 7 VM on a Windows 7 host.

Mine happens on Windows 8.1, haven't tried on any other machine.

merijn, what OS are you running?
 
My main computer's OS is windows 8.1, and I also still get some crashes on that one (with the siege tower fix)
While my older comp with an old OS runs most provided savegames without any issues, even without merijn's fix (if you guys remember that was my main confusion about the bug initially)
 
Top Bottom