Page 1 of 1

Modifying unit animations

Posted: Sun Feb 09, 2014 6:01 pm
by the_iron_duke
I am seeking information on modifying the unit (gunfire) animations.

I understand that the position of the animation can be changed by modifying the x/y offsets. I am interested in changing the animations themselves and for that I need to understand how the animation images work.

Here is an infantry gunfire animation. Could someone explain how to read it? I have filled the transparent background with a light blue colour to make the animation more obvious.

I presume it is to be read like a page of writing, from left to right in lines going down the page. There is no image in the top-right - is that frame skipped or is it not skipped and there is no gunfire going on? What happens if the unit is shooting in the opposite direction - is the whole animation sheet flipped horizontally automatically in the game?

Also, is there any way of playing back an animation or can that only be done by initiating combat in-game?

Image

Re: Modifying unit animations

Posted: Sun Feb 09, 2014 6:39 pm
by bebro
the_iron_duke wrote:I am seeking information on modifying the unit (gunfire) animations.

I understand that the position of the animation can be changed by modifying the x/y offsets. I am interested in changing the animations themselves and for that I need to understand how the animation images work.

Here is an infantry gunfire animation. Could someone explain how to read it? I have filled the transparent background with a light blue colour to make the animation more obvious.

I presume it is to be read like a page of writing, from left to right in lines going down the page. There is no image in the top-right - is that frame skipped or is it not skipped and there is no gunfire going on? What happens if the unit is shooting in the opposite direction - is the whole animation sheet flipped horizontally automatically in the game?

Also, is there any way of playing back an animation or can that only be done by initiating combat in-game?
Haven't looked myself into the anim part much, but from what I know and from the pic posted it's a sequence of individual small pics arranged together so you get this bigger one. Each stage of the anim is a single frame, just played by the game after eachother so you get the impression of animation.

The question is, how many frames do we see there? I am not even sure how many columns that are - could be 6, and 6 rows. So this woud be 36 single pics/frames. Also I am not sure about the exact order in which all those frames are played in-game, but probably indeed left-right from the 1st row and so on.

The empty spote upper right does IMO not mean no pic or that it would be skipped, but it's empty (or rather the background is fully transparent) - so when this frame isplayed there's no gunfire, which makes sense if you remember the inf firing sequence in PzC - several shots or salvos but no gunfire all the time.

Re: Modifying unit animations

Posted: Sun Feb 09, 2014 7:08 pm
by the_iron_duke
Thanks for the info. Looking at the graphic some more, I'm not even sure things are going left to right any more - some of the "columns" look as if they might be going from top to bottom!

I might have to create a test animation with numbers for each frame and play it back in-game. Or use different colours in each frame to make it easier to spot the sequence, if the animation can only be viewed back in real-time. Or place a different-coloured dot in a different position in each frame!

Re: Modifying unit animations

Posted: Sun Feb 09, 2014 10:42 pm
by the_iron_duke
After making a custom animation using coloured dots (very psychedelic!), I can confirm that the frame sequence goes from left to right in descending lines, like lines on a page. The game automatically reflects the animation horizontally when firing in the opposite direction.

Re: Modifying unit animations

Posted: Tue Feb 11, 2014 1:49 am
by ThvN
I've been away for a few days unfortunately, otherwise I could have saved you a lot of time... I've modded/created a few animations (with an old Photoshop), so hopefully I can help you with questions. For a sample of my work, I made some matching animations for an icon made by Bebro, a variation is used in McGuba's Hungarian mod for the infantry units with bazookas. This is a combination of infantry firing rifles and a bazooka, which also has a nice backblast and different sound to go with it.

The animations are read like a book, like you describe. Be careful when editing them, as a lot of frames contain barely visible smoke (low opacity). Something that saved me a lot of time was making an overlay, another layer on top of the animation sheet that has small dots with a maxed channel of a single RGB-color at the corners of each frame. This creates a grid that can be selected (together with the frame) by just choosing that particular color. Using this method I could methodically adjust the position of the muzzle flashes relative to each other, and it also makes it easier to change their angle in a consistent manner.

A problem is the animation usually has a sound playing along. These .wav files need to be synced with the animation, I did that manually and it is a lot of work. So it is not very difficult if you just want to move around the muzzle flashes of an existing animation to line up to your new icons, but making completely new animations + sounds is a lot more work.

Re: Modifying unit animations

Posted: Tue Feb 11, 2014 2:49 am
by the_iron_duke
I've started creating templates for certain animations, like this infantry example (shades of Warhol :) ).

Image

I will only need to create new animations for the infantry, as they are being shrunk to 70% of their original size, and the number of figures in each graphic doubled.

I can see the barely visible grey puff of smoke you mention (although they don't really show up in the above example). They will be lost when reducing the animation size, so only the muzzle flashes will be necessary. They should look quite cool as the muzzle flashes will be smaller but doubled in number because of the increased infantry numbers in each graphic.

The muzzle flashes should be fairly easy. They can be read a bit like a musical score - the example above provides the following muzzle-fire rhythm with three different notes/rhythm sounds, six bars of six beats per bar:

11----
22----
3-----
-3--3-
-3--3-
-11---