Jump to content
  • 0

Changing player acceleration


Remilia Scarlet

Question

in (G)ZDoom, is there a way to adjust how quickly the player accelerates?  By that I mean how long it takes for a player to go from standing to a full walking/running speed.

Share this post


Link to post

8 answers to this question

Recommended Posts

  • 0

Try changing his friction property, as I believe that acceleration is a function of just 1) his previous velocity, 2) some value directly from user input in the current tic, and 3) the properties speed, forward/side move, and friction (possibly also gravity and mass, not sure here).

Edited by scifista42

Share this post


Link to post
  • 0

Looks like the acceleration happens within the Thrust() function, which (if my limited understanding of ZScript is correct) is defined internally and not in ZScript itself.  Everything I played with had the same effect as changing Player.ForwardMove and Player.SideMove.

Share this post


Link to post
  • 0

What precisely are you trying to do? The way the system works, the harder you push on a thing, the faster it will go overall once its reached peak speed. If you want something that would accelerate to the same top speed but faster, I think you'd have to increase both the acceleration and the friction of the object. I don't have the precise math on hand though.

 

EDIT: Still no precise math, but here's a quickie explanation to what's going on. The friction in Doom works by lopping off a certain percent of an object's velocity each tick, presumably after performing the move (someone with technical knowledge want to confirm that?). When you accelerate in Doom, you add a specific value to your current velocity, 1.5625. After that's added and you do your move with the new velocity, a bit of your velocity is lopped off. Eventually, though, you will reach a point where the acceleration you're getting is exactly the same as the amount getting lopped off by drag, defining your max speed. As acceleration gets higher, your velocity needs to get larger and larger in magnitude so that the amount lopped off by drag matches the acceleration, increasing max speed.

Edited by InsanityBringer

Share this post


Link to post
  • 0

The goal is exactly as you said, faster acceleration to peak speed.  I'll try toying with both speed and friction together next to see if I can get the results I want.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...