Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: General Battuta on February 03, 2014, 11:16:01 pm

Title: Help me solve this CRAZY ERROR! edit: alter-ship-flag is ****ed
Post by: General Battuta on February 03, 2014, 11:16:01 pm
We've been beating our heads against this problem on IRC for an hour now.

Here's the error:

Quote
Assert: ss
File: ship.cpp
Line: 16871

kernel32.dll! WaitForSingleObjectEx + 68 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! SCP_DumpStack + 354 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! WinAssert + 194 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! ship_subsys_is_fighterbay + 60 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! ship_fighterbays_all_destroyed + 108 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! ship_get_ship_with_dock_bay + 183 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! ai_mission_goal_achievable + 260 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! validate_mission_goals + 128 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! ai_process_mission_orders + 102 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! ai_frame + 262 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! ai_process + 284 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! ship_process_post + 1858 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! obj_move_all_post + 780 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! obj_move_all + 428 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! game_simulation_frame + 1112 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! game_frame + 501 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! game_do_frame + 231 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! game_do_state + 403 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! gameseq_process_events + 232 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! game_main + 782 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! WinMain + 328 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! __tmainCRTStartup + 296 bytes
fs2_open_3_7_1_BP_SSE2-DEBUG.exe! WinMainCRTStartup + 13 bytes
kernel32.dll! BaseThreadInitThunk + 18 bytes
ntdll.dll! RtlInitializeExceptionChain + 99 bytes
ntdll.dll! RtlInitializeExceptionChain + 54 bytes

It occurs briefly after the mission transitions into subspace and most of the ships previously present depart via no-warp-effect, but only if before this point the player has gone through a series of events involving docking with a support ship which then ordered to depart (but which quite reliably fails to follow this order...)

Here's the log: http://pastebin.com/z1ShDB8m

Note that it's going through departures (it seems to me) right before it crashes.

I'm continuing debug work on this using some gnarly-ass improvised mission breakpoints to try to isolate the causal factor. So far I can confirm that if the support ship never enters the mission the crash does not seem to occur.
Title: Re: Help me solve this CRAZY ERROR!
Post by: General Battuta on February 03, 2014, 11:22:21 pm
Let me add details on the support ship stuff: the support ship has its orders cleared then a 101-priority warpout goal added. A second later the maximum concurrent number of support ships in the mission is set to 0. The support ship freezes in place and stops responding to orders - so clearly these have to be related, right, but I can't repro this freezing behavior in a test mission...
Title: Re: Help me solve this CRAZY ERROR!
Post by: Black Wolf on February 04, 2014, 12:10:55 am
Have you tried delaying the maximum number of support ships sexps until after has-departed, rather than one second? That might be confusing it?
Title: Re: Help me solve this CRAZY ERROR!
Post by: General Battuta on February 04, 2014, 12:30:44 am
After madness and wrath I have chased this bug back to its ****ing lair: alter-ship-flag.

If alter-ship-flag (no subspace drive) (true) (true) (Alpha 1) fires at mission start, support ships lose their subspace drive.

If a support ship is ordered to depart after this, it will freeze and stop accepting all orders.

If there is a ship with a fighterbay nearby, it will apparently think about departing there, but never attempt to.

If all nearby ships with fighterbays then leave the mission, the mission instantly crashes.

If there is no ship with a fighterbay in the mission, you cannot order the support ship to depart.

I HAVE TRACKED DOWN THIS ****ING BUG. Retail assets repro mission attached. Includes all instructions to repro.

[attachment deleted by an evil time traveler]
Title: Re: Help me solve this CRAZY ERROR! edit: alter-ship-flag is ****ed
Post by: General Battuta on February 04, 2014, 12:41:22 am
Mantised.
Title: Re: Help me solve this CRAZY ERROR! edit: alter-ship-flag is ****ed
Post by: karajorma on February 04, 2014, 09:08:43 am
Since I made the alter-ship-flag, I'm going to point out that the error isn't its fault but the fault of whoever decided to automatically turn off jump drives on support ships if the player doesn't have one. :p

Title: Re: Help me solve this CRAZY ERROR! edit: alter-ship-flag is ****ed
Post by: General Battuta on February 04, 2014, 09:10:53 am
I figured it was something like that - nothing personal!
Title: Re: Help me solve this CRAZY ERROR! edit: alter-ship-flag is ****ed
Post by: Spoon on February 04, 2014, 11:18:18 am
Once more we witness Battuta venture forth to complete a quest of evil bug slaying.
Title: Re: Help me solve this CRAZY ERROR! edit: alter-ship-flag is ****ed
Post by: Shivan Hunter on February 04, 2014, 05:20:48 pm
Since I made the alter-ship-flag, I'm going to point out that the error isn't its fault but the fault of whoever decided to automatically turn off jump drives on support ships if the player doesn't have one. :p

svn blame~
Title: Re: Help me solve this CRAZY ERROR! edit: alter-ship-flag is ****ed
Post by: karajorma on February 04, 2014, 07:14:39 pm
I was being tactful. :p