Player Movement

puzlpuzl The Old Firm Join Date: 2003-02-26 Member: 14029Retired Developer, NS1 Playtester, Forum Moderators, Constellation
edited April 2010 in NS2 General Discussion
<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-->

Comments

  • remiremi remedy [blu.knight] Join Date: 2003-11-18 Member: 23112Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester
    -9.81 = real world gravity constant. A more "heavy" player wouldn't fall faster in the real world...
  • DJPenguinDJPenguin Useless Join Date: 2003-07-29 Member: 18538Members
    the jumping feels awkward as well. i fear a return of bunny hopping.
  • KazterKazter Join Date: 2003-08-12 Member: 19481Members, Constellation
    Puzl would we add these lines somewhere in the directory folder or do we just add them into the console?

    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.
  • eoyeoy Join Date: 2004-11-18 Member: 32860Members
    I have to say the game feels a lot better with puzl's tweaks!
  • ZekZek Join Date: 2002-11-10 Member: 7962Members, NS1 Playtester, Constellation, Reinforced - Shadow
    edited April 2010
    Bunnyhopping is long gone if the jump physics stay like they are(which I doubt), there's none of HL's weird turning momentum - you just keep moving around as if you were on the ground.
  • rsdrsd Join Date: 2003-02-11 Member: 13405Members
    <!--quoteo(post=1765316:date=Apr 10 2010, 06:09 PM:name=Kazter)--><div class='quotetop'>QUOTE (Kazter @ Apr 10 2010, 06:09 PM) <a href="index.php?act=findpost&pid=1765316"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Puzl would we add these lines somewhere in the directory folder or do we just add them into the console?

    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
  • JirikiJiriki retired ns1 player Join Date: 2003-01-04 Member: 11780Members, NS1 Playtester, Squad Five Silver
    The air dodge is great, I hope it stays in official. Haven't played around with the vars yet but I like the customizability.
  • surprisesurprise Join Date: 2003-01-16 Member: 12382Members, Constellation
    I added another feature of NS1 in: Walking backwards is slower.
    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
  • RisingSunRisingSun Rising California Join Date: 2004-04-19 Member: 28015Members, Constellation, Reinforced - Shadow, WC 2013 - Shadow
    With those settings it feels like you are at a constant sprint, but it does feel exactly like good ol' NS.
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    atm the game feels like it is in a semi low gravity setting somehow... (with the default values)
  • PipiPipi Join Date: 2009-12-09 Member: 69550Members
    Don't know what is all the fuss. They certainly just coded a few lines for your common marine to walk around and jump in a really cheap way. They specifically said that there was absolutely no code from the actual game in this build.. it's en engine test.
  • NossahNossah Join Date: 2002-11-11 Member: 8234Members, Constellation
    edited April 2010
    I'm having a bit of trouble finding the player.movespeed function, but i use the death match mod so it might have been changed to something else. Do you happen to know what the string there is? Or what i would have to change in this lua file to try these tweaks?

    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
  • puzlpuzl The Old Firm Join Date: 2003-02-26 Member: 14029Retired Developer, NS1 Playtester, Forum Moderators, Constellation
    I haven't looked at the deatmatch mod, but I doubt they changed such a core variable. Make sure you either use the correct capitalisation, or have case-ignore off in your search.
  • xposed-xposed- Join Date: 2007-09-23 Member: 62412Members, Constellation
    <!--quoteo(post=1765292:date=Apr 10 2010, 11:27 PM:name=Psyke)--><div class='quotetop'>QUOTE (Psyke @ Apr 10 2010, 11:27 PM) <a href="index.php?act=findpost&pid=1765292"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->-9.81 = real world gravity constant. A more "heavy" player wouldn't fall faster in the real world...<!--QuoteEnd--></div><!--QuoteEEnd-->

    you're saying denser objects fall just as fast as lighter objects given the gravitational constant?
  • JirikiJiriki retired ns1 player Join Date: 2003-01-04 Member: 11780Members, NS1 Playtester, Squad Five Silver
    edited April 2010
    I'm working on the DM mod aswell. Instagib mod has Q3-like movement:

    Player.moveSpeed = 12
    Player.moveAcceleration = 5
    Player.jumpHeight = 0.7

    Traditional DM has slightly more gravity, less speed etc.
  • Voyager IVoyager I Join Date: 2009-11-02 Member: 69222Members
    <!--quoteo(post=1766208:date=Apr 12 2010, 02:31 PM:name=xposed-)--><div class='quotetop'>QUOTE (xposed- @ Apr 12 2010, 02:31 PM) <a href="index.php?act=findpost&pid=1766208"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->you're saying denser objects fall just as fast as lighter objects given the gravitational constant?<!--QuoteEnd--></div><!--QuoteEEnd-->

    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.
  • puzlpuzl The Old Firm Join Date: 2003-02-26 Member: 14029Retired Developer, NS1 Playtester, Forum Moderators, Constellation
    You are confusing weight and mass. Would you feel heavier or lighter on the moon or mars? What would acceleration due to gravity be there?
    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.
  • WJPWJP Join Date: 2003-04-08 Member: 15324Members
    Here, watch this video about the different masses and the gravity: <a href="http://www.youtube.com/watch?v=5C5_dOEyAfk" target="_blank">http://www.youtube.com/watch?v=5C5_dOEyAfk</a> :)

    When I played the Engine Test I also thought that the jumping was a bit weird. It seems like you jump rather high...
Sign In or Register to comment.