aliens

Author Topic: Battlescape walk animation  (Read 5000 times)

Volutar

  • Guest
Battlescape walk animation
« on: January 23, 2011, 01:53:37 pm »
Battlescape walk animation seems to be using wrong frame sequence.
we have "S" frame for still and "0"-"7" for walk frames.

So in original UFO we have sequence like that:
S ... click ... step1=[0 1 2 3 4 5 6 7] step2=[0 1 2 3 4 5 6 7] ...

Currently we have:
S ... click ... step1=[S 1 2 3 4 5 6 7] step2=[S 1 2 3 4 5 6 7] ...

So walk frame 0 seems to be replaced with extra "standing still" frame what makes walk sequence look jerky especially when units turning while walk.

In attached image 1st row is OpenXcom, 2nd - UFO:CE, 3rd - Frames 56-63 from xcom_0.pck

« Last Edit: January 23, 2011, 01:55:30 pm by Volutar »

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape walk animation
« Reply #1 on: January 23, 2011, 06:47:03 pm »
fixed in r248

nice bug report by the way :) The better the bug report, the easier/faster to fix it. ;)
« Last Edit: January 23, 2011, 06:50:26 pm by Daiky »

Volutar

  • Guest
Re: Battlescape walk animation
« Reply #2 on: January 29, 2011, 11:47:26 am »
This bug isn't fixed. It's just been altered.

On first screenshot:
At the left - original. Right - current openxcom.
So...

Original have frames:
S [0 1 2 3 4 5 6 7] [0 1 2 3 4 5 6 7] [0 1 2 3 4 5 6 S] S

openxcom now has:
S [1 2 3 4 5 6 7 7] [1 2 3 4 5 6 7 7] [1 2 3 4 5 6 7 7] S

So frame number 0 still skipped.
Notice that in original UFO last animation frame of last step is replaced with STILL. That's really a bug.
Also walk animation to left-bottom corner have "shifted" legs phase to 4.

Top-Right: - legs: right-left-right; - hands: left-right-left
Right: - legs: right-left-right; hands: - left-right-left
Bottom-Right: legs: right-left-right; - hands: left-right-left
Bottom: - legs: right-left-right; - hands: left-right-left
**Bottom-Left: - legs: left-right-left - hands: left-right-right;
*Left: - legs: left-right-left - hands: right-left-right;
*Top-Left: - legs: left-right-left - hands: right-left-right;
Top: - legs: right-left-right; - hands: left-right-left

* - left-right animation mirrored
** - left-right animation mirrored only for legs, hands still original, so we have mixed move.

As I see this mix of hand/legs phase appens only for "no armour". Personal armour pck contains correct bottom-left step animation. In TFTD this "down-left" animation seems to be fixed. It's not really hard. All what you need is to modify XCOM_0.PCK alittle -  exchange sprites 152 with 156, 153 with 157, 154 with 158 and 155 with 159.

It could be fixed either by pck repacking, or by hardcoding this particular "exchange".

So does looks unnatural. In OpenXCom this bug also present, but really worsen with last frame doubling and absence of torso vertical waving, so it looks like he's jumping.

Also, while unit is turning - frames in-between aren't actually presented as "still" (as it should be) but walk frame 0 or 1.

Second screenshot shows one step animation of original UFO with vertical shift "dots".
First animation frame 0 actually arent shifted in direction of move - unit has same coordinates as he's standing still, but vertical shift of torso is -1.
Blue dots represent current "sliding" torso trajectory, Red dots represents original UFO, with vertical torso shift.

So vertical shift for "walk" should be:

Frame | Direction shift | Vertical torso shift
Still | 0 | 0
0 | 0 | -1
1 | 2 | 0
2 | 4 | 1
3 | 6 | 0
4 | 8 | -1
5 | 10 | 0
6 | 12 | 1
7 | 14 | 0

Added:
"Diagonal" step currently done wrong. It must be done in 16 frames, not 8.
Third screenshot shows how it done in original with these red "reference" dots.
« Last Edit: January 29, 2011, 04:05:51 pm by Volutar »

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape walk animation
« Reply #3 on: January 29, 2011, 04:23:47 pm »
Hey, nice analysis again, you are sure putting some effort in it.
I think I now will get the animation frames right as well as the head bobbing and the turn animation.
PS. a little error, the vertical torso shift is the other way around, because pixel coordinates start topleft, 1 pixel down is Y + 1 ;)

Quote
All what you need is to modify XCOM_0.PCK alittle -  exchange sprites 152 with 156, 153 with 157, 154 with 158 and 155 with 159.
I think you can do this by modifying the TAB file instead of the PCK file.

Volutar

  • Guest
Re: Battlescape walk animation
« Reply #4 on: January 29, 2011, 07:47:57 pm »
Alright! I've fixed XCOM_0.TAB in order to make hands/legs animation in natural sync.
Now it looks very nice indeed.

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: Battlescape walk animation
« Reply #5 on: February 02, 2011, 11:36:36 pm »
fixed in r265