View Issue Details

IDProjectCategoryView StatusLast Update
0002890FSSCPSEXPspublic2020-04-13 19:18
ReporterFUBAR-BDHR Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version3.6.19 
Summary0002890: Inconsistent behavior in set-object-speed-z
DescriptionAt one time you could use this sexp to set a ships speed and based on the optional argument make a ship fly as fast as you wanted. The problem was that this only worked for 1 frame and the ship would quickly return to normal speed. The easy workaround was to put the sexp in a loop. This no longer works breaking older missions. The ship will show on the hud that it is moving at the velocity given in the sexp but does not appear to change the speed of the ship at all. For example the following event:

$Formula: ( every-time
   ( true )
   ( set-object-speed-z
      "EA Aurora 1"
      500
      ( true )
   )
)
+Name: Event name
+Repeat Count: 9999
+Interval: 1

In previous releases would make the ship fly at a velocity of 500. In current builds it just flys at default speed but when targeted the speed it is traveling at is indicated as being 500.

There is also a second issue here. Even with the ship traveling at normal speed weapon impacts seem to be based off of the 500 speed as well causing the ship to jump around when hit.
Steps To ReproduceRun the attached mission in a current and older build such as 3.6.10. For the second part shoot the ship and watch it jump when hit which doesn't happen if the event is not present.
Additional InformationThe first part of the bug was actually discovered by someone else and discussed on IRC. I thought a bug report had been filed but couldn't fine one. Here is the log of that conversation:

[05/09-02:04] <Doko> I'm having an issue with set-object-speed-Z. I have a ship aligned to fred's world axis and I'm specifing for the sexp to utilize the ships orientation (either true or false should achieve the same with its current heading) but it just refuses to move. The hud displays the ship moving at 20m/s but its not actually moving in space. X and Y works correctly moving the ship sideways or up down
[05/09-02:04] <Doko> am I understanding this sexp wrong or is something broken here
[05/09-02:08] <@The_E> Sure sounds like brokenness to me
[05/09-02:11] <Doko> hmmm the sexp doesn't seem to be broken per say. If I pitch the ship down 90 degrees and it to false the ship moves correctly. Its like if forward speed was protected... odd
[05/09-02:14] *** Plombo_ has quit IRC: Ping timeout: 194 seconds
[05/09-02:27] <FUBAR> set the optiona argument to true and make it a repeating event. If it's not repeating it will only move for 1 frame
[05/09-02:28] <Doko> It was hooked on a everytime var = 1
[05/09-02:29] <Doko> also tried with a when with a speed of 4000 to see if it would move that much in 1 frame
[05/09-02:29] <Doko> also tried with it set to false, still refuses
[05/09-02:39] <FUBAR> yea definately a bug. Targeted ship shows a speed of 500 but is moving at normal speed
[05/09-02:40] <Backslash> Doko, FUBAR, not a bug. long explanation incoming:
[05/09-02:40] * Doko listens
[05/09-02:41] <Backslash> short version: it is fixed by use-newtonian-damping (been a long time, might have the spelling wrong)
[05/09-02:41] <FUBAR> when was the behavior changed because it used to work with retail data
[05/09-02:42] <Backslash> it never worked with completely retail data
[05/09-02:42] <Backslash> basically, for some reason the engine doesn't apply damping to the ship's Z axis, it instantly goes to 0. So no matter what velocity you give Z, the very next frame it is instantly decreased to 0
[05/09-02:42] <FUBAR> it did if it was in a loop
[05/09-02:42] <Backslash> when I say 'for some reason' I mean I can see why in the code, I just don't know why [V] decided to do it that way
[05/09-02:43] <Backslash> once upon a time I attempted to fix it by applying damp to all three axes, but it was determined that since it was not done in retail, I had to make it optional
[05/09-02:43] <FUBAR> to prevent ships from flying off at light speed after collisions would be my guess (althogh player ships still did it)
[05/09-02:44] <Backslash> possibly, but that doesn't happen if the $damp value is set properly
[05/09-02:45] <FUBAR> apparently you've never been hit by a hecate jumpin in in RI and ended up 500000k away
[05/09-02:45] <Backslash> oh I have
[05/09-02:45] <Backslash> but that can happen on the X or Y axis too
[05/09-02:45] <FUBAR> still there is definatly a bug here becasue the speed is showing the set speed in the targeting window not the actual speed
[05/09-02:46] <Backslash> it is showing the set speed before physics happens, yes
[05/09-02:46] <Backslash> I wish there was a way to fix it. perhaps there is, it would be very nice
[05/09-02:46] <Backslash> this is also why in BtRL if you constantly turn your ship, your speed will continually increase
[05/09-02:47] <Backslash> cause as you turn, damp keeps your momentum on X (or Y), but Z gets instantly set to whatever your engine speed is... which then gets added to X's momentum as you continue to turn
[05/09-02:47] <BotenAnna> oh snap!
[05/09-02:47] <Backslash> rofl, your momentum
[05/09-02:47] <BotenAnna> oh snap!
[05/09-02:47] <Doko> lol
[05/09-02:48] <FUBAR> what I don't understand is if it the original behavior with retail data was to accelerate and immediately decelerate why the behavior was changed from that. I can see leaving it set with a flag but not beaking the old behavior. It was used frequently to make ships go faster then they should.
[05/09-02:48] <Backslash> I have not seen it working with retail data. I would be quite interested to see what build that worked with, because precedent would be nice
[05/09-02:50] <Backslash> it makes me sad, really, because I feel ships 'feel' more interesting with my fix
[05/09-02:50] <Backslash> set the damp high enough and you can do some fun afterburner slides
[05/09-02:51] <FUBAR> god can I test one thing without finding a bug or 2?
[05/09-02:52] <FUBAR> Just save the mission in retail format which didn't remove the fog multipliers so it doesn't work in older versions
[05/09-02:52] <FUBAR> Also it appears that the new pilot code may be showing all missions for campaings in the tech room before they are played.
[05/09-02:53] <Backslash> you are quite talented at bugfinding
[05/09-02:54] <FUBAR> it's getting annoying all I wanted to do was check some sound files last night and I'm on like bug 0000004 now
[05/09-02:55] <Backslash> was the 'save the mission in retail format' directed at me about the set-object-speed, or was that about another bug?
[05/09-02:55] <FUBAR> I found that testing the set-object-speed just now
[05/09-02:56] <FUBAR> and add +use table score to not being removed from retail save
[05/09-02:56] <Backslash> heh
[05/09-02:57] <FUBAR> got a uly moving at 630 in 3.6.9
[05/09-02:58] <FUBAR> guessing that is 500+velocity_ab
[05/09-02:58] <Backslash> 3.6.9 release?
[05/09-02:58] <FUBAR> looks that way has no revison after it and no debug
[05/09-02:59] <FUBAR> newer then rc8 older then 3.6.10
[05/09-02:59] <FUBAR> older then a 3.6.9 xt build too but that doesn't really mean anything
[05/09-02:59] <Backslash> nice. can I get the mission somewhere?
[05/09-03:00] <Backslash> there was a VERY short period of time where my fix was in trunk, but that got reverted when taylor noticed the difference from retail.
[05/09-03:00] <Backslash> it's actually just about unnoticable with retail data EXCEPT for big ships warping in.
[05/09-03:01] <FUBAR> (Link: http://fubar5.fubar.org/mantis/500speed.fs2)http://fubar5.fubar.org/mantis/500speed.fs2
[05/09-03:01] <Backslash> thanks
[05/09-03:01] <FUBAR> now I didn't disable the AI so it moves weird
[05/09-03:01] <FUBAR> by disable I mean play-dead
[05/09-03:02] <Backslash> is fine
[05/09-03:02] <FUBAR> just letting you know before you wonder why it's doing spirals
TagsNo tags attached.

Activities

FUBAR-BDHR

2013-06-06 22:09

developer  

500speed.fs2 (3,005 bytes)

Backslash

2013-06-07 03:39

developer   ~0015122

Yeah, like I said above, I'm wondering if 3.6.9 was the short period of time I mentioned, or possibly the 3.6.9 build you had was not a release build. IIRC that was the era of CVS and before we had standardized proper build naming. You sure it didn't happen in 3.6.8?

Is there somewhere we keep old release builds like that?

Either way, unless it happens in builds like 3.6.8 and earlier, the only missions it breaks is ones that were developed under just 3.6.9 ... and really, all they need to be fixed is http://hard-light.net/wiki/index.php/Ai_profiles.tbl#.24use_newtonian_dampening: anyway. I do wish there was a better way to fix it for everyone. This and the BtRL turning behavior that results without is just stupid.

Goober5000

2020-04-13 19:18

administrator   ~0016971

Closing because of Backslash's comments. Also, we now have the ship-maneuver sexps.

Issue History

Date Modified Username Field Change
2013-06-06 22:09 FUBAR-BDHR New Issue
2013-06-06 22:09 FUBAR-BDHR File Added: 500speed.fs2
2013-06-07 03:39 Backslash Note Added: 0015122
2020-04-13 19:18 Goober5000 Status new => closed
2020-04-13 19:18 Goober5000 Resolution open => no change required
2020-04-13 19:18 Goober5000 Note Added: 0016971