Hang Crash

Mattygerst

Prince
Joined
Jan 19, 2008
Messages
589
Location
St. Louis, Missouri, USA
Hello all,

I have a mod, which to this point has been incredibly stable. It is based off KMod, and incorporates Varietas Delectat and Mastery Victory Condition by Sevo - which has since been updated by karadoc.

A link to my mod can be found here: https://forums.civfanatics.com/threads/mmod.482015/

I have uploaded 4 saves ... because I was recently playing and encountered a hang crash in two different games, right around the same time, and I am not able to figure them out. Would anyone be so kind as to download my mod, and upload the saves to see what is causing the crash?

Uploads included:
1745: Plays thru
1750: Hangs
.
1790: Plays thru
1795: Hangs

Thank you to any and all who find it in their free time to help!
 

Attachments

When a game freezes, the problem is that it gets stuck in a loop where the end condition is never met. This mean the first step is to identify which loop it gets stuck in. My approach is to use a profile DLL, let it get stuck and then attach a profiler (I use very sleepy). The loop in question is then the loop, which use 100% of the CPU time.
 
First, thank you for the comment and your guidance.

Second, it may well have been in a different language, haha. I have zero experience with doing any of these things : /

However, I am more than willing to attempt to learn ... but, that would likely require step-by-step instructions. And even then, if I was able to identify what is causing the loop, I have zero ability to code or read code and, I imagine, would be unable to even address the issue
 
The bug has been found. It was an endless loop as the AI looked for more "basic" techs to add to their tech path. If there aren't enough techs to choose from, then they couldn't make their decision. It has not been fixed : )
.
I do have a question and request for anyone kind enough in the community, though.
.
Would you be willing to download my mod [here: https://forums.civfanatics.com/threads/mmod.482015/ ] and help me figure out how to add new civs and leaders? I'll give you some background as to why I ask. About two years ago, I incorporated Varietas Delectat into my mod and then I set about attempting to create several new civs and leaders. I had issues until I figured out that I had to "unpak" the Varietas Delectat file which had its own "civilizationinfos" and leader xmls which were IN ADDITION to the standard one that come in the Beyond the Sword Assets folder. However, now when I "unpak" the Varietas Delectat file ... the civilizationinfos file are no longer there. The standard 'civilizationinfos' is still in the regular assets folder, but it is clear that these do not used the customized art (essentially the game ignores these and uses the Varietas Delectat xml information). But ... now I can't find it and, therefore, can't add the new civs I need to add to create the scenario I want to create. Can you possibly help me out by looking into this to see what I might be missing?
 
Varietas Delectat comes with its own CivilizationInfos.xml, which defines new unit and building art styles for all civs that exist in the base game. It is not in the *.fpk file, if that's what you were attempting to do. If you have added additional civs, you need to include them in this file as well or VD will not affect their art. But even when ignoring this file you can add civs without problem.
 
Leoreth ... thank you for the reply. Two years ago, when I was adding so many new civs / leaders using Varietas Delectat, I swear thats where I found them. I even have an email to myself of the instructions to follow. But, those same directions don't work now, as the folders seems to have changed? Where is the civilizationsinfos.xml file located? Haha, I promise I've checked every single folder I can find in the mod (and the game DOES use Varietas Delectat when played), but I can't find the .xml folder for the life of me...
 
I don't know how Varietas Delectat is installed (custom assets or modular or merged into another mod). If it's a standalone mod, it is always in Assets/XML/Civilizations/. In a module, find it in Assets/Modules/<module name>/XML/<some folder>/. My copy of the modular VD has it in a folder called "UnitArtStyles&CivInfos".
 
EDIT:

I'll leave the previous, original post below and update here: Actually, I don't think I'm in the right folder, still ... bc Netherlands uses the artstyle Euope ... and NOT the artstyle Holland .... UNLESS the folder found within MMod -> Assets -> Modules -> Varietas Delectat -> XML ->UnitArtStyles&CivInfos overrides the information found in MMod -> Assets -> xml -> Civilizations ?? If this isn't make sense to you, I can clarify in a new post. Basically, my CivilizationInfo has a UnitArtStyleType in the folder containing all of the civilizations which does not mention the UnitArtStyles of the Varietas Delectat folder ... but, somehow, the game is able to use the Varietas Delectat art and I don't see how it is making the connection??
.
begin previous post...

Again, thank you for the quick replies.

This will make me feel and probably seem like a fool. But perhaps I've been staring at the actual Varietas Delectat folder the entire time, and the few years away from modding the game has caused me to forget. The below entry is from America ... which uses the ArtStyleType ANGLO_AMERICA. I just want to be sure, but I think this is only used in Varietas Delectat, no? Which would mean I have had the correct folder identified the entire time, but had just forgotten how the art styles were labeled...

<CivilizationInfo>
<Type>CIVILIZATION_AMERICA</Type>
<Description>TXT_KEY_CIV_AMERICA_DESC</Description>
<ShortDescription>TXT_KEY_CIV_AMERICA_SHORT_DESC</ShortDescription>
<Adjective>TXT_KEY_CIV_AMERICA_ADJECTIVE</Adjective>
<Civilopedia>TXT_KEY_CIV_AMERICA_PEDIA</Civilopedia>
<DefaultPlayerColor>PLAYERCOLOR_BLUE</DefaultPlayerColor>
<ArtDefineTag>ART_DEF_CIVILIZATION_AMERICA</ArtDefineTag>
<ArtStyleType>ARTSTYLE_ANGLO_AMERICA</ArtStyleType>
<UnitArtStyleType>UNIT_ARTSTYLE_EUROPEAN</UnitArtStyleType>
<bPlayable>1</bPlayable>
<bAIPlayable>1</bAIPlayable>
 
Last edited:
I'll leave the previous, original post below and update here: Actually, I don't think I'm in the right folder, still ... bc Netherlands uses the artstyle Euope ... and NOT the artstyle Holland .... UNLESS the folder found within MMod -> Assets -> Modules -> Varietas Delectat -> XML ->UnitArtStyles&CivInfos overrides the information found in MMod -> Assets -> xml -> Civilizations ??
That's exactly how it works. Everything that is in a modules folder overrides what is in the base folders.
 
That's exactly how it works. Everything that is in a modules folder overrides what is in the base folders.

Okay ... so then, here is my question, just for general knowledge. If the civilizationinfos for netherlands uses unitartstyle european, but then the modular folder has unitartstyle holland ... how is the game matching up the holland units with netherlands? Where is that connection being made? Because I would assume that the civilizationinfos, which contains unitartstyletype ... for each particular civ ... is somehow knowing to using the unitartstyle types from varietas delectat? Are you following what I'm saying?
 
Last edited:
I think, but I'm not sure what the point is that confuses you. Consider a mod with a set of base files and the content in Assets/Modules. Everything that exists in the modules folders is a changed version of a file in the base mod. Now when the mod is loaded, first the base mod files are loaded, then the files in the module folder(s). Each individual entry (this might be the important part?) in a module file overrides the existing entry from a base file. If an entry exists in a base file but not in a module file, it is still part of the mod. Only with this assembled set of overall entries will references be resolved.
 
The bug has been found. It was an endless loop as the AI looked for more "basic" techs to add to their tech path. If there aren't enough techs to choose from, then they couldn't make their decision. It has not been fixed : )
I assume you mean "now been fixed" :lol:

One thing you should be aware of is that the game engine makes a number of assumptions about the contents of xml. While it's ok to have requirements, the problem is that it really just assumes without checking and if you fail to meet requirements, something will go wrong and it won't tell you what went wrong. Your game froze, but it's also possible that it will just crash on map making.

I have tried to improve on this problem, but adding data verification has turned out to be a tricky problem. Part of the problem is that getting the limitations is not easy and the other part is designing the actual code to check. I did put some code into Medieval Conquest for this, but it's so modified compared to vanilla that moving the code to any other mod is close to remaking it from scratch.

The alternative to proper error messages is to debug (or in this case profile) the game at runtime to figure out what goes wrong. In other words even if the problem is triggered by changing xml, it requires C++ knowledge to systematically figure out what went wrong. This is the main reason why the lack of error messages is an issue.

As scary as this may sound, when such a problem occurs, it is usually fixed. It might take 10 minutes and it might take days. It all depends on when a skilled modder has time to spare. When you get experience changing xml files, you will learn what to do and what not to do and the risk of issues will decrease.
 
I think, but I'm not sure what the point is that confuses you. Consider a mod with a set of base files and the content in Assets/Modules. Everything that exists in the modules folders is a changed version of a file in the base mod. Now when the mod is loaded, first the base mod files are loaded, then the files in the module folder(s). Each individual entry (this might be the important part?) in a module file overrides the existing entry from a base file. If an entry exists in a base file but not in a module file, it is still part of the mod. Only with this assembled set of overall entries will references be resolved.

Here is the part that confuses me. Say I am going to create a new civilization, and I'm going to start with "America" and copy it to create "United State of America" as my new civ. When I would copy the "America" civ and paste the XML date and then change the civilization name to "United States of America" ... the unitartstyle will say "European" instead of "USA" (which is what Varietas Delectat uses for "America.") So, my question is ... where is the 'connection' found whereby the game is choosing to use the unitartstyle of Varietas Delectat? To try to put it simply ... the Varietas Delectat unitartstyle doesnt have anything to reference the civilization it is tied to in the regular civilizationinfos xml. <-- Does this last sentence make more sense?
 
If it's still called CIVILIZATION_AMERICA in the base file (or whatever) then CIVILIZATION_AMERICA in the VD files will still override it.
 
If it's still called CIVILIZATION_AMERICA in the base file (or whatever) then CIVILIZATION_AMERICA in the VD files will still override it.

I think I'm not being clear with what Im trying to explain, probably bc I dont know exactly how to. So, to attempt to clarify, I'm going to attach three pictures ...

Pic #1: You can see the path in the address bar. This is where the civilizations are found in my mod. As you can see, 'America' is: CIVILIZATION_AMERICA, as you say in your post above. This much I understood, already. However, if you look down below, you'll see it is using UNIT_ARTSTYLE_EUROPEAN.

Pic #2: I am using this pic for reference to show you how the assets -> modules folder is set up. You can see here that there is no reference to CIVILIZATION_AMERICA, but instead, to VD_USA_Civ4UnitArtStyleTypeInfos

Pic #3: Here you can see the contents of the VD_USA folder. You can see that there is UNIT_ARTSTYLE_USA

Now to my point ... I don't understand how the VD_USA unit art is connecting to CIVILIZATION_AMERICA. There seems to be some sort of missing piece? Shouldn't there be a reference in CIVILIZATION_AMERICA whereby the UnitArtStyle is connected to VD_USA and vice versa?
 

Attachments

  • 1.jpg
    1.jpg
    240.4 KB · Views: 147
  • 2.jpg
    2.jpg
    329.3 KB · Views: 189
  • 3.jpg
    3.jpg
    226.2 KB · Views: 180
As I already said, there is a second CIV4CivilizationInfos.xml that comes with VD. It's right there in your second screenshot.

In general it's helpful to use an editor that can search entire directories, I'm using notepad++ for example. This way you can easily find all references to a value, including where it is defined or brought into relation with another entry.
 
Back
Top Bottom