fheroes2
fheroes2 copied to clipboard
Golem sprite is shifted during diagonal movement
While diagonal moving golem's sprite shifts. We can notice that, when golems stop, they jump a bit, right after the movement had finished.
Is it in the original game as well?
No, Original game doesn't have such issue. But original golem actually walks not on a straight line: It's route looks like " )"
Hm, some screenshots would be helpful here...
Hi, @a1exsh !
Here some screenshot I tried to make...
Here's how golem is placed in fheroes2:
Here's OG placement of sprite:
Also, while making of these screenshots I've noticed, that movement starts from different sprite. Could anyone check frame-by-frame, am I right?
Hi, @Branikolog, I checked this issue and can tall that it is partly from the original game:
https://user-images.githubusercontent.com/113276641/208291991-5ebdbd0c-9b08-4442-9c89-f71666285242.mp4
You can see, the after moving for one cell the golem shifts horizontally for about half a cell width.
The fheroes2 issue is, that besides FLY_OFF
for flyers there is MOVE_START
, which is not used.
And only Skeleton, (Master) Swordsman and Steel/Iron Golem has this extra MOVE_START
frames.
Skeleton and Swordsman has only 2 such frames.
It is funny, but Golem has 4 frames of MOVE_START
animation and its MOVING
animation sprites are drawn to move only 3/4 of the cell. I think that the authors have drawn only MOVE_START
animation and then took a part of it for MOVING
.
I've modified fheroes2 code to use MOVE_START
animation:
https://user-images.githubusercontent.com/113276641/208293136-a03936d7-8e11-4af9-82fb-f34de82267a7.mp4
But can correct sprite horizontal position, but in this case golem will slide a little when walking forward:
https://user-images.githubusercontent.com/113276641/208293561-d53d12f4-9dbf-46d3-8d1f-69562b663922.mp4
Or somehow add frames to the MOVEMENT
animation, with sprite coordinates correction, to help golem to walk the other 1/4 of cell.
Hello, @Districh-ru ! So nice, that you've decided to take this issue. Golems are one of my most favourite units in game, with pretty animations of attacking and especially moving. I love their non-linear speed and the sounds they produce while acting. :)
I checked this issue and can tall that it is partly from the original game:
I see. Shifting in the middle of trajectory looks less noticeable, while in fheroes2 currently, we have two such shiftings: First in the beginning and the second one is even shifting back, since Golems finish their path a little bit onwards.
https://user-images.githubusercontent.com/55348946/208432422-95a8bc49-87c3-4293-bfe2-5b7ab77a8472.mp4
Correct sprite horizontal position, but in this case golem will slide a little when walking forward:
I personally love the way golems walk diagonally on your last video, but at the same time, straight walking looked better on previous one. I mean, horizontal shifting while walking horizontally is much less noticeable, than shifting during diagonal movement... Some minor shifts while walking improves an impression, that this is a mechanical creature. The thing is that current fheroes2 (and the original game as well) have that shifting too noticeable during diagonal movement. Is it possible to implement something in the middle between sliding and shifting? Or take two different approaches, for straight and diagonal movement, as I've mentioned above?
@Branikolog, I slightly 'optimized' its horizontal movement. What do you think?
https://user-images.githubusercontent.com/113276641/208439273-fbc92a29-a30b-4cb1-ba0c-dd8401838db8.mp4
Also I changed the movement algorithm for all 'walkers' and added there, besides main MOVEMENT
animation:
-
MOVE_QUICK
- when creature moves for 1 cell, -
MOVE_START
- movement from beginning till the first cell, -
MOVE_END
- movement to the last cell.
The biggest difficulty is the backward movement of wide creatures. :)
When I open this PR and I want to ask you to check the movement of all creatures (also with passing the bridge), including slowed flyers.
Hi, @Districh-ru . Now animation looks smooth, without noticeable shifts during whole path. :+1 The only thing I've noticed is one frame is missing in starting animation.
When I open this PR and I want to ask you to check the movement of all creatures (also with passing the bridge), including slowed flyers.
That would be not an easy task, but a pleasant one. :) I'm happy, that there're only six factions in game. :)
The only thing I've noticed is one frame is missing in starting animation.
It's a video recorder issue, you can see, that the third golem has this frame. :)
That would be not an easy task, but a pleasant one. :) I'm happy, that there're only six factions in game. :)
You forgot about the seventh: Elementals, Rogue, Nomad, Genie, Ghost, Medusa. :)
I already found some issues in new animations and fixing them. You can check this fix in common: by creature types (walking. walking+wide, slow+flying, slow+flying+wide) and maybe you want to pay attention to some creatures. But to check everyone is the best. :)
And a question we have to think at: the game sets the animation speed for every creature movement in milliseconds fer movement. And it is OK for main the movement animation, but now we have 3 new and they may have different frame number than in the main movement. Should we keep the constant time for movement from cell to cell (as the OG), or keep constant delay between frames, as I did in previous video? For comparison: Golems with constant time for cell movement:
https://user-images.githubusercontent.com/113276641/208452328-5a752c19-a8d3-449e-9aaf-66d60c85f189.mp4
Hi, @Districh-ru
It's a video recorder issue, you can see, that the third golem has this frame. :)
I see.
But to check everyone is the best. :)
Sure. Since all creatures have different animations.
Should we keep the constant time for movement from cell to cell (as the OG), or keep constant delay between frames, as I did in previous video?
I can barely notice the difference on these videos.. :) The last video looks more close to the original game, regarding golem animation... Looks like it fixes #1302.