View Issue Details

IDProjectCategoryView StatusLast Update
0003013FSSCPSEXPspublic2014-04-04 19:47
Reporterkarajorma Assigned Tokarajorma  
PrioritynormalSeveritymajorReproducibilitysometimes
Status resolvedResolutionfixed 
Product Version3.7.1 
Target Version3.7.2Fixed in Version3.7.2 
Summary0003013: is-in-box fails to get correct position
DescriptionSince the release of Diaspora patch 1.1, many people have reported that they are suddenly unable to land on the Theseus even though they could in 1.0.4.

http://www.hard-light.net/forums/index.php?topic=86565.0

I've traced the problem back the is-in-box SEXP and more specifically the test_point_within_box() function which is quite clearly reporting the player as not being within the box when as far as I can see tell, the definitely are. Unfortunately I don't have the vector maths skills to figure out why.

A test mission I made does not show this behaviour so the cause appears to be something the Theseus is doing in the real mission but not in the test.
Steps To ReproduceRun Diaspora with the 1.1 patch installed. Run mission 1 on advanced (medium) skill level or above. At the end of the mission try to land on the Theseus by entering the flight pod and slowing down below 5m/s. The game should allow you to land but it won't.

If you breakpoint the sexp_is_in_box() function you'll see that the SEXP returns false twice for Blue 1. It should return true from one of those two calls (depending on which flight pod you are in).
TagsNo tags attached.

Activities

Goober5000

2014-03-05 20:19

administrator   ~0015637

Is there a way to test this without installing Diaspora?

Also, as I recall there was an error in test_point_within_box sometime recently, but it was fixed following feedback from somebody else. I don't recall the details but they should be in the SVN log.

As far as the test case goes, have you tried rotating the Theseus through various orientations?

karajorma

2014-03-05 23:11

administrator   ~0015638

Last edited: 2014-03-05 23:11

There's no way to test without Diaspora. I can't even reproduce in Diaspora except in the official missions. Although rotating the Theseus isn't something I tried in the test mission (nor is ordering it to move from its starting rotation).

I'll try reverting the test_point_within_box fix and see if that fixes the issue.

Goober5000

2014-03-06 02:20

administrator   ~0015639

Well, the fix was in revision 9642, but the commit message doesn't say what needed to be fixed. :sigh:

It was fairly critical to the correct operation of the sexp; it broke something important as I recall. Though I concede the possibility of the fix breaking something else that I didn't test for.

niffiwan

2014-03-06 03:08

developer   ~0015640

Last edited: 2014-03-06 03:14

IIRC, is-in-box was changing the position of the object it was testing. This resulted in the object being flung around the mission space at great speed. See 0002937

(oops - actually 0002937 was fixing an issue introduced by 9642...)

Goober5000

2014-03-06 03:53

administrator   ~0015641

Aha, so that fits my memory of one fix (9642) being amended by another fix (9946).

karajorma

2014-03-16 13:27

administrator   ~0015665

The feedback from Diaspora testers seems to indicate that if r9642 and r9946 are rolled back, the problem goes away.

Goober5000

2014-03-16 17:24

administrator   ~0015666

Well, that's frustrating. I'll give Diaspora a try myself and see if I spot anything.

The_E

2014-03-24 15:15

administrator   ~0015679

What's the status on this?

Goober5000

2014-03-25 00:30

administrator   ~0015680

I'm going to take a look at Diaspora and see if I can resolve the bug.

I suppose I can assign it to myself in the meantime.

karajorma

2014-03-25 08:21

administrator   ~0015681

Ummm. Just spotted this.

In the original we have

vec3d tempv;
vm_vec_sub(&tempv, &test_point, &reference_ship_obj->pos);
vm_vec_rotate(&test_point, &tempv, &reference_ship_obj->orient);

And in the new code we have

vec3d tempv;
vm_vec_sub(&tempv, test_point, &reference_ship_obj->pos);
vm_vec_unrotate(test_point, &tempv, &reference_ship_obj->orient);


Why the switch from vm_vec_rotate to vm_vec_unrotate?

Goober5000

2014-03-26 01:47

administrator   ~0015683

Oh, well done. That must be the cause of the error.

I suppose what I must have done is rewritten that section of code rather than simply copying and pasting it. I must have gotten wires crossed with sexp_calculate_coordinate, which does the opposite -- transforms relative coordinates into global coordinates.

Goober5000

2014-03-26 01:47

administrator   ~0015684

Fix committed to trunk@10530.

Goober5000

2014-03-26 01:49

administrator   ~0015685

Despite Mantis's auto-resolution of the ticket, I want to leave this open until it's confirmed fixed. I've credited karajorma as he's the one that tracked down the likely root cause.

Are there any Diaspora testers who would be able to evaluate the next nightly build?

karajorma

2014-03-28 13:03

administrator   ~0015691

We don't have a proper test group set up. I'll post the build and get some responses.

Goober5000

2014-04-04 19:47

administrator   ~0015696

Based on the two positive reports in this thread...
http://www.hard-light.net/forums/index.php?topic=87201.0
...I think we can now mark this as fixed.

Related Changesets

fs2open: trunk r10530

2014-03-25 20:52

Goober5000


Ported: N/A

Details Diff
this will likely fix Mantis 0003013 Affected Issues
0003013
mod - /trunk/fs2_open/code/parse/sexp.cpp Diff File

Issue History

Date Modified Username Field Change
2014-03-05 12:16 karajorma New Issue
2014-03-05 20:19 Goober5000 Note Added: 0015637
2014-03-05 23:11 karajorma Note Added: 0015638
2014-03-05 23:11 karajorma Note Edited: 0015638
2014-03-06 02:20 Goober5000 Note Added: 0015639
2014-03-06 03:08 niffiwan Note Added: 0015640
2014-03-06 03:14 niffiwan Note Edited: 0015640
2014-03-06 03:53 Goober5000 Note Added: 0015641
2014-03-16 13:27 karajorma Note Added: 0015665
2014-03-16 17:24 Goober5000 Note Added: 0015666
2014-03-24 15:15 The_E Note Added: 0015679
2014-03-25 00:30 Goober5000 Note Added: 0015680
2014-03-25 00:30 Goober5000 Assigned To => Goober5000
2014-03-25 00:30 Goober5000 Status new => assigned
2014-03-25 08:21 karajorma Note Added: 0015681
2014-03-26 01:47 Goober5000 Note Added: 0015683
2014-03-26 01:47 Goober5000 Changeset attached => fs2open trunk r10530
2014-03-26 01:47 Goober5000 Note Added: 0015684
2014-03-26 01:47 Goober5000 Status assigned => resolved
2014-03-26 01:47 Goober5000 Resolution open => fixed
2014-03-26 01:49 Goober5000 Note Added: 0015685
2014-03-26 01:49 Goober5000 Assigned To Goober5000 => karajorma
2014-03-26 01:49 Goober5000 Status resolved => feedback
2014-03-28 13:03 karajorma Note Added: 0015691
2014-03-28 13:03 karajorma Status feedback => assigned
2014-04-04 19:47 Goober5000 Note Added: 0015696
2014-04-04 19:47 Goober5000 Status assigned => resolved
2014-04-04 19:47 Goober5000 Fixed in Version => 3.7.2