2018-09-22 17:42 EDT


View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0003013FSSCPSEXPspublic2014-04-04 15:47
Reporterkarajorma 
Assigned Tokarajorma 
PrioritynormalSeveritymajorReproducibilitysometimes
StatusresolvedResolutionfixed 
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.
Attached Files

-Relationships
+Relationships

-Notes

~0015637

Goober5000 (administrator)

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?

~0015638

karajorma (administrator)

Last edited: 2014-03-05 18:11

View 2 revisions

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.

~0015639

Goober5000 (administrator)

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.

~0015640

niffiwan (developer)

Last edited: 2014-03-05 22:14

View 2 revisions

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...)

~0015641

Goober5000 (administrator)

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

~0015665

karajorma (administrator)

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

~0015666

Goober5000 (administrator)

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

~0015679

The_E (administrator)

What's the status on this?

~0015680

Goober5000 (administrator)

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.

~0015681

karajorma (administrator)

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?

~0015683

Goober5000 (administrator)

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.

~0015684

Goober5000 (administrator)

Fix committed to trunk@10530.

~0015685

Goober5000 (administrator)

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?

~0015691

karajorma (administrator)

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

~0015696

Goober5000 (administrator)

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.
+Notes

+Related Changesets

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