Alpha Centauri 2

Sid Meier's Alpha Centauri & Alien Crossfire => Modding => Bug/Patch Discussion => Topic started by: vidyajames on May 28, 2019, 02:53:16 AM

Title: Save keeps crashing on AI turn
Post by: vidyajames on May 28, 2019, 02:53:16 AM
I'm well into a game using Scient's patch with PRACX over top. Now I'm getting consistent crashes during the AIs turn in this one spot. I tried on a fresh installation with Yitzi's patch and I get the same thing. I've attached my save file, the issue can be replicated simply by ending the turn.

Any help would be appreciated.

EDIT: Turns out this issue is related to PRACX, I used bad troubleshooting practice and installed PRACX over Yitzi the first retry. Still an issue, but I'll just play without it I guess.

EDIT 2: It's just intermittent, it happens without PRACX. As well.
Title: Re: Save keeps crashing on AI turn
Post by: scient on June 14, 2019, 04:50:21 AM
I confirmed this crash happens intermittently in the vanilla SMACX game (seems like 75% of the time). It happens inside has_abil() function when doing a check for Pirates "Marine Detachment" ability with Adaptive Doctrine (so SMAC is likely unaffected). Something with the memory gets garbled. Because of how the game crashes and state it is left in, it is hard to pin down exact cause. I spent probably too much time trying to track down the problem. It may have to do with how Player data is parsed in as well since the crash is caused by the equivalent of this line:
Code: [Select]
int abilBonusID = Players[factionID].factionBonusVal1[i];
if (has_tech(Ability[abilBonusID].preqTech, factionID) && ..

Something causes abilBonusID to be way out of bounds so game crashes trying to access preqTech value. While I wasn't able to track down the exact cause, I can say that my dll version is unaffected. I fully loaded/unloaded the game about 10-15 times and save never crashed.  :)
Templates: 1: Printpage (default).
Sub templates: 4: init, print_above, main, print_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 31 - 840KB. (show)
Queries used: 16.

[Show Queries]