Looking for a Tutorial for Minecraft 1.6 and Higher? Click HERE!
If you're reading this thread, it's likely you're either having problems with the new animation format introduced in Minecraft 1.5.1, or, are new to making animations for Minecraft and want to learn how with as few problems as possible.
This thread will serve as a basic tutorial for how to animate blocks and items, as well as new features like the customizable compass and clock. The goal is to explain how things work and why, as well as pointing out some of the pitfalls that you might encounter while attempting this for your own Texture Pack.
Tip: Watch for Green Text: When I write tutorials, I add little tidbits in green text lines. These are often helpful hints or little extras. Keep an eye out for them, as they may prove helpful.
1. The Animation Strip Format: The basic format of an animation is a column of frames. Each individual frame should be the same width and height as the texture you're attempting to animate. For example, if your texture pack is 16x16, each frame in the column should also be 16x16.
The game will use the width of the image to determine the frame height, so tiles must always be perfectly square. Likewise, the height of the animation strip must always be evenly divisible by the width. This is a good method of double-checking your work if something looks odd.
These frames are stacked one on top of the other. There should be no spaces in between frames. Also, your first frame should be at the top of the column with subsequent frames being below in in order. Logically, your last frame will be at the bottom of the stack.
Here's a basic example in the spoiler:
Tip: I'm working in 16x16: In all of the examples on this thread, all of the frames are supposed to be at 16x16 resolution. While some, like the image above, are kept at their native resolution (to save on scrolling), I've optimized most of the images for maximum visibility. Don't let this confuse you later on.
In this example, each frame is numbered so you can see its position in the stack. Animated in-game, it will look something like this:
2. Understanding the .txt file:
Every animation in Minecraft must have an accompanying .txt file with it. If it doesn't, Minecraft won't properly read the animation file, and you'll get something that looks like this in game:
Obviously, this is undesirable.
You can make a .txt file using programs like Notepad, Notepad++, or any other simple text editor. In Windows, simply right-clicking on the blank space in any folder in Windows Explorer and looking under the "New" option will give you the ability to create one.
IMPORTANT: SAVE AS PLAIN TEXT: The simpler the the text editor you use to make these files, the better. Programs like Notepad and Notepad++, which have no text formatting, are best. Other programs, like Window's Wordpad and Mac's Text Edit require that you change the file format to Plain Text. Higher-end programs like Open Office and MS Word may have different names for this, or not work at all. Even if the file is a .txt, if the file format itself isn't correct, Minecraft won't read it, and it'll just as if you didn't have a .txt file at all!
The name of this .txt must match the name of your animation's .png file EXACTLY. If you have cloth_0.png, you should have a cloth_0.txt file accompanying it. Same for goldenRail.txt accompanying goldenRail.png, and so forth. The names must always match exactly.
IMPORTANT: MATCH YOUR FILE NAMES EXACTLY: I can NOT stress how important it is to be studious about matching your file names. Minecraft is a program, and like most programs, will not try to guess your intentions. Just as you must match file names exactly if you want Minecraft to figure out which texture in a pack it's supposed to call, the .txt file accompanying your animation's file must also match exactly. Capitalization, underscores, are ALL IMPORTANT!
Every .txt file MUST be in the same folder as the .png file that it goes with. If you're animating a block, it should be in /textures/blocks/. If you're animating an item, it goes in /textures/items/.
Inside of this .txt file, you can give Minecraft instructions as to how you want your animation to play out. There are three components to this:
The first two go hand in hand. These are
Frame Order, and the Frame Numbers:
For example, the example animation showed above will have a .txt file that looks like this:
0,1,2,3,4,5,6,7,8,9,
Tip: Working Vertical: If you're like me, you like to see things more well organized than just one big line of numbers. Minecraft allows you to put a line break after each frame in your .txt files to keep things more well organized and easier to read. You can also omit the commas if you use line breaks instead.
What this does is it tells Minecraft that you want frame 0 to be first, 1 to be second, and so on. Minecraft will always cycle back to the beginning of an animation once it goes beyond the last frame so there's no need to worry about repeats.
Zero (0) is always the top frame in an animation strip, so you'll usually want to start from there and list your way to the bottom. Remember that, because you're starting with zero, the last frame's designation will be your total number of frames minus one. In the above example, there are ten frames (count 'em), but it's numbered zero through nine.
Tip: Starting With Zero: Why is the top frame of an animations trip numbered 0? Because a programmer made the system. In the minds of programmers, zero is the first number in a sequence, preceding the number one. It takes us artsy types a little bit of practice to get use to starting a count with zero, but that's just how computers (or at least computer programmers) work so we'll just have to deal with it.
IMPORTANT: DO NOT GO BEYOND THE BOTTOM OF THE STRIP: What happens if you accidentally put a 10 at the end of that example? Well, there's no frame with that number (being 0-9 in that case), so it'll just take the last frame in the sequence multiple times. If you go beyond the end of the strip, you'll notice that Minecraft will seem to 'hang' on the last frame. It's not really hanging, it's just using that last frame in place of all the numbers that it doesn't really have. Naturally, this is undesirable so don't do it!
That was a really simple example, but you can do more with it as well. For example, what happens if you want to cycle an animation forwards and backwards? Well, you don't need to waste memory on excess frames. Instead, just re-use the ones that you already have.
Here's an example. By using this animation strip, we can go from frame 0 to frame 5 and back again, creating an up and down motion to the progression of the bars:
To do this, use the following information in the .txt file:
0,1,2,3,4,5,4,3,2,1
The result will look like this:
Tip: Watch the Ends: In the above example, notice how I don't end the sequence with 0? This is because the animation repeats starting with the beginning. If there were a 0 at each end, it would be in the sequence twice in a row and thus would display for double the amount of time. Be mindful of this if you cycling animations seem to hang on one frame.
Because you can call the frames in your strip in any order, you can do loads of different stuff using very few frames. You can even do a "random" animation with dozens of different sequences (long enough to fool most people into thinking it really is random), with only a few frames just by re-using frames repeatedly.
As I said, the advantage to using the .txt file over just making more frames is one of memory. Each frame takes up more graphics memory, which slows Minecraft down. Normally this isn't noticeable, but with a lot of redundant frames (or a really slow computer) it can bog the game down quite a bit. Try to avoid this if you can by letting Minecraft handle it in real time rather than in the GPU.
Your fans will thank you.
Frame Delay:
Laying out the .txt file as show above, animations have one speed: FAST! By default, each frame will display for 1 "tick" in game, which translates to 1/20 of a second. (I slowed down the above examples that I animated, btw.) Obviously, this is pretty quick and won't be suitable for every animation.
If you want to slow your animation up so that people can actually see it, you'll need to adjust the frame's timing. Here's an example of a frame with timing:
0*5,
The only difference between this and the examples in the last section is that there's a "*5" in between the frame number and the comma. This is shorthand for "Frame #0 times 5", or, "display frame 0 for 5 ticks." With each tick being 1/20 of a second, this means that this frame will now be displayed for 1/4 of a second. Much slower and easier to see.
To put it another way, lower numbers in the timing are faster while larger numbers are slower. If an animation is too fast, try increasing the value of all of the timing numbers. If it's too slow, decrease those values.
Unfortunately, you'll need to adjust the timing of each frame individually if you want the entire animation to go slower. Here's a couple of examples of animations with different timing on their frames:
Tip: Leave it Blank: Without any information, an animation will run from top to bottom, at default speed. The red example above is doing exactly that, so you could just as well have created the .txt file, but put nothing in it to get the same result. This is a great time saver if you're doing nothing but fast, sequential animations.
And here's the slower animation with the timing slowed significantly.
The two animations shown above are exactly the same in terms of their graphical layout. Only the timing and hue were changed to give a very different result.
You can also alter each frame individually to pull off a variety of effects without having to do extra animation by hand. For example, you can have an animation slowly speed up or slow down part way through. You can also put a long delay on a single frame to create a delay, making the animation happen only periodically rather than constantly.
By changing the delay, you can get Minecraft to do a LOT of very time-consuming animation work for you.
3. Flowing Water and Lava:
While most animations follow the above format and rules, there are a few exceptions. The two biggest are Flowing water and lava. These two files follow a special set of rules when it comes to laying out your animation sheet. Don't worry, once you understand them they're pretty easy. It's just a few extra steps.
IMPORTANT: FLOWING LIQUIDS ONLY: This only applies to water_flow.png and lava_flow.png. The still water and lava files follow the same format as any other block, as outlined above. Do NOT do the stuff in this section with your still liquids. It will end up looking really weird.
To make a flowing liquid animation, start by making your frames the same way you would any other animation. Don't organize them into strips like normal, though. Instead, take each frame and repeat it in a 2 by 2 block. This will make each frame in a flowing liquid animation twice the normal resolution of your texture pack. Don't worry, this is normal and won't affect the look of your pack at all.
Once you've done that, then you organize them into strips as shown above.
Here's a graphical representation of this:
This will also help you if you're converting your flowing water/lava animations from the pre-1.5 MCPatcher/Optifine format to the new Minecraft flowing liquid animation format.
Tip: Why the Double Tile?: If you're wondering the reason why the flowing liquid animations are different, it's because of how Minecraft renders the water textures. Flowing water tiles are placed in the middle of the 2x2 area. This saves Minecraft from having to tile the texture in real time. If your animation looks different than expected, remember that the tile is actually in the middle of your frame, and not lined up with the single tile in the corner. A 25% offset is required to fix this if it's an issue.
When making the .txt file for these animations, remember that your frames are now twice as large as they normally would be. When you go to figure out the number of frames you have, remember to divide both dimensions of your animation strip by 2 to get your 'real' resolution.
4. Clock and Compass:
These two items actually cannot be animated at all, but they're laid out in a similar way so I'm including them in this tutorial.
Instead of being animated in the way we normally think of, the animations for the clock and compass are driven by an in-game factor. In the case of the clock, it's the time of in-game day. For the compass, it's the player's position and orientation in relation to the center of spawn.
Because these animations are key-driven, we need to set up our animation frames in the order that Minecraft wants us to, rather than being able to rely on a .txt file to fix things for us... althoug we still need one for Minecraft to recognize the file properly.
IMPORTANT: YOU STILL NEED A .txt FILE: You will still need to include a .txt file for both the clock and compass in the /textures/items/ folder along side their respective .png files. If you don't, Minecraft won't recognize these textures since they aren't square. Leave these files blank since there's nothing you can put into them to affect how the clock or compass work anyway.
Clock
The clock "animation" can have any number of frames. Minecraft will decide which frame to display by dividing the time by the number of available frames, so you needn't worry about doing the math yourself.
The order of the frames is very important, and there's no way to change them.
The top frame of your animation should be mid-day with the sun at it's apex. That is, noon. Each frame below it should be advancing the time. This is clockwise motion, if you're making an analogue clock. About half-way down the animation should be midnight, and the last frame should be almost noon again.
Tip: That last frame: Note that I said almost noon. It should be just before that since noon itself is represented by your first frame. Remember, you don't want a frame repeated twice!
Here's a simple example:
Note the basic clockwise motion of the blue dot. Having it at the top of the circle represents noon, while at the exact bottom it represents midnight. It then returns to the top along the other side. However you choose to have your animation represent time, have it follow this same basic movement.
Compass
With the compass, the top frame should be with spawn directly at the player's back. If you're animating a traditional style of compass, this would be with the needle pointing strait down.
On a traditional compass (like the one used in vanilla) the needle progresses in a clockwise direction as you move down the animation strip. Half-way through the animation it should be pointing with spawn directly in front of the player. It then proceeds down the opposite side of the circle, still in a clockwise movement. The last frame should be nearly at the player's back again, although slightly to the player's right.
Tip: That last frame... again: Again, be mindful not to have to top and bottom frames of your compass sequence be the same lest it confuse players using your texture pack. Only the top frame should have the player facing directly away from the spawn. The bottom frame should be slightly off center.
Here's a simple example of this:
Note where the red dot starts (at the bottom), and the general flow of its movement in a clockwise fashion ending up nearly back at it's starting position in the last frame. These are the important things.
As always, you don't have to represent your compass in this fashion, but make your version represents the same movement.
As with the clock, you don't have to have a specific number of frames. The game will divide your frames evenly among the 360° of rotation a player can be standing at.
5. Download Some Examples:
Still a little confused? Want more practical examples? How about something pre-made that you can experament on without worrying about wrecking your own stuff? Well, here you go!
DOWNLOAD (For the rules stickers: This "Pack" is released under the "Do Whatever You Want With It Because I Didn't Spend Enough Time On It To Care™" license.
This 16x16 pack has animations for: Wool (white, yellow, purple, blue, green, red, and black), Water (both still and flowing), and the Clock and Compass. The quality is extremely low (I threw it together in a few hours), but they're just there as examples so don't worry/complain about it.
6. Any Questions?
If there's anything that you don't understand, want clarified, or just can't figure out feel free to post in this thread and someone (maybe even me) will try to help you out.
Please be clear about what you're having problems with. Saying "it's not working" doesn't help anyone to help you. Provide screenshots if possible. Also, be prepared to offer a download of the animation files that aren't working. Sometimes we just have to see what you've done in order to tell you what you did wrong.
Hopefully this pack helps some of you who are having problems with this new format out.
The formatting's a little jarring (perhaps shrink some of the text-size down in larger paragraphs?)
I try to break up paragraphs into particular points. If I can say all there is to say in one sentence, that's a paragraph. If it takes two or three, that becomes a paragraph. It may seem like a "wall of text" with too many breaks, but I've found it's easier for people to follow than large paragraphs.
I'll add this to my compendium, if that's alright with you?
Yes by all means. Link to it from wherever you want to, as often as you want to.
That goes for anyone else, by the by. Add a link to whatever thread, compendium, or compilation you want. Heck, plagiarize the whole thing verbatim if you want. I don't mind in the slightest. I wrote this to help people. If what you want to do accomplishes that, then do so with my blessing!
No, I mean literally resize the text to vary the size a little, it typically helps break things apart. I've noticed you've done this for the 'tips' parts, but imho if should be the reverse, regular-text for the tips, shrunken (size 2 probs) for explanations maybe.
Ah. I got it. I'll try it to see how it looks.
I don't like to make the text too small most of the time since it makes it hard to read. Still, I think I can probably drop it a little to help out. We'll see.
Edit: I dropped the text size just a little, and made the green tips as large as the rest of the text with the red IMPORTANT text being slightly larger.
I might try myself to make the thread a little prettier if you like
Might take a while, though, as I edit threads through the 'basic' view, for I find that avoids 90% of the saving glitches that sometimes happen...
Check out what I've done first. I resized the text and did a bit of cleanup adding horizontal lines and spoilers and whatnot. Looks better than it did before, imo.
If you think you can do better, by all means do so. I'm not a huge expert on BBCode formatting.
Lawl I forgot about this, but I've got this change here for ya.
Not sure if the smaller paragraphs really work, especially on lower-res. monitors, but I tidied some other stuff 'ere-'n'-there.
:>
Use if you like, but you don't have to
Yea, I don't think I will. The text is hard to read, even on my Laptop's monitor, at that size. If there were a way to go in-between the two I'd go for it, but not that tiny. Additionally, other than the important red ones, I don't want to make the tips seem to be promoted over the ordinary text since I write those with the idea that they could be omitted and the tutorial still be useful.
Thanks for the work but I won't be using it. Sorry.
i need some help. im doing everything that this tutorial says about how to delay frames and determine frame sequences but its NOT working! i tried using commas, no commas, line breaks, changing the font but nothing is working
scratch that. turns out that using text edit on my mac to create the text files is the problem. if i just copy the text files of lava/water and change the name and other things it works.
so please add this into the tutorial. DO NOT USE TEXT EDIT ON MAC TO CREATE YOUR .txt FILES
MMkkkk Fair enough, didn't think it looked THAT small on lower-res. screens...
I used some of that formatting, basically just making the section titles larger so that they're easier to spot at a glance. Makes finding a section easier.
I doubt I'll do much else, as I feel it's good as is. Thanks for your help, though!
i need some help. im doing everything that this tutorial says about how to delay frames and determine frame sequences but its NOT working! i tried using commas, no commas, line breaks, changing the font but nothing is working
scratch that. turns out that using text edit on my mac to create the text files is the problem. if i just copy the text files of lava/water and change the name and other things it works.
so please add this into the tutorial. DO NOT USE TEXT EDIT ON MAC TO CREATE YOUR .txt FILES
I was about to comment on the "changing the font" bit. Anyway, glad you got it figured out.
Yea, I forgot that using higher-end programs can have an adverse effect. I've added it as an IMPORTANT section to the tutorial so people won't make the same mistake. I've even included a link to your post, so they know where that information came from since I'm not a Mac user.
I was about to comment on the "changing the font" bit. Anyway, glad you got it figured out.
Yea, I forgot that using higher-end programs can have an adverse effect. I've added it as an IMPORTANT section to the tutorial so people won't make the same mistake. I've even included a link to your post, so they know where that information came from since I'm not a Mac user.
Good Work!
Great tutorial with excellent clear information, tips and guides.
I'll link this topic to any questions i see about the 1.5 animation
I appreciate it. Part of the reason I made this thread was so that I wouldn't have to answer all of the questions about the new animation format over and over again. Your directing people to this thread takes even more pressure off of me, and helps people out far more than just a simple answer ever could! Thank you!
Very good post!
Do you know what's the reason for the special "flowing" format?
Thank you!
Yes, the reason is because flowing liquids are the only block that requires a texture be rendered on a diagonal. That is, when water or lava is flowing over a surface you notice how the 'flow' goes at all kinds of angles not otherwise seen in Minecraft. Having the flowing liquid quadruple size means that the diagonal tiles can sample from the middle of each frame without stretching it or having to tile the texture in real time. Effectively, it's an extra step in texture creation to save on graphics processing during the game.
There's one thing you may want state more precisely - the placement of the water texture for water_flow.png. It's a bit trickier, most of the time it's not very important, but the difference is for example visible on 1 block wide water streams. The texture may not look as intended when the 4x method is used.
That's a valid point. I don't think it's a huge deal, and I optimized that method for ease of understanding rather than precision. I may make a Tip section about it, though. I'll think on it and add it a little later on.
I don't know how you people create your animation strips, i guess some of you use sprite sheet scripts. The ones mentioned at this forum are a bit cumbersome and have unnecessary features.
I just found a very simple one for Photoshop (CS2 and up) - make your framed animation, run the script, enter the frame amount, texture width and you're done, it even reverts the file to the starting point. Photoshop Animation to Sprite Sheet
Good to know, but I'm not adding it to the tutorial. Anything that's software-specific shouldn't be in a general-purpose tutorial... unless I included ones for every commonly used software package. Photoshop in particular is kinda useless in this regard since few people have it (because it costs money), and even people like me who do might have outdated versions (I don't even have CS).
PS: You mention that we shouldn't use TextEdit for Mac - there's no problem with using it, just be sure not to add any formatting, it has to be plain text (Menu > Format > Make Plain Text).
Good to know. I'll modify that tip. I know little-to-nothing about Mac software, so I'm taking people's words for this stuff.
(And if you're going to nitpick, I don't consider file formats to be "software specific" for this purpose)
Yes, not really necessary to know, it was just for the sake of completeness. ;P
I don't know how you people create your animation strips, i guess some of you use sprite sheet scripts. The ones mentioned at this forum are a bit cumbersome and have unnecessary features.
I just found a very simple one for Photoshop (CS2 and up) - make your framed animation, run the script, enter the frame amount, texture width and you're done, it even reverts the file to the starting point. Photoshop Animation to Sprite Sheet
PS: You mention that we shouldn't use TextEdit for Mac - there's no problem with using it, just be sure not to add any formatting, it has to be plain text (Menu > Format > Make Plain Text).
I rather use InFanView for making my animation strips. It's nice and easy and you can order each animation how you want.
Hey, I wanted to animate a torch but there is a white outline around the torch. how do I turn transparency on in paint?
Paint does not support any kind of transparency. It is as basic as art program as you can get.. It's never been 'updated' to support all the new formats and methoods found today. Get paint.net or Gimp.
I might add that when you make a text file, you don't have to put anything inside of it. Minecraft will just animate it at one frame per tick, from top to bottom.
I might add that when you make a text file, you don't have to put anything inside of it. Minecraft will just animate it at one frame per tick, from top to bottom.
If you're reading this thread, it's likely you're either having problems with the new animation format introduced in Minecraft 1.5.1, or, are new to making animations for Minecraft and want to learn how with as few problems as possible.
This thread will serve as a basic tutorial for how to animate blocks and items, as well as new features like the customizable compass and clock. The goal is to explain how things work and why, as well as pointing out some of the pitfalls that you might encounter while attempting this for your own Texture Pack.
Tip: Watch for Green Text: When I write tutorials, I add little tidbits in green text lines. These are often helpful hints or little extras. Keep an eye out for them, as they may prove helpful.
1. The Animation Strip Format:
The basic format of an animation is a column of frames. Each individual frame should be the same width and height as the texture you're attempting to animate. For example, if your texture pack is 16x16, each frame in the column should also be 16x16.
The game will use the width of the image to determine the frame height, so tiles must always be perfectly square. Likewise, the height of the animation strip must always be evenly divisible by the width. This is a good method of double-checking your work if something looks odd.
These frames are stacked one on top of the other. There should be no spaces in between frames. Also, your first frame should be at the top of the column with subsequent frames being below in in order. Logically, your last frame will be at the bottom of the stack.
Here's a basic example in the spoiler:
Tip: I'm working in 16x16: In all of the examples on this thread, all of the frames are supposed to be at 16x16 resolution. While some, like the image above, are kept at their native resolution (to save on scrolling), I've optimized most of the images for maximum visibility. Don't let this confuse you later on.
In this example, each frame is numbered so you can see its position in the stack. Animated in-game, it will look something like this:
2. Understanding the .txt file:
Every animation in Minecraft must have an accompanying .txt file with it. If it doesn't, Minecraft won't properly read the animation file, and you'll get something that looks like this in game:
Obviously, this is undesirable.
You can make a .txt file using programs like Notepad, Notepad++, or any other simple text editor. In Windows, simply right-clicking on the blank space in any folder in Windows Explorer and looking under the "New" option will give you the ability to create one.
IMPORTANT: SAVE AS PLAIN TEXT: The simpler the the text editor you use to make these files, the better. Programs like Notepad and Notepad++, which have no text formatting, are best. Other programs, like Window's Wordpad and Mac's Text Edit require that you change the file format to Plain Text. Higher-end programs like Open Office and MS Word may have different names for this, or not work at all. Even if the file is a .txt, if the file format itself isn't correct, Minecraft won't read it, and it'll just as if you didn't have a .txt file at all!
The name of this .txt must match the name of your animation's .png file EXACTLY. If you have cloth_0.png, you should have a cloth_0.txt file accompanying it. Same for goldenRail.txt accompanying goldenRail.png, and so forth. The names must always match exactly.
IMPORTANT: MATCH YOUR FILE NAMES EXACTLY: I can NOT stress how important it is to be studious about matching your file names. Minecraft is a program, and like most programs, will not try to guess your intentions. Just as you must match file names exactly if you want Minecraft to figure out which texture in a pack it's supposed to call, the .txt file accompanying your animation's file must also match exactly. Capitalization, underscores, are ALL IMPORTANT!
Every .txt file MUST be in the same folder as the .png file that it goes with. If you're animating a block, it should be in /textures/blocks/. If you're animating an item, it goes in /textures/items/.
Inside of this .txt file, you can give Minecraft instructions as to how you want your animation to play out. There are three components to this:
The first two go hand in hand. These are
Frame Order, and the Frame Numbers:
For example, the example animation showed above will have a .txt file that looks like this:
Tip: Working Vertical: If you're like me, you like to see things more well organized than just one big line of numbers. Minecraft allows you to put a line break after each frame in your .txt files to keep things more well organized and easier to read. You can also omit the commas if you use line breaks instead.
What this does is it tells Minecraft that you want frame 0 to be first, 1 to be second, and so on. Minecraft will always cycle back to the beginning of an animation once it goes beyond the last frame so there's no need to worry about repeats.
Zero (0) is always the top frame in an animation strip, so you'll usually want to start from there and list your way to the bottom. Remember that, because you're starting with zero, the last frame's designation will be your total number of frames minus one. In the above example, there are ten frames (count 'em), but it's numbered zero through nine.
Tip: Starting With Zero: Why is the top frame of an animations trip numbered 0? Because a programmer made the system. In the minds of programmers, zero is the first number in a sequence, preceding the number one. It takes us artsy types a little bit of practice to get use to starting a count with zero, but that's just how computers (or at least computer programmers) work so we'll just have to deal with it.
IMPORTANT: DO NOT GO BEYOND THE BOTTOM OF THE STRIP: What happens if you accidentally put a 10 at the end of that example? Well, there's no frame with that number (being 0-9 in that case), so it'll just take the last frame in the sequence multiple times. If you go beyond the end of the strip, you'll notice that Minecraft will seem to 'hang' on the last frame. It's not really hanging, it's just using that last frame in place of all the numbers that it doesn't really have. Naturally, this is undesirable so don't do it!
That was a really simple example, but you can do more with it as well. For example, what happens if you want to cycle an animation forwards and backwards? Well, you don't need to waste memory on excess frames. Instead, just re-use the ones that you already have.
Here's an example. By using this animation strip, we can go from frame 0 to frame 5 and back again, creating an up and down motion to the progression of the bars:
To do this, use the following information in the .txt file:
The result will look like this:
Tip: Watch the Ends: In the above example, notice how I don't end the sequence with 0? This is because the animation repeats starting with the beginning. If there were a 0 at each end, it would be in the sequence twice in a row and thus would display for double the amount of time. Be mindful of this if you cycling animations seem to hang on one frame.
Because you can call the frames in your strip in any order, you can do loads of different stuff using very few frames. You can even do a "random" animation with dozens of different sequences (long enough to fool most people into thinking it really is random), with only a few frames just by re-using frames repeatedly.
As I said, the advantage to using the .txt file over just making more frames is one of memory. Each frame takes up more graphics memory, which slows Minecraft down. Normally this isn't noticeable, but with a lot of redundant frames (or a really slow computer) it can bog the game down quite a bit. Try to avoid this if you can by letting Minecraft handle it in real time rather than in the GPU.
Your fans will thank you.
Frame Delay:
Laying out the .txt file as show above, animations have one speed: FAST! By default, each frame will display for 1 "tick" in game, which translates to 1/20 of a second. (I slowed down the above examples that I animated, btw.) Obviously, this is pretty quick and won't be suitable for every animation.
If you want to slow your animation up so that people can actually see it, you'll need to adjust the frame's timing. Here's an example of a frame with timing:
The only difference between this and the examples in the last section is that there's a "*5" in between the frame number and the comma. This is shorthand for "Frame #0 times 5", or, "display frame 0 for 5 ticks." With each tick being 1/20 of a second, this means that this frame will now be displayed for 1/4 of a second. Much slower and easier to see.
To put it another way, lower numbers in the timing are faster while larger numbers are slower. If an animation is too fast, try increasing the value of all of the timing numbers. If it's too slow, decrease those values.
Unfortunately, you'll need to adjust the timing of each frame individually if you want the entire animation to go slower. Here's a couple of examples of animations with different timing on their frames:
Here's Fast animation with the default timing:
Tip: Leave it Blank: Without any information, an animation will run from top to bottom, at default speed. The red example above is doing exactly that, so you could just as well have created the .txt file, but put nothing in it to get the same result. This is a great time saver if you're doing nothing but fast, sequential animations.
And here's the slower animation with the timing slowed significantly.
The two animations shown above are exactly the same in terms of their graphical layout. Only the timing and hue were changed to give a very different result.
You can also alter each frame individually to pull off a variety of effects without having to do extra animation by hand. For example, you can have an animation slowly speed up or slow down part way through. You can also put a long delay on a single frame to create a delay, making the animation happen only periodically rather than constantly.
By changing the delay, you can get Minecraft to do a LOT of very time-consuming animation work for you.
3. Flowing Water and Lava:
While most animations follow the above format and rules, there are a few exceptions. The two biggest are Flowing water and lava. These two files follow a special set of rules when it comes to laying out your animation sheet. Don't worry, once you understand them they're pretty easy. It's just a few extra steps.
IMPORTANT: FLOWING LIQUIDS ONLY: This only applies to water_flow.png and lava_flow.png. The still water and lava files follow the same format as any other block, as outlined above. Do NOT do the stuff in this section with your still liquids. It will end up looking really weird.
To make a flowing liquid animation, start by making your frames the same way you would any other animation. Don't organize them into strips like normal, though. Instead, take each frame and repeat it in a 2 by 2 block. This will make each frame in a flowing liquid animation twice the normal resolution of your texture pack. Don't worry, this is normal and won't affect the look of your pack at all.
Once you've done that, then you organize them into strips as shown above.
Here's a graphical representation of this:
This will also help you if you're converting your flowing water/lava animations from the pre-1.5 MCPatcher/Optifine format to the new Minecraft flowing liquid animation format.
Tip: Why the Double Tile?: If you're wondering the reason why the flowing liquid animations are different, it's because of how Minecraft renders the water textures. Flowing water tiles are placed in the middle of the 2x2 area. This saves Minecraft from having to tile the texture in real time. If your animation looks different than expected, remember that the tile is actually in the middle of your frame, and not lined up with the single tile in the corner. A 25% offset is required to fix this if it's an issue.
When making the .txt file for these animations, remember that your frames are now twice as large as they normally would be. When you go to figure out the number of frames you have, remember to divide both dimensions of your animation strip by 2 to get your 'real' resolution.
4. Clock and Compass:
These two items actually cannot be animated at all, but they're laid out in a similar way so I'm including them in this tutorial.
Instead of being animated in the way we normally think of, the animations for the clock and compass are driven by an in-game factor. In the case of the clock, it's the time of in-game day. For the compass, it's the player's position and orientation in relation to the center of spawn.
Because these animations are key-driven, we need to set up our animation frames in the order that Minecraft wants us to, rather than being able to rely on a .txt file to fix things for us... althoug we still need one for Minecraft to recognize the file properly.
IMPORTANT: YOU STILL NEED A .txt FILE: You will still need to include a .txt file for both the clock and compass in the /textures/items/ folder along side their respective .png files. If you don't, Minecraft won't recognize these textures since they aren't square. Leave these files blank since there's nothing you can put into them to affect how the clock or compass work anyway.
Clock
The clock "animation" can have any number of frames. Minecraft will decide which frame to display by dividing the time by the number of available frames, so you needn't worry about doing the math yourself.
The order of the frames is very important, and there's no way to change them.
The top frame of your animation should be mid-day with the sun at it's apex. That is, noon. Each frame below it should be advancing the time. This is clockwise motion, if you're making an analogue clock. About half-way down the animation should be midnight, and the last frame should be almost noon again.
Tip: That last frame: Note that I said almost noon. It should be just before that since noon itself is represented by your first frame. Remember, you don't want a frame repeated twice!
Here's a simple example:
Note the basic clockwise motion of the blue dot. Having it at the top of the circle represents noon, while at the exact bottom it represents midnight. It then returns to the top along the other side. However you choose to have your animation represent time, have it follow this same basic movement.
Compass
With the compass, the top frame should be with spawn directly at the player's back. If you're animating a traditional style of compass, this would be with the needle pointing strait down.
On a traditional compass (like the one used in vanilla) the needle progresses in a clockwise direction as you move down the animation strip. Half-way through the animation it should be pointing with spawn directly in front of the player. It then proceeds down the opposite side of the circle, still in a clockwise movement. The last frame should be nearly at the player's back again, although slightly to the player's right.
Tip: That last frame... again: Again, be mindful not to have to top and bottom frames of your compass sequence be the same lest it confuse players using your texture pack. Only the top frame should have the player facing directly away from the spawn. The bottom frame should be slightly off center.
Here's a simple example of this:
Note where the red dot starts (at the bottom), and the general flow of its movement in a clockwise fashion ending up nearly back at it's starting position in the last frame. These are the important things.
As always, you don't have to represent your compass in this fashion, but make your version represents the same movement.
As with the clock, you don't have to have a specific number of frames. The game will divide your frames evenly among the 360° of rotation a player can be standing at.
5. Download Some Examples:
Still a little confused? Want more practical examples? How about something pre-made that you can experament on without worrying about wrecking your own stuff? Well, here you go!
DOWNLOAD
(For the rules stickers: This "Pack" is released under the "Do Whatever You Want With It Because I Didn't Spend Enough Time On It To Care™" license.
This 16x16 pack has animations for: Wool (white, yellow, purple, blue, green, red, and black), Water (both still and flowing), and the Clock and Compass. The quality is extremely low (I threw it together in a few hours), but they're just there as examples so don't worry/complain about it.
6. Any Questions?
If there's anything that you don't understand, want clarified, or just can't figure out feel free to post in this thread and someone (maybe even me) will try to help you out.
Please be clear about what you're having problems with. Saying "it's not working" doesn't help anyone to help you. Provide screenshots if possible. Also, be prepared to offer a download of the animation files that aren't working. Sometimes we just have to see what you've done in order to tell you what you did wrong.
Hopefully this pack helps some of you who are having problems with this new format out.
I try to break up paragraphs into particular points. If I can say all there is to say in one sentence, that's a paragraph. If it takes two or three, that becomes a paragraph. It may seem like a "wall of text" with too many breaks, but I've found it's easier for people to follow than large paragraphs.
Yes by all means. Link to it from wherever you want to, as often as you want to.
That goes for anyone else, by the by. Add a link to whatever thread, compendium, or compilation you want. Heck, plagiarize the whole thing verbatim if you want. I don't mind in the slightest. I wrote this to help people. If what you want to do accomplishes that, then do so with my blessing!
I don't like to make the text too small most of the time since it makes it hard to read. Still, I think I can probably drop it a little to help out. We'll see.
Edit: I dropped the text size just a little, and made the green tips as large as the rest of the text with the red IMPORTANT text being slightly larger.
Is that better?
If you think you can do better, by all means do so. I'm not a huge expert on BBCode formatting.
Minecraft actually doesn't need commas at all if you use line breaks.
So you can do this,
some_block.txt
and it will work just fine.
Thanks for the work but I won't be using it. Sorry.
I did not know that. I'll add it in. Thanks!
Edit: I edited the Tip: Working Vertical to include this information. Thanks again for letting me know!
I also really like the way you've laid out this tutorial. I think I'll animate something now,
"And with that, POW! I'm gone." ---Lord Crump
so please add this into the tutorial. DO NOT USE TEXT EDIT ON MAC TO CREATE YOUR .txt FILES
I doubt I'll do much else, as I feel it's good as is. Thanks for your help, though!
Excellent! Thank you! I'm glad I could help.
Post what you've got when you're done. I'd love to see it!
I was about to comment on the "changing the font" bit. Anyway, glad you got it figured out.
Yea, I forgot that using higher-end programs can have an adverse effect. I've added it as an IMPORTANT section to the tutorial so people won't make the same mistake. I've even included a link to your post, so they know where that information came from since I'm not a Mac user.
Thanks for letting me know!
glad i could help
Thank you!
Yes, the reason is because flowing liquids are the only block that requires a texture be rendered on a diagonal. That is, when water or lava is flowing over a surface you notice how the 'flow' goes at all kinds of angles not otherwise seen in Minecraft. Having the flowing liquid quadruple size means that the diagonal tiles can sample from the middle of each frame without stretching it or having to tile the texture in real time. Effectively, it's an extra step in texture creation to save on graphics processing during the game.
Does that explain it?
I'm glad this helped you. It's really gratifying knowing that this is really helping people!
That's a valid point. I don't think it's a huge deal, and I optimized that method for ease of understanding rather than precision. I may make a Tip section about it, though. I'll think on it and add it a little later on.
Thanks for the advice.
Good to know, but I'm not adding it to the tutorial. Anything that's software-specific shouldn't be in a general-purpose tutorial... unless I included ones for every commonly used software package. Photoshop in particular is kinda useless in this regard since few people have it (because it costs money), and even people like me who do might have outdated versions (I don't even have CS).
Good to know. I'll modify that tip. I know little-to-nothing about Mac software, so I'm taking people's words for this stuff.
(And if you're going to nitpick, I don't consider file formats to be "software specific" for this purpose)
I rather use InFanView for making my animation strips. It's nice and easy and you can order each animation how you want.
Paint does not support any kind of transparency. It is as basic as art program as you can get.. It's never been 'updated' to support all the new formats and methoods found today. Get paint.net or Gimp.