ARGH (ZDoom gravity fix broke my flight script)

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

ARGH (ZDoom gravity fix broke my flight script)

Postby Project Dark Fox » Sun Mar 15, 2009 5:59 pm

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
Project Dark Fox
Married Furry Anxiety Bucket
 
Joined: 15 Jul 2005
Location: Louisville, KY USA
Twitch ID: ProjectDarkFox
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby XutaWoo » Sun Mar 15, 2009 6:03 pm

Perhaps you could boost the thrust if downward momentum is too high?
User avatar
XutaWoo
one day when going to see the rabbit, there was a previous visitor ...
 
Joined: 30 Dec 2006
Location: beautiful hills of those who are friends

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

Postby Project Dark Fox » Sun Mar 15, 2009 6:05 pm

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
Project Dark Fox
Married Furry Anxiety Bucket
 
Joined: 15 Jul 2005
Location: Louisville, KY USA
Twitch ID: ProjectDarkFox
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby randi » Sun Mar 15, 2009 9:44 pm

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
randi
Site Admin
 
Joined: 10 Jul 2003

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

Postby XutaWoo » Sun Mar 15, 2009 9:53 pm

Gotta love what gimmicks can prove, eh Randy? :P
User avatar
XutaWoo
one day when going to see the rabbit, there was a previous visitor ...
 
Joined: 30 Dec 2006
Location: beautiful hills of those who are friends

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

Postby Project Dark Fox » Sun Mar 15, 2009 10:08 pm

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
Project Dark Fox
Married Furry Anxiety Bucket
 
Joined: 15 Jul 2005
Location: Louisville, KY USA
Twitch ID: ProjectDarkFox
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby Graf Zahl » Mon Mar 16, 2009 2:12 am

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Project Dark Fox » Mon Mar 16, 2009 2:21 am

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
Project Dark Fox
Married Furry Anxiety Bucket
 
Joined: 15 Jul 2005
Location: Louisville, KY USA
Twitch ID: ProjectDarkFox
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby Graf Zahl » Mon Mar 16, 2009 5:59 am

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby randi » Mon Mar 16, 2009 8:53 pm

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
randi
Site Admin
 
Joined: 10 Jul 2003

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

Postby Xaser » Mon Mar 16, 2009 9:51 pm

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
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

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

Postby Project Dark Fox » Mon Mar 16, 2009 10:02 pm

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
Project Dark Fox
Married Furry Anxiety Bucket
 
Joined: 15 Jul 2005
Location: Louisville, KY USA
Twitch ID: ProjectDarkFox
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby Graf Zahl » Tue Mar 17, 2009 1:38 am

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Enjay » Tue Mar 17, 2009 3:07 am

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

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

Postby Graf Zahl » Tue Mar 17, 2009 12:24 pm

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...
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Next

Return to Editing (Archive)

Who is online

Users browsing this forum: No registered users and 1 guest