Thread: [#174] All NPC Possible Animations

Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11  


    Major's Avatar
    Join Date
    Jan 2011
    Posts
    2,997
    Thanks given
    1,293
    Thanks received
    3,556
    Rep Power
    5000
    Quote Originally Posted by Kris View Post
    It has no correlation to which point an animation starts at. I'll say it again in a single sentence. All the frames of all the animations that function on a single skeleton belong in the same frame(or skeleton) map. If you know the animation, you can use any frame in that animation to locate the map, and thus, all the other animations that fit the skeleton.
    I can't explain it any clearer than I have.
    Okay so essentially in OSRS there's a collection that maps from skeleton_id to [every frame applicable to this skeleton]? That's not what I interpreted 'frame map' to mean

    Now I looked up the frame map that these frames belong in. (This is mostly done by looping)
    The id of the map turned out to be 304.
    Now I printed out all of the frames that belong in that map, giving me a total set of frames:
    So 304 is the id of the corp skeleton in this map? You seem to be using 'frame map' to refer to both the skeleton->frameset map and also the set of frames (if this is even what the client actually has - thats my understanding of your posts at least), makes it difficult to follow what you're talking about

    edit: a skeleton and a frame arent the same thing, if thats a source of confusion
    Reply With Quote  
     

  2. #12  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by Major View Post
    Okay so essentially in OSRS there's a collection that maps from skeleton_id to [every frame applicable to this skeleton]? That's not what I interpreted 'frame map' to mean



    So 304 is the id of the corp skeleton? You seem to be using 'frame map' to refer to both the skeleton->frameset map and also the set of frames (if this is even what the client actually has - thats my understanding of your posts at least), makes it difficult to follow what you're talking about
    There are different namings floating around here, so I don't really know what to use. I guess the best way to explain what I mean is to say which indice(or index as some people refer) is which.
    Frame - I also refer to it as skeleton occasionally, exists in indice 0.
    Frame map - exists in indice 1.
    Animation definitions(sequence as RS calls it) - In OSRS, they're in indice 2(config indice), archive/group 12.

    Each frame starts off by writing the frame map id in a short(this is in OSRS, in RS3, there's an extra byte written before that). This effectively links all frames together to a single frame map. TL;DR: You loop all the frames and associate them to their respective maps - you cannot gather a list of fitting frames from the frame map itself.
    Now, to find the matching animations, you need to loop the animation definitions. Each definition contains an array of frames. Since you previously mapped down all the frames to their respective maps - you can find out which map the animation belongs to based on that array of frames(all the frames will belong to the same frame map, so you can safely just map it based on the very first frame if you wanted to speed the process).
    Effectively all it is, is just a shitton of looping. There are over 110k frame maps in OSRS, almost a million in RS3.

    I'm sure you knew the latter block I just said but just in case there's some confusion about it, I explained the process of associating them all together.
    Attached image
    Reply With Quote  
     

  3. #13  


    Major's Avatar
    Join Date
    Jan 2011
    Posts
    2,997
    Thanks given
    1,293
    Thanks received
    3,556
    Rep Power
    5000
    Quote Originally Posted by Kris View Post
    There are different namings floating around here, so I don't really know what to use. I guess the best way to explain what I mean is to say which indice(or index as some people refer) is which.
    Frame - I also refer to it as skeleton occasionally, exists in indice 0.
    Frame map - exists in indice 1.
    Animation definitions(sequence as RS calls it) - In OSRS, they're in indice 2(config indice), archive/group 12.

    Each frame starts off by writing the frame map id in a short(this is in OSRS, in RS3, there's an extra byte written before that). This effectively links all frames together to a single frame map. TL;DR: You loop all the frames and associate them to their respective maps - you cannot gather a list of fitting frames from the frame map itself.
    Now, to find the matching animations, you need to loop the animation definitions. Each definition contains an array of frames. Since you previously mapped down all the frames to their respective maps - you can find out which map the animation belongs to based on that array of frames(all the frames will belong to the same frame map, so you can safely just map it based on the very first frame if you wanted to speed the process).
    Effectively all it is, is just a shitton of looping. There are over 110k frame maps in OSRS, almost a million in RS3.

    I'm sure you knew the latter block I just said but just in case there's some confusion about it, I explained the process of associating them all together.
    basically youre talking about this class?

    Code:
    public final class FrameBase {
    
    	public final int count;
    	public final int[] transformationType;
    	public final int[][] groups;
    
    	public FrameBase(Buffer buffer) {
    		count = buffer.getUByte();
    		transformationType = new int[count];
    		groups = new int[count][];
    
    		for (int index = 0; index < count; index++) {
    			transformationType[index] = buffer.getUByte();
    		}
    
    		for (int group = 0; group < count; group++) {
    			int groupSize = buffer.getUByte();
    			groups[group] = new int[groupSize];
    
    			for (int index = 0; index < groupSize; index++) {
    				groups[group][index] = buffer.getUByte();
    			}
    		}
    	}
    }
    Edit: The 'group' local variable should really be called 'transformation'
    Last edited by Major; 12-09-2018 at 10:54 PM.
    Reply With Quote  
     

  4. #14  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by Major View Post
    basically youre talking about this class?

    Code:
    public final class FrameBase {
    
    	public final int count;
    	public final int[] transformationType;
    	public final int[][] groups;
    
    	public FrameBase(Buffer buffer) {
    		count = buffer.getUByte();
    		transformationType = new int[count];
    		groups = new int[count][];
    
    		for (int index = 0; index < count; index++) {
    			transformationType[index] = buffer.getUByte();
    		}
    
    		for (int group = 0; group < count; group++) {
    			int groupSize = buffer.getUByte();
    			groups[group] = new int[groupSize];
    
    			for (int index = 0; index < groupSize; index++) {
    				groups[group][index] = buffer.getUByte();
    			}
    		}
    	}
    
    }
    That is what I referred to as a frame map, yes.
    In indice 0 you'll find the frames themselves which will contain a link to this map, written as the first short in the buffer.

    Edit: some more information I forgot to mention before:
    "Frame map id" is effectively the file id in the cache.
    You can get the frame map id from a frame by shifting the frame id itself right by 16 bits; so for example taking frame id 31064066 (from my colour-coded example) and shifting it right by 16 bits, we get 31064066 >> 16 = 474(in my example as well as the dump before, I wrote it as 304 - this is wrong, my bad on that part - I was actually printing out the index of it in my extractor, not the frame map id itself; although it doesn't really matter - doubt you actually verified it)
    Attached image
    Reply With Quote  
     

  5. #15  


    Major's Avatar
    Join Date
    Jan 2011
    Posts
    2,997
    Thanks given
    1,293
    Thanks received
    3,556
    Rep Power
    5000
    To clear up some names (most of which have a rigorous definition because they come from modelling/animating):
    1. Animation (or a (frame) sequence in rs) is obvious
    2. Frame - a set of changes to a model applied in one update. Comes from a single frame on a film negative - in modern computing, one animation frame is applied to a model per frame rendered (i.e. drawn on screen).
    3. Bone - a group of vertices in a model (funnily enough, sometimes called a vertex group). This is what animation frames target - their transformations are applied at a bone level (so you can define frames by e.g. 'move forearm 10 pixels in the x direction' instead of 'move (forearm) pixel 432, 433, 444, 445, ...').
    4. Skeleton - a collection of bones (haha get it). Creating a skeleton for a model is known as rigging.

    Let me know if that's clear enough. Because what you're talking about is actually nothing to do with skeletons, and barely involves frames too. It's all about the bones:

    The array I've called "groups" is the set of bones manipulated by each transformation in an animation frame. So for the 42nd transformation in an animation frame, groups[42] is an int array, and those ints are the ids of the bones to move.

    So this process consists of:
    1. Finding the stand/walk animation for the npc you want (which are, as you said, stored in the cache).
    2. Picking a frame from that animation. Finding the FrameBase for that frame, and picking any random bone id from the 2d array inside.
    3. Searching through every other FrameBase to find the ones that manipulate the same bone. Store the ids of the ones you find.
    4. Finding the animations that feature those frames.

    This is what my original post was referring to, although 'bone count' was unintentionally misleading. But nice work! You can do this even back in 194
    Reply With Quote  
     

  6. Thankful user:


  7. #16  
    Respected Member


    Kris's Avatar
    Join Date
    Jun 2016
    Age
    26
    Posts
    3,638
    Thanks given
    820
    Thanks received
    2,642
    Rep Power
    5000
    Quote Originally Posted by Major View Post
    To clear up some names (most of which have a rigorous definition because they come from modelling/animating):
    1. Animation (or a (frame) sequence in rs) is obvious
    2. Frame - a set of changes to a model applied in one update. Comes from a single frame on a film negative - in modern computing, one animation frame is applied to a model per frame rendered (i.e. drawn on screen).
    3. Bone - a group of vertices in a model (funnily enough, sometimes called a vertex group). This is what animation frames target - their transformations are applied at a bone level (so you can define frames by e.g. 'move forearm 10 pixels in the x direction' instead of 'move (forearm) pixel 432, 433, 444, 445, ...').
    4. Skeleton - a collection of bones (haha get it). Creating a skeleton for a model is known as rigging.

    Let me know if that's clear enough. Because what you're talking about is actually nothing to do with skeletons, and barely involves frames too. It's all about the bones:

    The array I've called "groups" is the set of bones manipulated by each transformation in an animation frame. So for the 42nd transformation in an animation frame, groups[42] is an int array, and those ints are the ids of the bones to move.

    So this process consists of:
    1. Finding the stand/walk animation for the npc you want (which are, as you said, stored in the cache).
    2. Picking a frame from that animation. Finding the FrameBase for that frame, and picking any random bone id from the 2d array inside.
    3. Searching through every other FrameBase to find the ones that manipulate the same bone. Store the ids of the ones you find.
    4. Finding the animations that feature those frames.

    This is what my original post was referring to, although 'bone count' was unintentionally misleading. But nice work! You can do this even back in 194
    That's.. Not exactly it - the description is nice though. While everything you said is correct, I don't know if that will work. Specifically the second part. I don't do anything with the 2d array - I use the entire frame itself. I don't know if it is possible to do this on a vertice-group level, never tried that. But effectively, the frames all just point to a specific skeleton by your terms. I simply associate all of the frames with a specific skeleton, and then loop the animations, using the frames inside, matching them all to their respective skeletons. This effectively just gives me a map of <skeleton id, list of animations>, and that's what my previous dump is about.

    As for doing this on a bone level - it might work. You could potentially extend the system to use the bone level, and through that be able to map animations to the actual models directly. I haven't given it that much thought yet but it just might be possible.
    Attached image
    Reply With Quote  
     

Page 2 of 2 FirstFirst 12

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. [PI] All 474 NPC's & Animations
    By Delta in forum Requests
    Replies: 1
    Last Post: 12-25-2013, 09:04 PM
  2. All npc death and attack anims 634!
    By Exidia in forum Configuration
    Replies: 2
    Last Post: 09-18-2013, 07:03 PM
  3. New NPC Model Animations?
    By Gliomaru in forum Models
    Replies: 22
    Last Post: 07-24-2008, 08:37 PM
  4. [req]New NPC Model Animations[req]
    By mast3r in forum Models
    Replies: 0
    Last Post: 04-22-2008, 08:16 PM
  5. all npc autospawn.cfg
    By KingoScape in forum Downloads
    Replies: 3
    Last Post: 01-25-2008, 05:23 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •