Modding PlanetTraitDefs.xml is crashing the game... would appreciate any insight

I'm pretty new to modding GalCiv3 (only just recently found it that this was a possibility), and I seem to be running into an issue.

I wanted to created my own Civilization, complete with starting system and planets. I had successfully set everything up and had played a complete game with the mod. I tried to start another game, though, and this caused my game to crash. I was confused because I thought I had already verified that my mod worked.... It turns out I must have gotten lucky, because eventually (after crashing and re-opening the game many times) I  was able to start another game without it crashing. 

After quite a bit of time removing, modifying, and simplifying files to try to nail down what was causing the issue, and I'm very confident that the issue is coming from PlanetTraitDefs.xml. 

For whatever reason, when I add a new <PlanetTrait>, this *usually* causes my game to crash once I try to start a match (one in every 5 to 10 tries will work). Just to make sure I wasn't putting in some invalid values, I tried completely copying a pre-existing PlanetTrait and just modified the name - and I got the same crashing results.

Here is what I added to PlanetTraitDefs.xml at the beginning of the PlanetTraitList (direct copy of TidallyLockedWorld, except for the names):

  <PlanetTrait>

    <InternalName>Ascendant_World</InternalName>

    <DisplayName>AscendantWorld_Name</DisplayName>

    <Description>AscendantWorld_Dec</Description>

    <RelativeWeight>10</RelativeWeight>

    <PlanetClassSelect>

      <MinPlanetClass>8</MinPlanetClass>

      <MaxPlanetClass>14</MaxPlanetClass>

      <Weight>100</Weight>

    </PlanetClassSelect>

    <EffectModifier>

      <EffectType>Manufacturing</EffectType>

      <Target>

        <TargetType>Colony</TargetType>

      </Target>

      <BonusType>Multiplier</BonusType>

      <Value>0.25</Value>

    </EffectModifier>

    <EffectModifier>

      <EffectType>TradeRouteValueRaw</EffectType>

      <Target>

        <TargetType>TradeRoute</TargetType>

      </Target>

      <BonusType>Multiplier</BonusType>

      <Value>0.25</Value>

    </EffectModifier>

  </PlanetTrait> 

 

Anyone have insight into why this would be causing my game to crash upon starting a new match?

Edit: Forgot to note - I'm using the base version of the game with no other mods.

10,812 views 5 replies
Reply #1 Top

I didn't try to modify PlanetTraitDefs.xml yet, but I looked into it: <RelativeWeight> seems to add up to 200 in the file for all definitions, perhaps that number has to be preserved if you add more definitions?

Reply #2 Top

Tried changing the RelativeWeight to 0, still no dice - getting crashes.

Reply #3 Top


Anyone have insight into why this would be causing my game to crash upon starting a new match?
Edit: Forgot to note - I'm using the base version of the game with no other mods.

I've edited that file (Crusade), launches okay. Did you look at the last few lines of debug.err? Right after the CTD, look there. It usually gives clues to the issue.

Reply #4 Top

My debug.err file only says this:

"Debug Message:  Command Line: "

There were over 100 lines of that, so I deleted it, recreated the crash and looked at it again - now it only has that single line.

Edit: I noticed the other debug.err file in the Tools folder, so I took a look at that one. Unfortunately there's no real clues in there, either. The last few lines are about reading .xml files, and this gets done as soon as I get to the Main Menu of the game. This file doesn't get updated with any additional messages once I try to launch a game.

 

Edit update: I'm not sure if I wan't modifying the correct files originally.... or some magic happened, but now it's not crashing when I simply edit the PlanetTraitDefs.xml. However, it continues to crash if I actually *use* a newly created trait (I made a new starting system and am trying to have the starting planets have traits.) It works fine if I use a different (pre-existing) trait, but crashes if I use my new trait. 

 

EDIT - RESOLUTION: I can't make another reply to this thread due to having a new account, but I wanted to put the resolution in here somewhere. Thanks pheonixstorm for the idea of doing a content search of the entire data directory for how planet traits are used (not sure why I didn't think of that in the first place....) It turns out that I also needed to add an art definition for the new trait within PlanetArtDefs.xml. I copied an existing one, renamed it to my new planet trait, and the crashes are now resolved.

Reply #5 Top

Have you studied how the other traits work over ALL the files? If its crashing you may be missing something somewhere.