View Issue Details

IDProjectCategoryView StatusLast Update
0000628FSSCPFREDpublic2006-04-19 19:37
Reportertaylor Assigned Tophreak  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionopen 
Summary0000628: FRED2 CTD from incorrent object type reassignment
DescriptionDidn't plan on filing this but I really don't have time to debug it any further than I have already. As reported by CP5670, FRED2 will CTD when adding two ships to a particular mission. The reason for the crash is obvious enough, though I don't know the base cause.

The creation on one ship appears to work properly though it may suffer from this same problem, just without the out-of-bounds crash. The creation of the second additional ship will always CTD. The reason is that the ship object, although created and initially assigned properly, will apparently end up getting converted to a waypoint object type for some reason. It later still tries to process as a ship but the instance value is far out of bounds for Ships[]/Ship_info[]. Note that both of the additionally created ships will get this treatment, though the first added ship will not have a bad instance value.
Additional InformationData and mission is available from this post:
http://www.hard-light.net/forums/index.php/topic,36107.msg754268.html#msg754268

It has affected every FRED2 build that I've tried off of warpcore the same way.
TagsNo tags attached.

Activities

Goober5000

2005-11-28 23:37

administrator   ~0003946

I'll take a look.

Ransom Arceihn

2005-12-07 17:46

reporter   ~0003975

I think I just encountered this too. Although in the mission it happened to me with it crashes on the third new ship placed. I also found that if I save the mission before placing the third ship, then it lets me place another two ships before crashing again.

redmenace

2005-12-07 22:56

manager   ~0003976

When did this start to show up in cvs?

Ransom Arceihn

2005-12-08 10:32

reporter   ~0003977

It seems to have happened somewhere between Goober's 15 July 2005 build and the 29 September build. I couldn't find any builds between those.

Goober5000

2006-02-02 09:26

administrator   ~0004636

Just tried this in the current CVS and it worked. Is it still a problem?

Goober5000

2006-02-10 18:43

administrator   ~0004710

It's been working for me on whatever I've tried, only I can't try it on CP's mission because his link is broken. Is it still a problem?

Goober5000

2006-02-10 18:43

administrator   ~0004711

Reminder sent to CP5670

Bump.

CP5670

2006-02-10 22:24

reporter   ~0004712

Sorry, didn't know anyone still needed that file. I'm not on my main machine now but will put it here a bit later: http://home.comcast.net/~cp5670/PI.rar

This bug is still there as far as I know. The mission in question is called PI11.fs2 .

SadisticSid

2006-02-13 16:45

reporter   ~0004735

This still happens for all the recent Inferno FREDs since September as well, adding the first ship works, but adding a second of any class will cause an immediate CTD.

Goober5000

2006-02-13 16:48

administrator   ~0004736

In a blank mission?

Because adding ships to blank missions worked, as does adding ships to missions with the Port installed, but adding ships to CP's mission doesn't. Perhaps the problem is related to having a mod installed rather than having certain kinds of ships in the mission.

taylor

2006-02-13 17:48

administrator   ~0004737

I think I was able to get this to happen in a retail setting as well, though I don't remember which mission in particular. The problem appears to come directly from waypoints for some reason so if there aren't any waypoints in the mission then it won't crash. It doesn't happen if you are just adding ships/backgrounds/etc., only when there are waypoints mixed in with the list of objects.

CP5670

2006-02-13 21:12

reporter   ~0004738

Last edited: 2006-02-13 21:14

One very strange thing with this mission is that FRED2 sometimes saves it in some weird format. If I try to open it in Ultraedit (a text editor), it gives a message saying that the file is not in DOS format and asks if I want to convert it to DOS format. The game has no trouble reading it and I can manually edit it fine if I convert it, but if I don't, there is a question mark in front of every line in the file. However, this only sometimes occurs, maybe one out of four times the mission is saved.

This may well have nothing to do with this bug. It's just that this is only mission where I have encountered all this and it's also the only mission I have with this placement crashing bug.

There is some more random and very confusing behavior involved with this, which I'll explain if you think this could be related in any way.

edited on: 02-13-06 16:14

CP5670

2006-02-13 21:57

reporter   ~0004739

Last edited: 2006-02-13 21:58

Never mind what I just said. it looks like that has nothing to do with this bug. The crash also occurs in almost all of the other missions in that file, only that it takes more ships for it to crash. In PI08.fs2 for example, it crashes on 8 new ships. However, I can't get it to crash in any retail mission (with no mods installed), so you could be right about some aspect of the mods causing this.

One thing I noticed is that if I delete some existing ships, it allows me to place that many more ships than it would otherwise before crashing. (so if a mission normally crashes with n ships and I delete m ships, then I can add m+n-1 of them without problems and it will crash on the (m+n)th ship)

edited on: 02-13-06 16:58

Goober5000

2006-02-13 22:13

administrator   ~0004741

Last edited: 2006-02-13 22:13

Interesting. We may be getting closer.

See how many ships are in the mission file. Does it crash on the same number for every mission?

edited on: 02-13-06 17:13

CP5670

2006-02-16 06:27

reporter   ~0004764

No, it seems to be different for all of them. PI11 has 46 ships and PI08 has 69, but PI08 can accept more before crashing.

It's possible to increase the number of ships a mission can take by saving it and exiting FRED2 when the limit is reached. The next time you load the mission, it lets you add one more ship before it crashes. I did this many times when building PI11 to work around this bug.

Goober5000

2006-02-21 16:55

administrator   ~0004884

Last edited: 2006-02-21 16:56

Here's what Woomeister had to say about it. It looks like he found the cause.

"I was making a mission and couldn't get past 14 ships without a CTD. Starting a fresh file and adding the ships first worked and I could add many more ships.

"The CTD seems to be caused by adding two or more seperate waypoint paths, then adding more ships afterwards. This is the only way I could replicate the problem and it occurs every time I do this. I went back to the mission I was making that had 3 waypoint paths in and deleted them and I could go over the previous 14 ship limit.

"If you experience a CTD when adding ships this is most likely the cause, and the only workaround for now is to add any waypoints you need after placing all the ships."

edited on: 02-21-06 11:56

phreak

2006-04-17 23:13

developer   ~0005342

aha fixed. explanation follows:

in CShipEditorDlg::initialize_data(), the variable "marked_ship" is an index into the Ships[] array, not the Objects[] array. It ends up being used as Ships[Objects[marked_ship].instance] when figuring out if you can use the "set as player ship" check box in the ship editor. Objects[obj].instance if obj is a waypoint is always 65536, which means that its trying to access Ships[65536], when it should actually be accessing Ships[marked_ship]

Goober5000

2006-04-19 19:37

administrator   ~0005343

Resolving then. :)

Issue History

Date Modified Username Field Change
2005-11-22 11:27 taylor New Issue
2005-11-28 23:37 Goober5000 Note Added: 0003946
2005-11-28 23:37 Goober5000 Status new => assigned
2005-11-28 23:37 Goober5000 Assigned To => Goober5000
2005-12-07 17:46 Ransom Arceihn Note Added: 0003975
2005-12-07 22:56 redmenace Note Added: 0003976
2005-12-08 10:32 Ransom Arceihn Note Added: 0003977
2006-02-02 09:26 Goober5000 Note Added: 0004636
2006-02-10 18:43 Goober5000 Note Added: 0004710
2006-02-10 18:43 Goober5000 Note Added: 0004711
2006-02-10 22:24 CP5670 Note Added: 0004712
2006-02-13 16:45 SadisticSid Note Added: 0004735
2006-02-13 16:48 Goober5000 Note Added: 0004736
2006-02-13 17:48 taylor Note Added: 0004737
2006-02-13 21:12 CP5670 Note Added: 0004738
2006-02-13 21:14 CP5670 Note Edited: 0004738
2006-02-13 21:57 CP5670 Note Added: 0004739
2006-02-13 21:58 CP5670 Note Edited: 0004739
2006-02-13 22:13 Goober5000 Note Added: 0004741
2006-02-13 22:13 Goober5000 Note Edited: 0004741
2006-02-16 06:27 CP5670 Note Added: 0004764
2006-02-21 16:55 Goober5000 Note Added: 0004884
2006-02-21 16:56 Goober5000 Note Edited: 0004884
2006-04-17 23:13 phreak Note Added: 0005342
2006-04-17 23:17 phreak Assigned To Goober5000 => phreak
2006-04-19 19:37 Goober5000 Note Added: 0005343
2006-04-19 19:37 Goober5000 Status assigned => resolved