Author Topic: Glide caps are broken and I'm stuck in the danger zone  (Read 8641 times)

0 Members and 1 Guest are viewing this topic.

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Glide caps are broken and I'm stuck in the danger zone
We should reach out to Sushi to see if there's something we didn't think of.

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Glide caps are broken and I'm stuck in the danger zone
I'm not sure I follow, z64555. Can't you just leave your Max Glide Speed high, or undefined? How would this change affect you at all?

Eh, I guess it doesn't really affect us after all, sorry. Brain has been three wheeling this morning.  :banghead:
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Glide caps are broken and I'm stuck in the danger zone
No worries! I didn't do a good job of pointing at the precise problem in the first post.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Glide caps are broken and I'm stuck in the danger zone
Yeah, that's what threw me too. But as soon as I looked at the Diaspora tables I realised that this didn't affect Diaspora in any way since we never set a max gliding speed.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Glide caps are broken and I'm stuck in the danger zone
Yeah, that's what threw me too. But as soon as I looked at the Diaspora tables I realised that this didn't affect Diaspora in any way since we never set a max gliding speed.
Not setting a max gliding speed doesn't actually mean you don't have one set; FSO automatically sets it to the fastest speed the ship can go (taking overclocking/afterburner into account). However, this does mean that Diaspora should, theoretically, be unaffected by reverting r8628. I'm currently compiling a test build to see if it works as expected.

EDIT: So it turns out Diaspora explicitly sets a dynamic glide cap, which means it is affected.
« Last Edit: March 31, 2015, 12:15:15 am by AdmiralRalwood »
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Sushi

  • Art Critic
  • 211
Re: Glide caps are broken and I'm stuck in the danger zone
Hello there! I just happened to stumble across this thread before anyone tracked me down...

It's been long enough that I don't remember all the details, and I don't have the source code checked out so I can't see exactly what was in the commit in question (or later follow-up tweaks). I do remember writing reference here (which you should all read):

http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Glide:

So, some history, as best as I can remember it. I stumbled across BTRL, and was driven up the wall by the fact that you could exceed speed limits in glide by flying forwards and turning. I found myself getting ahold of the source code to fix this, and got pulled into FSOpen dev in the process.

Later, I ended up refining this for Diaspora (and for my own use in TBP) with the "dynamic glide cap" approach, trying to make it so that the basic ship flight envelope was the same in both glide enabled and disabled modes. Turning on dynamic glide cap supersedes the "max glide speed" completely, and IIRC has some fairly different logic to avoid having to interact with the weird behavior that you can get when you DONT use the dynamic cap. Diaspora *definitely* uses the dynamic glide cap.

I do seem to recall that the behavior where you can maintain your current speed in glide, even if it's over the cap, was desired or relied on by someone  (TBP / Zathras, maybe?). Including the part where applying thrust would break you out of that magic state and slow you down.

This does seem like something that should be fixed. If someone wants to be able to maintain AB speed in glide, they can just set the max glide speed == max AB speed. If you want the max glide speed LESS than max AB speed, then I think it should behave the way Battuta is asking.

Assuming that nobody is currently using a max glide speed < max AB speed and depending on the current behavior, I think it can be treated as a bugfix without needing to add another table flag.

As already mentioned, I can't see what was in r8628, so I can't comment on whether or not it's safe to revert as-is.



Unfortunately I won't be able to help out with actually implementing a fix, my current employer is very lame about participation in own-time game dev projects. And frankly I don't have the spare time and energy anyway. 


Some alternate ideas for Battuta that wouldn't require a code change (these may or may not be helpful, just brain-dumping):
* Use dynamic glide cap so the player ship can't maintain a high glide speed without keeping energy in engines?
* Use +Glide Accel Mult: 0 to prevent ANY thrusting during glide, as an alternative "tradeoff" for using it?

 

Offline Sushi

  • Art Critic
  • 211
Re: Glide caps are broken and I'm stuck in the danger zone
Quick follow-up, I took a look at the linked mantis issue:

Quote
given that the code intentionally (both by the code and the comments) doesn't decay velocity when the ship isn't actively thrusting.

This sounds familiar, and I think it's the heart of the problem. The speed decay only gets applied when the ship is trying to apply thrust, so if you're just drifting you won't slow down. I don't remember whether this is also the case when using "dynamic glide cap" or not... I *think* the dynamic cap will still decay your speed even without thruster input. If I'm right about that, fixing this should just be a matter of syncing some of the code between the branches for dynamic and non-dynamic.

If not, then this will affect Diaspora as well and perhaps means we need a +decay_glide_speed_without_thrust flag or something.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Glide caps are broken and I'm stuck in the danger zone
Dynamic glide cap doesn't cause a different code branch to be followed; all it does is change which speed is decayed to (as long as some thrusting is happening).

Given that Diaspora doesn't actually have ETS controls and the Viper's overclock speed is identical to its max speed, the dynamic glide cap is equivalent to setting the glide cap to the Viper's top speed, except without having to type the number manually. Playing Diaspora with a build with r8628 reverted, if you afterburn and then glide, your speed will slowly decay until it reaches your normal top speed. Without reverting r8628 (e.g. current trunk, or any of the executables ever bundled with Diaspora), you can instead drift at afterburner speeds indefinitely.

As for what r8628 actually did: link.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Glide caps are broken and I'm stuck in the danger zone
Dynamic glide cap overrides and shuts off max glide speed, right?

 

Offline Sushi

  • Art Critic
  • 211
Re: Glide caps are broken and I'm stuck in the danger zone
Dynamic glide cap overrides and shuts off max glide speed, right?

It should, yes.

As for what r8628 actually did: link.

Hmm. I don't remember the reason for doing that one at all! :) I can't even remember if that was from someone else's request or if I thought it made sense for some reason.

It does look straightforward to revert (or to hide behind a flag), no idea who that would break though. (It would obviously affect Diaspora, but I don't *think* in any significant way).

Kicking myself for not including a Mantis link in the code, or at least a better explanatory comment. 
« Last Edit: March 31, 2015, 10:26:16 pm by Sushi »

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Glide caps are broken and I'm stuck in the danger zone
Kicking myself for not including a Mantis link in the code, or at least a better explanatory comment.

QFT, fellow SCPers.  Always take the time to write a good, clear message, and reference a ticket whenever possible.   :yes:
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline fightermedic

  • 29
  • quite a nice guy, no really, i am
Re: Glide caps are broken and I'm stuck in the danger zone
i would very much love to see this fixed, it has bugged me in the past :/ i just never realized it was a actual bug
>>Fully functional cockpits for Freespace<<
>>Ships created by me<<
Campaigns revised/voice-acted by me:
Lightning Marshal 1-4, The Regulus Campaign, Operation: Savior, Operation: Crucible, Titan Rebellion, Fall of Epsilon Pegasi 1.1Aftermath 2.1,
Pandora's Box 2.2, Deep Blood

Other Campaigns I have participated in:
The Antagonist, Warzone, Phantoms & Echo-Gate

All the stuff I release is free to use or change in any way for everybody who likes to do so; take whatever you need

 
Re: Glide caps are broken and I'm stuck in the danger zone
I think it's important to have. It breaks a couple of existing missions.

It makes Act 3 so much easier :D

 
Re: Glide caps are broken and I'm stuck in the danger zone
I'll be sad to see it go on the Ainsarii, gliding in at 180m/s makes the opening of HFH much more manageable.
The good Christian should beware of mathematicians, and all those who make empty prophecies. The danger already exists that the mathematicians have made a covenant with the devil to darken the spirit and to confine man in the bonds of Hell.