Modding:Animation

This page is a candidate to be rewritten.
Reason: The VSMC Tutorials are being rewritten and restructured. Thank you for the patience!
This page may use or reference older systems, and is due to be rewritten. Feel free to use it, but please be aware that its contents may not reflect the rest of the wiki.
Below can be found modified version of an VSMC animation tutorial[1] created by Luke. This is a basic tutorial, but it is recommended that you have completed the Modeling tutorial before starting this one.
Also take a look at this awesome set of tutorials on using the model creator to create a pangolin, made by Tenth Architect:
Preparing
Vintage Story has its own model creator called VS Model Creator that allows anyone to create, texture, and animate custom shapes for use in Vintage Story mods. The newest version can be downloaded here.
This tutorial uses a premade model. You can use your own or download Luke's model here (trusted file, published by game developers team member).
After loading it in, go ahead and click the “Keyframe” tab to open up the animator.
UI
So now what are we looking at? It’s not that different from the model creator. Animation can be thought of as time + position. So we have our time values on the left, and our positional values on the right. We’ll start with the right, because it’s very similar to the model creator. So at the top right you have the hierarchy (or object selector). As you already know, you click on the various objects here to choose which one you want to edit.
Next below the hierarchy we have the object editor. This is what we use to adjust position or rotation, just like in the model creator. The only difference is that by default these values are turned off. I’ll explain this later, but for now just know that this is where you manipulate the shapes. And also Stretch doesn’t do anything. Sorry.
Now for the left side, we have at the top left the Animation Selector. This is where you pick which animation to work on. It’s also where you make new animations.
Below that is the Timeline. You use this to fast forward, rewind, pause, etc.. Basically like a remote control for your TV.
And finally we have the Keyframe Editor. Okay, so this is where I have to get a little technical to explain what keyframes are.. Bear with me.
What is a Keyframe?
So every animation is made up of frames. These are still images that, when the animation is playing, we view one after the other in quick succession. When the frames succeed each other fast enough (usually measured as Frame Rate or Frames per Second), it creates the illusion of motion. This is the basis of all cinema and animation.
So what is a Key Frame?? These are basically the important frames that are used as a reference for the other frames. You can also think of them as the beginning and end of a given motion. The idea is, you make these particular frames look nice and detailed, and then the rest of the frames don’t have to be as detailed because they work as transitions (or inbetweens) for the keyframes. This way, you only have to work on 4 frames instead of 30, for example. If that doesn’t make sense, don’t worry about the theory. It should be clear at least in practice soon enough.
Animation Process
Okay! Now that that’s out of the way, let’s actually animate something. Mouse over to the Animation Selector in the top left and click the +- looking button right next to the drop down menu. This will open up your List of Animations. From here, we’re going to make a new one by pressing the giant New button at the bottom. Let’s call it “Jump”. Those are the values on the side are your animation settings. Code is the information that VS looks for. Generally, you probably want to make it the same as the animation name, except lowercase. “On Activity stopped” refers to what happens after the object in game stops their action. For example, when a sheep stops running, you can tell it to stop its animation immediately, ease out of the animation in a transition, complete the animation despite no longer running, or play the animation backward. You’ll figure out which one to use for each situation, but for now we don’t need to worry about it. “On Animation ended” refers to the animation itself instead of the object it’s attached to. So this would mean when you’ve played through all the frames. You can set it to loop, hold on the last frame, or just stop (so that it only plays the animation once). Again, we don’t need it worry about this right now, but it’s good to know. We can close out of this menu now, after making sure you have your new “Jump” animation selected.
Okaay, so now we have a fresh animation to work on. Let’s make it jump. The timeline should be set to 0, and you shouldn’t have any keyframes in sight. Now we make some keyframes. To start with, select “Body” in the hierarchy, and activate Position. It will automatically set to 0, 0, 0. Which is good, because we want this to be the starting point. This also automatically creates a keyframe for “Body” at frame #0.
Next, go to the timeline and drag the scrollbar to 15 (which is frame #15).
Once you’ve done that, activate Position again for “Body” so that the editor knows to make a keyframe here as well. Now let’s change the Y value to 4. You’ll notice the model going up in the display. Now if hit the Play button on the timeline, you can watch your work in action. It should look like this:
You’ve managed to make the Body move up and down, but now it’s time to add some rotation. Let’s give its legs some motion. It’s a pretty similar process, so you should be able to just follow along with this image:
And that’s the gist of it. Now, you can use the animation selector in the top left to view the “Run” animation. It’s basically what our rabbit would look like if we kept working on it. You can look around this animation to get an idea for how to utilize position, rotation, and keyframes. I hope this has been helpful!
Notes
- Stretch tab is no longer a thing in new versions.
See Also
Animation Intermediate Tutorial
References
Modding | |
---|---|
Basics • Content • Code • Asset Types • Model Creator • Troubleshooting • VS Engine | |
Model Creator Basics • Tutorials • Model Animation • All VSMC Pages |