View Issue Details

IDProjectCategoryView StatusLast Update
0001870FSSCPgameplaypublic2012-01-09 18:07
ReporterARSPR Assigned ToGoober5000  
PrioritynormalSeveritymajorReproducibilitysometimes
Status resolvedResolutionno change required 
PlatformDELL Dimension 9200OSWindows VistaOS VersionUltimate 32-bit
Summary0001870: Sometimes, hits-left is not evalued before the ship is destroyed.
DescriptionI think there's some kind of issue with this SEXP.

Warzone 6th mission. (I upload it). (Although I haven't tried, you should be able to use it with retail data, because Warzone only has one -shp.tbm used to add GTE Vidar which is not used in this mission).

SC Guari (a SC Raksasha), has the following arrival cue:

<
-hits-left
--Comm Node
-12

After both initial SC Cains are destroyed, the Shivan Comm-Node gets heavily bombarded and beamed by allied forces. Then, approximately in about 25% of the mission runs, this SEXP is not evaluated before the Shivan Comm is destroyed and the SC Guari never arrives, breaking the mission.
TagsNo tags attached.

Activities

2009-01-14 20:44

 

WarzoneE1M6.fs2 (89,905 bytes)

phreak

2009-01-15 01:06

developer   ~0010527

Try the next nightly, the sexp was bailing if the ship was destroyed. I just had it return 0.

chief1983

2009-01-15 03:37

administrator   ~0010528

Last edited: 2009-01-15 16:03

I wonder why it was originally decided that you can't evaluate it when the ship has been destroyed. Seems like it should have been an obvious 0 all along if that works.

phreak

2009-01-15 04:08

developer   ~0010530

No idea, but it may also be an oversight on the mission designer

- or
   - is-destroyed-delay
      - 0
      - Comm Node
   - <
      - hits-left
         - Comm Node
      - 12

ARSPR

2009-01-15 15:25

reporter   ~0010533

Last edited: 2009-01-15 18:00

Ok, I'll test it ASAP

OTOH, hits-left-subsystem is also buggy. It also doesn't return 0 for destroyed ships.

(I upload a test mission where you can bomb or laser to death two Cains. hits-left test is enabled for both at < 5%. Also "Bomb me" engine is tested at < 80% (this test training message is delayed 5 seconds)).

Nevertheless, although I really think that this is a TRUE bug because a destroyed ship does have 0 hits left in both its hull and its subsystems, maybe this fix can break old missions which were made without thinking about it. SCP crew should discuss about it...

A possible example. You have to weaken Comm below 20 while keeping your targe alive. Now there's no need for an additional check about if the ship has been destroyed or not. A destroyed ship wouldn't trigger the hits-left-subsystem (Comm) < 20 check.

Maybe, although both SEXPs are buggy in strict sense, the best thing to do is leaving them untouched. I would just add a warning in their FRED help text, telling the FREDer that they are not evaluated for destroyed ships. (A good FREDer could always fix his missions with phreak's coding).


EDITED -----

As expected, 5039 makes hits-left=0 for destroyed ships. But as told above, really wanted?

2009-01-15 15:27

 

Hits_left_test.fs2 (6,255 bytes)

Goober5000

2009-01-18 00:35

administrator   ~0010539

That's an interesting question.

Goober5000

2009-01-18 03:57

administrator   ~0010540

Okay. Well, first we have coding precedent across nearly every sexp in the code (both retail and FSO) that deal with ships. And that precedent is to return NAN_FOREVER if the ship is destroyed or departed. This applies to shields-left, hits-left-subsystem, is-ship-visible, and many other sexps. It may trigger a double take in certain situations (such as hits-left when a ship is destroyed, as mentioned here) but it is well-defined and it's consistent.

So I'm declaring this as a mission bug and not a code bug. I'm reverting the "fix" and marking this ticket as "no change required".

Related Changesets

fs2open: trunk r5041

2009-01-17 23:00

Goober5000


Ported: N/A

Details Diff
revert changes to close out issue 0001870 Affected Issues
0001870
mod - /trunk/fs2_open/code/parse/sexp.cpp Diff File

Issue History

Date Modified Username Field Change
2009-01-14 20:44 ARSPR New Issue
2009-01-14 20:44 ARSPR File Added: WarzoneE1M6.fs2
2009-01-15 01:06 phreak Note Added: 0010527
2009-01-15 01:07 phreak Status new => assigned
2009-01-15 01:07 phreak Assigned To => phreak
2009-01-15 03:37 chief1983 Note Added: 0010528
2009-01-15 03:37 chief1983 Status assigned => feedback
2009-01-15 04:08 phreak Note Added: 0010530
2009-01-15 04:08 phreak Status feedback => assigned
2009-01-15 15:25 ARSPR Note Added: 0010533
2009-01-15 15:27 ARSPR Note Edited: 0010533
2009-01-15 15:27 ARSPR File Added: Hits_left_test.fs2
2009-01-15 15:45 ARSPR Note Edited: 0010533
2009-01-15 15:51 ARSPR Note Edited: 0010533
2009-01-15 16:03 chief1983 Note Edited: 0010528
2009-01-15 18:00 ARSPR Note Edited: 0010533
2009-01-18 00:35 Goober5000 Note Added: 0010539
2009-01-18 03:57 Goober5000 Note Added: 0010540
2009-01-18 03:57 Goober5000 Assigned To phreak => Goober5000
2009-01-18 03:57 Goober5000 Status assigned => resolved
2009-01-18 03:57 Goober5000 Resolution open => no change required
2012-01-05 22:55 Goober5000 Changeset attached => Import 2012-01-05 17:52:05 trunk r5041
2012-01-09 18:07 Goober5000 Changeset attached => fs2open_websvn trunk r5041