Player Movement
puzl
The Old Firm Join Date: 2003-02-26 Member: 14029Retired Developer, NS1 Playtester, Forum Moderators, Constellation
<div class="IPBDescription">Post your tweaks</div>I'll start off with some very basic tweaks to the constants at the top of Player.lua.
For readability, put the original value in comments after your change.
It's incredible how much is available to us via LUA, so don't be afraid to do something more sophisticated.
This makes the marine feel a little faster but a bit heavier too.. feels more natural to me.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Player.moveSpeed = 7.5 // 7
Player.moveAcceleration = 4
Player.gravity = -10.81 //-9.81
Player.stepHeight = 0.2
Player.jumpHeight = 0.95 // 1
Player.friction = 6
Player.maxWalkableNormal = math.cos( math.pi/2 - math.rad(45) )<!--c2--></div><!--ec2-->
For readability, put the original value in comments after your change.
It's incredible how much is available to us via LUA, so don't be afraid to do something more sophisticated.
This makes the marine feel a little faster but a bit heavier too.. feels more natural to me.
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Player.moveSpeed = 7.5 // 7
Player.moveAcceleration = 4
Player.gravity = -10.81 //-9.81
Player.stepHeight = 0.2
Player.jumpHeight = 0.95 // 1
Player.friction = 6
Player.maxWalkableNormal = math.cos( math.pi/2 - math.rad(45) )<!--c2--></div><!--ec2-->
Comments
The movement feels incredibly un-natural and one of the things I wouldn't mind helping out with is nailing down the movement and refining it before it's ever a major gripe in the soon-to-come Alpha.
The movement feels incredibly un-natural and one of the things I wouldn't mind helping out with is nailing down the movement and refining it before it's ever a major gripe in the soon-to-come Alpha.<!--QuoteEnd--></div><!--QuoteEEnd-->
C:\Program Files (x86)\Natural Selection 2\ns2\lua\Player.lua
I think it really adds to the game.
Here it is:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'> if (canMove) then
// Compute the desired movement direction based on the input.
local wishDirection = forwardAxis * input.move.z + sideAxis * input.move.x
local wishSpeed = nil
if (input.move.z >= 0) then
wishSpeed = math.min(wishDirection:Normalize(), 1) * Player.moveSpeed
else
wishSpeed = math.min(wishDirection:Normalize(), 1) * Player.moveSpeedBack
end
// Accelerate in the desired direction, ala Quake/Half-Life</div>
Also add a variable at the top:
Player.moveSpeedBack = 2
I'm a disaster when it comes to coding, I'm more of a graphics design kinda guy, so keeping it simple would be appreciated :P
you're saying denser objects fall just as fast as lighter objects given the gravitational constant?
Player.moveSpeed = 12
Player.moveAcceleration = 5
Player.jumpHeight = 0.7
Traditional DM has slightly more gravity, less speed etc.
Depends on the effects of air resistance. However, I don't think that would have a significant effect on the scale we're working in, since the highest drop in NS1 was maybe 30-40 feet.
A related question: How heavy is the earth? Answer: whatever you weigh.
What I meant by the 'marine feels heavier' is that it feels like it is operating under a more familiar acceleration due to gravity.. and by more familiar, I am of course referring to how it felt in NS1, and not how it feels in the real world, because in the real world we have a sense of physical motion and not just relative motion to stationary objects due to visual cues, as in a computer game.
When I played the Engine Test I also thought that the jumping was a bit weird. It seems like you jump rather high...