Walking On Walls

SteeleSteele Join Date: 2004-04-11 Member: 27858Members
<div class="IPBDescription">Alien Walking on Walls feature</div> Hi,
I was wanting to ask a quick question to the coding team of Natural Selection and hopefully this is the right forum.Oh well here it goes, I was wondering how you did the Alien walking on walls in NS <!--emo&???--><img src='http://www.unknownworlds.com/forums/html//emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif' /><!--endemo-->. I was guessing Vectors and such but im no expert coder and puzzled by walking on walls. A quick explantion or a little code would do fine. The fans of our mod were requesting it be done but Kamisorix (lead coder) didn't know how to do it and I didnt want to let the fans down so I came here. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->

ciao,
steele

btw- If you don't know what I mean, here is the url to the topic <a href='http://s4.invisionfree.com/NTP/index.php?act=Post&CODE=02&f=1&t=263' target='_blank'>Walking on walls topic</a> thanks again.

Comments

  • ThansalThansal The New Scum Join Date: 2002-08-22 Member: 1215Members, Constellation
    hmmmm

    The best place to ask about stuff like this is actualy the mod resource places...

    there are a few, unfortunatly I don't remember them ATM

    DOOMeh Know what they are (as I remember him mentioning them a few times)
  • Nemesis_ZeroNemesis_Zero Old European Join Date: 2002-01-25 Member: 75Members, Retired Developer, NS1 Playtester, Constellation
    Hey Steele, I fear Flayra, the guy who coded the wallwalking, is currently busy head-starting Unknown Worlds Entertainment, so your best bet for an exact answer would indeed be one of the modding resources, but if I'm not mistaken, it's fundamentally based on the ladder code.
  • SteeleSteele Join Date: 2004-04-11 Member: 27858Members
    edited April 2004
    Well I know a few. But thanks for trying to help <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->

    <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html//emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /><!--endemo--> Thx Nemisis
  • HirayoHirayo Join Date: 2004-04-11 Member: 27860Members
    maybe you should put an func_ladder on every wall <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
  • ClashenClashen Join Date: 2003-08-22 Member: 20087Members
    <!--QuoteBegin-Hirayo+Apr 11 2004, 11:21 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Hirayo @ Apr 11 2004, 11:21 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> maybe you should put an func_ladder on every wall <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo--> <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    Haha, would work, crappy tough <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html//emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /><!--endemo-->
  • NarfwakNarfwak Join Date: 2002-11-02 Member: 5258Members, Super Administrators, Forum Admins, NS1 Playtester, Playtest Lead, Forum Moderators, Constellation, NS2 Playtester, Squad Five Blue, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow, Subnautica PT Lead, NS2 Community Developer
    <!--QuoteBegin-Nemesis Zero+Apr 11 2004, 12:36 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Nemesis Zero @ Apr 11 2004, 12:36 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Hey Steele, I fear Flayra, the guy who coded the wallwalking, is currently busy head-starting Unknown Worlds Entertainment, so your best bet for an exact answer would indeed be one of the modding resources, but if I'm not mistaken, it's fundamentally based on the ladder code. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    Didn't Max do a lot of it, or did he just do the model rotation? In any case, Max has informed us that he's not working on NS anymore.
  • ThansalThansal The New Scum Join Date: 2002-08-22 Member: 1215Members, Constellation
    thats new....
    to bad (he did alot of great things)

    However, no Flayra did almost all of NS1 by himself from what I understand (Max came in like right after the first release if my mind serves me corectly....)
  • ComproxComprox *chortle* Canada Join Date: 2002-01-23 Member: 7Members, Super Administrators, Forum Admins, NS1 Playtester, NS2 Developer, Constellation, NS2 Playtester, Reinforced - Shadow, WC 2013 - Silver, Subnautica Developer, Subnautica Playtester, Pistachionauts
    I think it's based of ladder code but I have some memory Flayra saying it was based off setting gravity to 0 or something when within x cordinates of the wall. But that might be wrong and code might of drastically changed <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->
  • RaVeRaVe Join Date: 2003-06-20 Member: 17538Members
    It's made so that the skulk treats all world-brushes and entity brushes (maybe except the skybox) as ladders. I really have no idea how he put it in.

    Pretty much a modified ladder code.
  • DOOManiacDOOManiac Worst. Critic. Ever. Join Date: 2002-04-17 Member: 462Members, NS1 Playtester
    <!--QuoteBegin-Comprox+Apr 11 2004, 04:14 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Comprox @ Apr 11 2004, 04:14 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> I think it's based of ladder code but I have some memory Flayra saying it was based off setting gravity to 0 or something when within x cordinates of the wall. But that might be wrong and code might of drastically changed :) <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    That would be how I would go about doing it. But then again I'm a complete nub. :P
  • SteeleSteele Join Date: 2004-04-11 Member: 27858Members
    <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo--> Well thanks all of you, I made the wall walk thing but its junk, func_ladder ^_^, and you would press left, forward, right to get on then wall. yes its junk I know, I know. But im working on it now so you dont have to put func_ladders. Hirayo tested it out for me. <!--emo&::marine::--><img src='http://www.unknownworlds.com/forums/html//emoticons/marine.gif' border='0' style='vertical-align:middle' alt='marine.gif' /><!--endemo-->
  • xectxect Join Date: 2002-11-24 Member: 9807Members
    One of the better modding resources has to be <a href='http://forums.thewavelength.net/' target='_blank'>the wavelength forums</a>.
  • Nemesis_ZeroNemesis_Zero Old European Join Date: 2002-01-25 Member: 75Members, Retired Developer, NS1 Playtester, Constellation
    <!--QuoteBegin-Narfwak+Apr 11 2004, 10:02 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Narfwak @ Apr 11 2004, 10:02 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Didn't Max do a lot of it, or did he just do the model rotation? In any case, Max has informed us that he's not working on NS anymore. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    Max joined around 2.0, wallwalking is a 1.0 feature, which was all done by Charlie. It's indeed sad to see Max go, but I can easily understand why Iron Lore wouldn't want one of their main coders entangled in a project that's now essentially part of a competing companies lineup.
  • ThansalThansal The New Scum Join Date: 2002-08-22 Member: 1215Members, Constellation
    google....

    Top Secret Game.....

    Well if Max is ONE of the people working on that game I can't wait to see what it is <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->
  • GeminosityGeminosity :3 Join Date: 2003-09-08 Member: 20667Members
    actually the skulk treats ALL surfaces as a ladder, even the floor. If you wanna check it out look up directly up while sitting on the floor and press forward =D

    no worries about gravity or anything; just use the ladder code as per usual. Not so sure about detection but the idea is that your alien will be in fly mode until it doesn't have a brush within a certain distance... maybe do a radial check? ~shrugs~
  • SteeleSteele Join Date: 2004-04-11 Member: 27858Members
    I created one that doesnt require func_ladders but it just crashes, so just stick with func_ladders? <!--emo&???--><img src='http://www.unknownworlds.com/forums/html//emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif' /><!--endemo-->
  • GeminosityGeminosity :3 Join Date: 2003-09-08 Member: 20667Members
    how about finding out why it crashes instead ^~

    probably returning a pointer from your collision test and you forgot to check if it's NULL before using it resulting in it trying to calc something that's not there and exploding =3
  • SteeleSteele Join Date: 2004-04-11 Member: 27858Members
    Yeah Ill do that tonight <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html//emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /><!--endemo--> . Hopefully it will work.
  • DiscoZombieDiscoZombie Join Date: 2003-08-05 Member: 18951Members
    wow, I always thought wall walking was done by treating walls like water, not like ladders :>

    ...simply because you can +moveup on walls and in water but not on ladders...
  • ZelZel Join Date: 2003-01-27 Member: 12861Members
    it cant be gravity or water with radius checking for proximity to walls, because in any room more complex than a box (let alone a damned NS super-level) it would lag the server to hell and back. the solution must be contained in the skulk himself, and a ladder adaptation sounds like good way of going about it.
  • GeminosityGeminosity :3 Join Date: 2003-09-08 Member: 20667Members
    not really zel... grenades do radius checks and so do AI and even players to some degree (you do a large box check plus a heckload of other calculations to determine whether you can see something or not). You also constantly check around you for ladders amongst and absolutely huge number of other constant checks (ever noticed how you pick things up?), none of which lag the server excessively.
    And I said ladder movement, not gravity =P

    To refine the suggestion a little more perhaps you should look at what detects that you've touched a func_ladder and change it to detecting if you're touching anything at all XD

    Ladders and water are actually not far off the same thing in the HL engine disco =3
    They both make your char change from movetype step to movetype fly there's probably just a small piece of code that checks to see if you're near a ladder before allowing moveup that's all. I'd have to look into it more to be honest but I can't be bothered lol ^^
  • LikuLiku I, am the Somberlain. Join Date: 2003-01-10 Member: 12128Members
    <!--QuoteBegin-DiscoZombie+Apr 11 2004, 10:58 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (DiscoZombie @ Apr 11 2004, 10:58 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> wow, I always thought wall walking was done by treating walls like water, not like ladders :>

    ...simply because you can +moveup on walls and in water but not on ladders... <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    Yup, that's what I heard on LunixMonster. Walls are treated like the skulk would be in water, but with unlimited air.
  • SteeleSteele Join Date: 2004-04-11 Member: 27858Members
    Ok well I was undecided about if they used water or ladder. So I took a look at the water code and combined what I thought was useful with ladder code. Please forgive me, this is indeed sloppy code. Also took some code from the wavelength wall jumping to check for walls in an area( for them it was 16 units to check for a wall for me its 5, the variable is smove). well here is my code (Yes its inline <!--emo&???--><img src='http://www.unknownworlds.com/forums/html//emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif' /><!--endemo--> )

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->

    inline void wow( )
    {
    if(pmove->cmd.buttons & IN_FORWARD /*&&*/)
    {
       pmtrace_t trace;
       vec3_t  end, right;
    vect3_t smove; //units

    smove = 5; // 5 units
       
    for (i=0; i<2; i++){  //check wall, used in water code
            end[i] = pmove->origin[i] + right[i] * smove;
            trace = pmove->PM_PlayerTrace (pmove->origin, end, PM_WORLD_ONLY, -1 ); //trace to the world only!
    }

       if ( trace.fraction != 1.0 ) //if there was a wall there
    {
     float forward = 0, right = 0;
     vec3_t vpn, v_right;

           pev->movetype = MOVETYPE_FLY;

           AngleVectors( pmove->angles, vpn, v_right, NULL );
     if ( pmove->cmd.buttons & IN_FORWARD )
      forward += MAX_CLIMB_SPEED;
     if ( pmove->cmd.buttons & IN_MOVELEFT )
      right -= MAX_CLIMB_SPEED;
     if ( pmove->cmd.buttons & IN_MOVERIGHT )
      right += MAX_CLIMB_SPEED;
     if ( pmove->cmd.buttons & IN_JUMP )
               pmove->movetype = MOVETYPE_WALK;

    }
    return;
    }
    <!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
    If this is right please tell me and rip my code if you want to (if its right) and put it in your own mod, I dont want fellow coders having to play guess and check with their wall jumping code. <!--emo&::nerdy::--><img src='http://www.unknownworlds.com/forums/html//emoticons/nerd.gif' border='0' style='vertical-align:middle' alt='nerd.gif' /><!--endemo-->
Sign In or Register to comment.