Author Topic: CTDs and the limits of the engine  (Read 2874 times)

0 Members and 1 Guest are viewing this topic.

CTDs and the limits of the engine
So I'm dicking around with the editor, trying to make a Vasudan/Shivan BoE because why not. (I know BoEs are semi-frowned upon here, or at least were in the past, but this one is actually working really well. But that's a matter for another thread.) Unfortunately, I'm occasionally getting CTDs.

Now, this is a big mission. I'm throwing a lot at the game -- there are like eight destroyers, ten or so corvettes, and twenty to thirty cruisers, plus a bunch of fighter and bomber wings. I would understand completely if there were performance issues. But there aren't -- my framerate is a perfect 60 (or whatever it normally is, anyway. It's easy to tell because of the frame overlap of the pulses from my guns.)

But from time to time -- usually about five to ten minutes into the mission, I think -- the game freezes up, then crashes.

Anyway, is this a known issue? Is there an easy solution, or am I just pushing the game harder than it can take? I haven't added all the fighters I was planning to yet, so if the problem can't be fixed I'll have to rearrange some things.

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: CTDs and the limits of the engine
The only way to figure this out, unfortunately, is running a debug build to see if you can reproduce the issue, and if you can, to send us the log it generates.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 
Re: CTDs and the limits of the engine
Oh, right, that's how you get the log. I couldn't remember; I thought it was an option in the launcher somewhere. Yeah, I'll work on doing that.

EDIT: Alright, here we go. I was able to reproduce the issue.

Also it said a ship (one of the Dragon fighters, specifically) "rotated too far" one of the times it crashed (I was using debug, but not windowed, so I had to redo it). I have no idea what that means.  :confused:

[attachment deleted by admin]
« Last Edit: October 04, 2016, 12:43:55 pm by Kestrellius »

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: CTDs and the limits of the engine
Code: [Select]
ASSERTION: "sw->num_objs_hit < SW_MAX_OBJS_HIT" at shockwave.cpp:330
Congratulations! You have a shockwave that's hitting more than 64 unique objects during its lifetime. That's... honestly rather impressive.

No, there's not really anything to be done about that except reduce mission clutter so that shockwaves hit fewer objects. Sorry.

Also it said a ship (one of the Dragon fighters, specifically) "rotated too far" one of the times it crashed (I was using debug, but not windowed, so I had to redo it). I have no idea what that means.  :confused:
I honestly don't think anyone actually understands the purpose of that assertion... :v: appears to have been debugging a physics bug there at some point, but it's really unclear what the point of keeping it around now is.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: CTDs and the limits of the engine
...huh. I'm not sure how that would be happening. I guess most of it's probably debris? Or...does weapons fire count toward this? Non-destructible missiles and energy bolts and such?

Maybe I'll have the mission not contain any torpedoes. That might help.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: CTDs and the limits of the engine
...huh. I'm not sure how that would be happening. I guess most of it's probably debris? Or...does weapons fire count toward this? Non-destructible missiles and energy bolts and such?

Maybe I'll have the mission not contain any torpedoes. That might help.
No; only ships get stored in the object list, and weapons without hitpoints (and ones that can't be damaged by shockwaves) don't get processed anyway.

Additionally, running out of room in the list can't be the cause for your CTD in Release builds, because without that assertion it just reuses the last slot in the list for everything (so there's no invalid memory access going on).

EDIT: oh wait, lol, the code that ensures it's in a valid range executes after the code that uses it to iterate through the list of hit objects, so there is an invalid memory access going on (but, annoyingly enough, it happened before that assertion was triggered)
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 
Re: CTDs and the limits of the engine
Hm. Well, the shockwave from a destroyer exploding is pretty enormous, and the mission tends to degenerate into a ball of warships all clustered together toward the end, so maybe it is managing to hit 64 ships. But them getting all close together like that isn't a desired effect anyway, so I'll just have to work on fixing it.

 

Offline Mito [PL]

  • 210
  • Proud Member of Slavicus Mechanicus
Re: CTDs and the limits of the engine
Suggestion!
For testing purposes - isn't there a "Custom shockwave" parameter in FRED? Just set the range to something low enough and keep testing! :P
How do you kill a hydra?

You starve it to death.

 
Re: CTDs and the limits of the engine
Ooh, good idea. Thanks!

EDIT: Yeah, I haven't had any crashes since I disabled the shockwaves on the destroyers. Good call.
« Last Edit: October 05, 2016, 05:32:24 am by Kestrellius »

 
Re: CTDs and the limits of the engine
I've started getting crashes again, so I figured I'd make a log and post it in case anyone wants to help me decipher it. There's a whole lot of "could not create debris, no slots left" in there.

[attachment deleted by admin]

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: CTDs and the limits of the engine
Code: [Select]
-mod derelict,mediavps_2014,MediaVPs_2014
Well, that ain't right. You only need to include the mvps once (this shouldn't actually cause issues, but you never know)
Ultimately, this is a "this thing rotated too far" issue, which we really need to decide what we as coders need to do with; not a lot you can do there unfortunately. That there are no debris slots available is completely uncritical.

[/code]
« Last Edit: October 07, 2016, 10:41:32 am by The E »
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

  
Re: CTDs and the limits of the engine
I think that's an artifact from when I was playing Derelict, and wanted to do it with the MediaVPs? I just never got around to removing it from the custom flags. I have gotten rid of it now, though.