Thread: Pre-RS3 NPC Special Walking Movement Type

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 Pre-RS3 NPC Special Walking Movement Type 
    Christ is King

    Makar's Avatar
    Join Date
    Jul 2011
    Age
    29
    Posts
    2,004
    Thanks given
    545
    Thanks received
    965
    Rep Power
    427
    Now I'm sure tons of you have seen ganodermic beasts, new chickens, and grotworms sliding around in a T-Pose when they should be animating while walking.

    I am sure some of you have seen this wonky hardcode fix going around (this example is from Matrix 3's polypore npc code)

    Code:
    @Override
    public void processMovement() {
    	super.processMovement();
    	if (realId == 14696 && getNextWalkDirection() != -1) {
    		this.setNextAnimation(new Animation(15465));
    		this.setNextForceMovement(new NewForceMovement(this, 1, null, 0, Utils.getAngle(Utils.DIRECTION_DELTA_X[getNextWalkDirection()], Utils.DIRECTION_DELTA_Y[getNextWalkDirection()])));
    	}
    }
    Basically forcing a movement animation using forcemovement. Well the render animation definitions of the monster hold animations for a third movement type. Not walking, not running.It seems to be used for monsters that move either half speed of normal monsters, or monsters that move 2 squares in one direction at a time such as ganodermic beasts.

    The correct way to trigger this animation to be used directly from the render animation of the npc is to just have an exception inside where it updates an npc to be "running".

    As you can see in the client code here where the client determines which render animation to use, there is a "teleport" animation type. I only call it teleport because it's the same movement type id that players use in player update as a teleport movement. Should probably rename it to SPECIAL or something instead.

    Here is where the client determines if the NPC uses this specific type of movement so you can update your NPC update methods accordingly: NPCDefinitions here

    If you're using Matrix's crazy ass control flow for NPC updating, here's where you'd make the change:

    Code:
    if (n.getNextRunDirection() == -1) {
    	if (n.getDefinitions().walksSpecial()) {
    		stream.writeBits(2, 2);
    		stream.writeBits(1, 0);
    		stream.writeBits(3, Utils.getNpcMoveDirection(n.getNextWalkDirection()));
    	} else {
    		stream.writeBits(2, 1);
    		stream.writeBits(3, Utils.getNpcMoveDirection(n.getNextWalkDirection()));
    	}
    } else {
    	stream.writeBits(2, 2);
    	stream.writeBits(1, 1);
    	stream.writeBits(3, Utils.getNpcMoveDirection(n.getNextWalkDirection()));
    	stream.writeBits(3, Utils.getNpcMoveDirection(n.getNextRunDirection()));
    }
    Last edited by Makar; 07-22-2021 at 03:59 PM.
    Attached image
    The best open-source pre-eoc remake project that isn't in its early stages for once
    Darkan Client (727 Client Refactor)
    Darkan World Server
    “It would not be impossible to prove with sufficient repetition and a psychological understanding of the people concerned that a square is in fact a circle. They are mere words, and words can be molded until they clothe ideas and disguise.”
    Reply With Quote  
     


  2. #2  
    Developer


    Join Date
    Aug 2012
    Posts
    2,493
    Thanks given
    180
    Thanks received
    1,732
    Rep Power
    2487
    i actually never dwelled on the thought that this so-called 't-pose' might have been an issue in npc updating.

    very nice contribution, i'll make sure to rep++ when i'm not limited anymore
    Reply With Quote  
     

  3. #3  
    Registered Member
    Teemuzz's Avatar
    Join Date
    Oct 2009
    Posts
    2,755
    Thanks given
    1,212
    Thanks received
    422
    Rep Power
    934
    It's not teleport it's crawling or half tick for type 0, type 1 is walking, t2 running and t127 for teleportation
    Reply With Quote  
     

  4. #4  
    Christ is King

    Makar's Avatar
    Join Date
    Jul 2011
    Age
    29
    Posts
    2,004
    Thanks given
    545
    Thanks received
    965
    Rep Power
    427
    Quote Originally Posted by Teemuzz View Post
    It's not teleport it's crawling or half tick for type 0, type 1 is walking, t2 running and t127 for teleportation
    Yeah that's why I said I need to rename it as it was incorrectly named. Should be something like special since it doesn't just apply to half-speed mobs.
    Attached image
    The best open-source pre-eoc remake project that isn't in its early stages for once
    Darkan Client (727 Client Refactor)
    Darkan World Server
    “It would not be impossible to prove with sufficient repetition and a psychological understanding of the people concerned that a square is in fact a circle. They are mere words, and words can be molded until they clothe ideas and disguise.”
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Registered Member
    Teemuzz's Avatar
    Join Date
    Oct 2009
    Posts
    2,755
    Thanks given
    1,212
    Thanks received
    422
    Rep Power
    934
    Quote Originally Posted by Makar View Post
    Yeah that's why I said I need to rename it as it was incorrectly named. Should be something like special since it doesn't just apply to half-speed mobs.
    Just looked at it and atleast gd beasts seem like they half tile per tick move too. Didn't see anything in the code posted either for that being for something else than halfspeed, or i'm just misunderstanding you here. but it be slow movement or ~running or *more shit jokes about inversed running*
    Reply With Quote  
     

  7. #6  
    Renown Programmer
    Greg's Avatar
    Join Date
    Jun 2010
    Posts
    1,179
    Thanks given
    260
    Thanks received
    1,012
    Rep Power
    2003
    Quote Originally Posted by Makar View Post
    Matrix's crazy ass control flow for NPC updating



    Nice info, the more people not using hardcoded quick fixes the better
    Attached imageAttached image
    Reply With Quote  
     

  8. #7  
    Christ is King

    Makar's Avatar
    Join Date
    Jul 2011
    Age
    29
    Posts
    2,004
    Thanks given
    545
    Thanks received
    965
    Rep Power
    427
    Quote Originally Posted by Teemuzz View Post
    Just looked at it and atleast gd beasts seem like they half tile per tick move too. Didn't see anything in the code posted either for that being for something else than halfspeed, or i'm just misunderstanding you here. but it be slow movement or ~running or *more shit jokes about inversed running*
    What about grotworms? I felt like those and ganos could keep up with me in real rs pretty well.

    EDIT: These are all of the NPCs that walk using this movement type

    Code:
    Henryeta Carnillean (889)
    Leprechaun Champion (8993)
    Ayuni (13218)
    Ayuni (13219)
    Ayuni (13220)
    Chicken (13825)
    Snotgut (14366)
    Snotgut (14367)
    Snotgut (14368)
    Snotgut (14369)
    Scrambles (14370)
    Scrambles (14371)
    Scrambles (14372)
    Scrambles (14373)
    Evil Chicken (14521)
    Evil Chicken (14522)
    Evil Chicken (14559)
    Ayuni (14601)
    Ayuni (14605)
    Ganodermic beast (14696)
    Ganodermic beast (14697)
    Ganodermic runt (14698)
    Ganodermic runt (14699)
    Chicken (15051)
    Chicken (15052)
    Chicken (15053)
    Chicken (15054)
    Young grotworm (15461)
    Grotworm (15462)
    Mature grotworm (15463)
    Giant worm (15464)
    Grotworm (15495)
    Carriage (15560)
    Unicorn (15561)
    Unicorn (15562)
    Last edited by Makar; 03-18-2019 at 07:29 AM.
    Attached image
    The best open-source pre-eoc remake project that isn't in its early stages for once
    Darkan Client (727 Client Refactor)
    Darkan World Server
    “It would not be impossible to prove with sufficient repetition and a psychological understanding of the people concerned that a square is in fact a circle. They are mere words, and words can be molded until they clothe ideas and disguise.”
    Reply With Quote  
     

  9. #8  
    Registered Member
    Teemuzz's Avatar
    Join Date
    Oct 2009
    Posts
    2,755
    Thanks given
    1,212
    Thanks received
    422
    Rep Power
    934
    Quote Originally Posted by Makar View Post
    What about grotworms? I felt like those and ganos could keep up with me in real rs pretty well.

    EDIT: These are all of the NPCs that walk using this movement type

    Code:
    Henryeta Carnillean (889)
    Leprechaun Champion (8993)
    Ayuni (13218)
    Ayuni (13219)
    Ayuni (13220)
    Chicken (13825)
    Snotgut (14366)
    Snotgut (14367)
    Snotgut (14368)
    Snotgut (14369)
    Scrambles (14370)
    Scrambles (14371)
    Scrambles (14372)
    Scrambles (14373)
    Evil Chicken (14521)
    Evil Chicken (14522)
    Evil Chicken (14559)
    Ayuni (14601)
    Ayuni (14605)
    Ganodermic beast (14696)
    Ganodermic beast (14697)
    Ganodermic runt (14698)
    Ganodermic runt (14699)
    Chicken (15051)
    Chicken (15052)
    Chicken (15053)
    Chicken (15054)
    Young grotworm (15461)
    Grotworm (15462)
    Mature grotworm (15463)
    Giant worm (15464)
    Grotworm (15495)
    Carriage (15560)
    Unicorn (15561)
    Unicorn (15562)
    Watched a vid and ganos actually move pretty slow compared to players but what if they have in combat sped up movement to walking? Idk i've never witnessed them
    Reply With Quote  
     

  10. #9  
    Christ is King

    Makar's Avatar
    Join Date
    Jul 2011
    Age
    29
    Posts
    2,004
    Thanks given
    545
    Thanks received
    965
    Rep Power
    427
    Quote Originally Posted by Teemuzz View Post
    Watched a vid and ganos actually move pretty slow compared to players but what if they have in combat sped up movement to walking? Idk i've never witnessed them
    Yeah I think they do move half speed. Because the animation looks perfect with them when I apply it in my server.
    Attached image
    The best open-source pre-eoc remake project that isn't in its early stages for once
    Darkan Client (727 Client Refactor)
    Darkan World Server
    “It would not be impossible to prove with sufficient repetition and a psychological understanding of the people concerned that a square is in fact a circle. They are mere words, and words can be molded until they clothe ideas and disguise.”
    Reply With Quote  
     

  11. Thankful user:


  12. #10  
    That's just all he knows.

    Join Date
    Mar 2009
    Posts
    132
    Thanks given
    9
    Thanks received
    7
    Rep Power
    0
    Quote Originally Posted by Makar View Post
    What about grotworms? I felt like those and ganos could keep up with me in real rs pretty well.

    EDIT: These are all of the NPCs that walk using this movement type

    Code:
    Henryeta Carnillean (889)
    Leprechaun Champion (8993)
    Ayuni (13218)
    Ayuni (13219)
    Ayuni (13220)
    Chicken (13825)
    Snotgut (14366)
    Snotgut (14367)
    Snotgut (14368)
    Snotgut (14369)
    Scrambles (14370)
    Scrambles (14371)
    Scrambles (14372)
    Scrambles (14373)
    Evil Chicken (14521)
    Evil Chicken (14522)
    Evil Chicken (14559)
    Ayuni (14601)
    Ayuni (14605)
    Ganodermic beast (14696)
    Ganodermic beast (14697)
    Ganodermic runt (14698)
    Ganodermic runt (14699)
    Chicken (15051)
    Chicken (15052)
    Chicken (15053)
    Chicken (15054)
    Young grotworm (15461)
    Grotworm (15462)
    Mature grotworm (15463)
    Giant worm (15464)
    Grotworm (15495)
    Carriage (15560)
    Unicorn (15561)
    Unicorn (15562)
    How did you determine this ? Is this your walksSpecial() function ? I'm trying to distinguish how i could make this function without having a giant if statement returning true; Thoughts / post yours?

    Thanks!!
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. How do i make npc's walk on a 508?
    By WTFZ in forum Help
    Replies: 2
    Last Post: 05-18-2009, 07:43 PM
  2. Making NPCs not walk throught Players & NPCs
    By Nemmyz in forum Configuration
    Replies: 10
    Last Post: 03-11-2009, 12:20 PM
  3. NPC Custom Walking
    By Aconitic in forum Show-off
    Replies: 7
    Last Post: 02-22-2009, 11:54 PM
  4. Quick Help with making NPCs say what i type thru a command
    By myserverIP192.168.200.253 in forum RS2 Server
    Replies: 0
    Last Post: 06-10-2008, 11:35 PM
  5. making npc's walk(noob friendly)
    By hoodlom in forum Tutorials
    Replies: 4
    Last Post: 02-11-2008, 11:45 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •