Remilia Scarlet Posted August 4, 2017 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. 0 Quote Share this post Link to post
0 Remilia Scarlet Posted August 5, 2017 I figured it out. Turns out someone did something similar on the ZDoom forums, so using their code as a base I was able to get the effect I wanted. 0 Quote Share this post Link to post
0 scifista42 Posted August 4, 2017 (edited) 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 August 4, 2017 by scifista42 0 Quote Share this post Link to post
0 Remilia Scarlet Posted August 5, 2017 Those all have unwanted side effects, unfortunately. Forward/Side move definitely changes the overall top speeds, though. 0 Quote Share this post Link to post
0 Gez Posted August 5, 2017 You can try messing with ZScript by overriding MovePlayer(). 1 Quote Share this post Link to post
0 Remilia Scarlet Posted August 5, 2017 Oh good idea, I'll try that! 0 Quote Share this post Link to post
0 Remilia Scarlet Posted August 5, 2017 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. 0 Quote Share this post Link to post
0 SaladBadger Posted August 5, 2017 (edited) 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 August 5, 2017 by InsanityBringer 0 Quote Share this post Link to post
0 Remilia Scarlet Posted August 5, 2017 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. 0 Quote Share this post Link to post
Question
Remilia Scarlet
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.