[Fix] Very tricky Entrenchment crash bug. Needs confirmation.

I believe I have identified a crash bug in Entrenchment.  It involves the AI, frigate entity types, Squad definitions and Command Points.

Basically, it appears to me that if you have more command points on a frigate/cruiser than you have unique squad defs in place, the game will crash when the AI even starts to think about using it.  The entity will be fine if you use this as a player, this is an AI ONLY bug.

I have repeated the crash in my own testing but some independant confirmation would be nice.  I will then submit a bug report to the devs.

To quickly and easily test and confirm, you can do the following:

1)  Create a new mod folder under your Entrenchment mods folder. Call it whatever you like.

2)  Copy <Sins Dir>/Entrenchment/entity.manifest into your new mod's folder.

3)  Create a GameInfo folder under your new mod's folder.

4)  Copy an editable TXT version of one of the stock race's carrier frigate into your new mod's GameInfo folder.

5)  Open the entity file for the carrier frigate and set maxNumCommandPoints one higher than it already is (IE 3 for TEC/Vasari, 4 for Advent).

-Fire up Dev Mod and load your new mod, it should load just fine.  Start a game.  Make sure that you have an AI using the race you modded the carrier for, set them to hard to speed things up.  I would add a couple more AIs using the other, non-modded races just to be sure the game has enough activity.

-Set the game speed to x8 and wait.  It should crash within a few minutes - once the AI using the modded carrier tries to go for carriers.

-DO NOT help the AI along.  This crash ONLY happens when it's the AI who tries for carriers all by itself.

-If you want speed things up, set the pre-requisites to 0 and lower the costs of your modded carrier so they are accessible right off the bat.  The game should then crash within a a minute or two, if not a few seconds.

I have not had the opportunity to test this, but I suspect if you were to add a third (or fouth for the advent) squad def (say the combat/bomber squad for one of the other races) to your modded carrier entity, it would no longer crash.  My theory is that it only happens when there are more Command points than there are Squads defined.

It took me over a week of hair pulling to figure out why my mod was crashing for no apparent reason.  This seems to be the cause.  If you can confirm this crash bug, please post in this thread and let me know.

-dolynick

13,777 views 15 replies
Reply #1 Top

This is a popular one in the support email. If you define command points for something you have to define the corresponding squad defs. Its like defining N many elements in an array and then not filling them out (a very common operation in many of the Sins data files). Not filling them out will crash the game.

Reply #2 Top

Thanks for confirming Blair.

So, just to be clear for everyone...  As it applies to frigates (and only frigates)...

This is OK:

squadTypeEntityDef:0 "SquadTechCombat"
squadAntiMatterCost:0 90.000000
squadTypeEntityDef:1 "SquadTechBomber"
squadAntiMatterCost:1 150.000000
squadTypeEntityDef:2 ""
squadAntiMatterCost:2 0.000000
squadTypeEntityDef:3 ""
squadAntiMatterCost:3 0.000000
maxNumCommandPoints 2

This will cause the AI to minidump the game:

squadTypeEntityDef:0 "SquadTechCombat"
squadAntiMatterCost:0 90.000000
squadTypeEntityDef:1 "SquadTechBomber"
squadAntiMatterCost:1 150.000000
squadTypeEntityDef:2 ""
squadAntiMatterCost:2 0.000000
squadTypeEntityDef:3 ""
squadAntiMatterCost:3 0.000000
maxNumCommandPoints 3

Capital ships, planet modules and star bases will work fine for the AI with either example.

-dolynick

Reply #3 Top

If I'm understanding this right (and I assume I am), this sort of thing is why people complain about the more arbitrary hardcoded limits. I wish the capitalship entitytype was available for usage outside the cap factory so people could circumvent all this craziness (padding frigates out with duplicate squad defs just to get a certain # of squadrons to work??? why is # of command points linked to # of types of fighters in the first place?). It's already a pain in the ass to port stuff to Entrenchment and it seems like a one step forward two steps back sort of thing for these sort of things to pop up. Or people can work around it by using a passive buff to add fighters, but since you're limited to 5 abilities and to do any heavy, TC-level changes to ship-based gameplay requires at least a couple ability slots, that's not really an option.

Reply #4 Top

Well, the strange thing about this issue is that it's not a universal crash bug.  If you do the first example and load up the thing as a player, you can build all three command points worth of the 2 squad defs just fine.  No problem at all.  If you let the AI use it though, the game will minidump as soon as the AI decides it want's carriers.  It was really tough to spot the cause of my crashing because the minidump occurs when the AI decides to research carriers, not build one.  You don't even see the research start for carrier access so it just looks like a random minidump.

I haven't actually tried using the same squad def twice in the 4 slots.  If it works, then it would be a feasible workaround, if a bit wierd.  In my case, I had some really big carrier ships with 6 and 8 squads each.  My only option was to actually increase the squad size instead and cut the number of squads.  Unfortunately, 1 squad of 20 fighters is not the same as 4 squads of 5 fighters despite combat damage and stats being effectively equal.

-dolynick

Reply #5 Top

Re; it being AI only: that's fine I guess, but can you imagine working on a TC mod for 1-2 years, incorporating all the Entrenchment stuff into it, etc, then saying the thing's MP-only because the AI can't build strike craft properly? To me that seems hilariously broken.

I'd imagine the same squad def would be broken, so you'd probably have to rename one. But to impact usability like that is crazy.

Reply #6 Top

squadTypeEntityDef:0 "SquadPsiCombat"
squadAntiMatterCost:0 90.000000
squadTypeEntityDef:1 "SquadPsiBomber"
squadAntiMatterCost:1 150.000000
maxNumCommandPoints 3

 

From vanilla's frigatepsicarrier.entity file, text version. unmodified.

Reply #7 Top

I've tested it with 4 squad types and 2 command points, and it didn't crash.

So as Dolynick thought, duplicating the squadtypes (ie 2 slots of fighters, 2 slots of bombers) fixes the bug... upto 4 command points anyhow. I haven't tried any command points greater than 4 though.

Reply #8 Top

squadTypeEntityDef:0 "SquadPsiCombat"

squadAntiMatterCost:0 90.000000

squadTypeEntityDef:1 "SquadPsiBomber"

squadAntiMatterCost:1 150.000000

maxNumCommandPoints 3



From vanilla's frigatepsicarrier.entity file, text version. unmodified.

The thread title clearly states "Entrenchment" crash bug.  No one ever said there was a problem in vanilla Sins.

-dolynick

Reply #9 Top

The thread title clearly states "Entrenchment" crash bug. No one ever said there was a problem in vanilla Sins.

-dolynick

then maybe consider that i was suggesting removing the empty squad defs?

Reply #10 Top

Ah, I see what you were getting at.  I doubt it will work though.  Even ships with no command points in Entrenchment have slots for 4 squad defs even if left blank.  I'm almost positive the engine will throw and error if they aren't there (even if blank) as it will be expecting that as it's next line for a frigate type entity.

-dolynick

Reply #11 Top

Sadly, this also causes problems of a different sort:

squadTypeEntityDef:0 "SquadTechCombat"
squadAntiMatterCost:0 90.000000
squadTypeEntityDef:1 "SquadTechBomber"
squadAntiMatterCost:1 150.000000
squadTypeEntityDef:2 "SquadTechCombat"
squadAntiMatterCost:2 0.000000
squadTypeEntityDef:3 "SquadTechBomber"
squadAntiMatterCost:3 0.000000
maxNumCommandPoints 3

The game will freeze (not minidump) when either a player or the AI attempts to build strikecraft on a carrier set up like that.  It appears that each squad def does have to be a unique entity from the others.

-dolynick

Reply #12 Top

i don't think its only frigates. i made the changes, and it still crashed. this is the most frustrating bug i have encountered.

Reply #13 Top

Quoting wrath2552, reply 12
i don't think its only frigates. i made the changes, and it still crashed. this is the most frustrating bug i have encountered.

Changes to what?  I know you are having trouble with my SG-Races mod but this particular bug has been worked around in the current release version of that mod.

-dolynick

Reply #14 Top

well, at random points in the game, 2-3 minutes in, it just crashes. no minidump. it is your unchanged mod i am using. the changes i was refering to was changing the number of command points to the above ststed appropriate number, yet it still crashes with no minidump. i am out of ideas. i was trying to blend it with sins plus, and partialy suceeded, but then the crashes got too great and too frequent. i reverted back to your mod without my modifications, and it still crashes. i thought making these corrections in this forum would help, but they didn't.

Reply #15 Top

I took another shot at workarounds to this issue and discovered another important little bit about it.

Once you fill in all 4 available squad definitions, you may exceed the # squad defs >= command points limit.

So, to rehash the issue:

-With two available squad defs filled in, you may only have 2 or fewer command points on a frigate.

-With three available squad defs filled in, you may only have 3 or fewer command points on a frigate.

-If all four squad defs are filled in, you may have as few or as many command points as you see fit.  I tested with 4, 8 and 12 command points and it works fine.

Blair mentioned to me that it had to do with array lists being used for squads.  It would seem that if there is an blank entry in the array list of squad defs and the command points are high enough to allow building of more squads than there are types definied, the AI will cause the game to minidump.  If there are no blank entries then the AI has no issues with any number of command points.

Once again, this only applies to entity type "frigate" entities.

-dolynick