ARGH (ZDoom gravity fix broke my flight script)

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

ARGH (ZDoom gravity fix broke my flight script)

Post by Project Shadowcat »

Prior to 2.3.0, I had this script going that allowed a player to fly similar in fashion to how Tails flies in Sonic 3. The difference is that it is push and hold, instead of tap like mad. It worked okay, though the player was capable of flying pretty high pretty quickly. I used this little deficiency to my advantage for a little bit.
Now, it's a bit fucked up. Here's how:
Jump in the air, and start flying while you still have upward motion. You'll fly higher as per normal.
Let go for a bit until you have downward momentum. Previously, you can recover and rise again. Now, it only stops descent, preventing you from rising again until you fall and land.

When messing with the wad, set sv_aircontrol to 0.2.

Flight code:
Spoiler:
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by XutaWoo »

Perhaps you could boost the thrust if downward momentum is too high?
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by Project Shadowcat »

XutaWoo wrote:Perhaps you could boost the thrust if downward momentum is too high?
I tried this, actually, then it went to a half-broke state. Sometimes, it did the same thing, and sometimes, the player shoots out like a cannon in the air -- not what I want to do, either.
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by randi »

So, I was wondering, why should it be considered a "bug" for gravity to be consistent? I always thought it was screwy that Doom doubled gravity if your current vertical velocity happened to be one specific value, once I found out it did that. Hence, the reason I changed it in the first place. I think that restoring the quirky Doom behaviour should have been done as a compatibility flag rather than as an "always on" thing, but I couldn't think of any specific counterexamples for why that was bad. Until now.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by XutaWoo »

Gotta love what gimmicks can prove, eh Randy? :P
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by Project Shadowcat »

randy wrote:So, I was wondering, why should it be considered a "bug" for gravity to be consistent? I always thought it was screwy that Doom doubled gravity if your current vertical velocity happened to be one specific value, once I found out it did that. Hence, the reason I changed it in the first place. I think that restoring the quirky Doom behaviour should have been done as a compatibility flag rather than as an "always on" thing, but I couldn't think of any specific counterexamples for why that was bad. Until now.
Huzzah! I have beaten the system! :lol:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by Graf Zahl »

randy wrote:So, I was wondering, why should it be considered a "bug" for gravity to be consistent? I always thought it was screwy that Doom doubled gravity if your current vertical velocity happened to be one specific value, once I found out it did that. Hence, the reason I changed it in the first place. I think that restoring the quirky Doom behaviour should have been done as a compatibility flag rather than as an "always on" thing, but I couldn't think of any specific counterexamples for why that was bad. Until now.

I don't want to sound harsh - but changes like this one is what gives ZDoom a somewhat questionable reputation in certain circles - and I can fully understand why these people think like that.

I didn't add a compatibility option because I really didn't expect hacky scripts like this one. All I noticed was that in several Doom maps with the altered formula it was possible to jump over gaps you were not supposed to jump over and then finally a map was posted at Doomworld that just happened to work while it didn't on any other port.

But yes, if it really affects existing mods it needs to be compatibility optioned.
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by Project Shadowcat »

Graf Zahl wrote:I don't want to sound harsh - but changes like this one is what gives ZDoom a somewhat questionable reputation in certain circles - and I can fully understand why these people think like that.

I didn't add a compatibility option because I really didn't expect hacky scripts like this one. All I noticed was that in several Doom maps with the altered formula it was possible to jump over gaps you were not supposed to jump over and then finally a map was posted at Doomworld that just happened to work while it didn't on any other port.

But yes, if it really affects existing mods it needs to be compatibility optioned.
So if this script is so "hacky" (given that the gravity seems like a bit of a hack in the first place), do you have any other alternatives to what I am trying to achieve?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by Graf Zahl »

ON second thought, maybe a different approach is better: The original double gravity when there's zero vertical momentum only gets applied when the last tic before this one the actor was standing on solid ground. That would solve the problem with being able to run over wide gaps but wouldn't interfere with flying or jumping or other gravity related actions - and it would avoid yet another compatibility option while preserving proper gravity in most cases.
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by randi »

Graf Zahl wrote:I don't want to sound harsh - but changes like this one is what gives ZDoom a somewhat questionable reputation in certain circles - and I can fully understand why these people think like that.
Be that as it may, I still want to know what they were thinking when they wrote that. So a player arrives at a particular height one tic earlier than they otherwise would have while falling. What's the point?
Graf Zahl wrote:ON second thought, maybe a different approach is better: The original double gravity when there's zero vertical momentum only gets applied when the last tic before this one the actor was standing on solid ground.
That would probably be satisfactory. Alternatively, it would probably be sufficient and easier to subtract the speed of gravity from a player's stepheight when they're falling. The end result of preventing players from running across gaps ought to be the same. (Rather than "losing" a tic of falling time at the start of the fall, you "lose" it when stepping onto something instead.)
User avatar
Xaser
 
 
Posts: 10772
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by Xaser »

What will this do to maps that have been built around the idea that you're supposed to run over these wider gaps?

Not that I can name one off the top of my head, mind you, but something is bound to come up.
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by Project Shadowcat »

Xaser wrote:What will this do to maps that have been built around the idea that you're supposed to run over these wider gaps?

Not that I can name one off the top of my head, mind you, but something is bound to come up.
Doom Raider.
Of course none of this is actually helping the (relatively new) problem of how hacky the script even is -- at least, in Graf's own words. There has to be a better way than continually thrusting a player in the air in such a delicate fashion.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by Graf Zahl »

randy wrote:
Graf Zahl wrote:I don't want to sound harsh - but changes like this one is what gives ZDoom a somewhat questionable reputation in certain circles - and I can fully understand why these people think like that.
Be that as it may, I still want to know what they were thinking when they wrote that. So a player arrives at a particular height one tic earlier than they otherwise would have while falling. What's the point?
No idea. Of course the original code was written without jumping in mind. So it was probably just a minor tweak to shorten the distance the player could cross when running through the air.
Graf Zahl wrote:ON second thought, maybe a different approach is better: The original double gravity when there's zero vertical momentum only gets applied when the last tic before this one the actor was standing on solid ground.
That would probably be satisfactory. Alternatively, it would probably be sufficient and easier to subtract the speed of gravity from a player's stepheight when they're falling. The end result of preventing players from running across gaps ought to be the same. (Rather than "losing" a tic of falling time at the start of the fall, you "lose" it when stepping onto something instead.)
Actually not because the added gravity gets applied per tic so if the actor falls for 10 tics it means a difference of 10 map units, not 1.
User avatar
Enjay
 
 
Posts: 26516
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by Enjay »

If this is being looked at, can the other problem that has raised its head a number of times relating to jumping be looked at with it? ie the timing of the jump. To recap:

In most games, provided you haven't actually started falling off something, you can still jump. In Zdoom, if your centre point has passed off the edge of a platform, you cannot jump but you haven't actually fallen off the platform yet. This makes it very difficult to time jumps properly sometimes (when running towards the edge of a platform) and, as often as not, you just end up falling off the edge of the platform - despite pressing jump before you start dropping.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ARGH (ZDoom gravity fix broke my flight script)

Post by Graf Zahl »

It has been bothering me, too but so far I never found the motivation to look at it. It's indeed a very annoying problem...
Locked

Return to “Editing (Archive)”