## Tricks for slower walking animations on tilemaps?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Eglaios
Prole
Posts: 36
Joined: Mon May 03, 2021 8:45 pm

### Tricks for slower walking animations on tilemaps?

I set up a walking animation (1 step per tile), but my character walks as if it was a penguin, or its shoelaces were tied together :

Of course, I'd want the character to walk slower while moving at the same speed, so I quickly thought about possible solutions :
-Make it skip a tile 50% of the time (That's what I saw in some RPGmaker games). Could possibly look weirder the more frames I add to the animation.
-Make the animation based on time instead of per-tile. It will last a bit after the player stops, but this would be my choice so far

Would anyone know other tips to make my char walk slower?

Thank you!
Currently working on game music...
pgimeno
Party member
Posts: 2825
Joined: Sun Oct 18, 2015 2:58 pm

### Re: Tricks for slower walking animations on tilemaps?

Moving the arms as the character walks would go a long way in avoiding the "penguin walk" look. Observe yourself while you walk; we usually advance the left arm and the right leg at the same time, and vice versa.

I think the animation speed is fine, but if you really want the animation speed to be adjustable, you can employ video playing techniques. Have a variable with the time mark (it can be fractional) and convert it to an integer, appropriately scaled, with the frame number. Reset it when the character starts to walk.
BrotSagtMist
Citizen
Posts: 64
Joined: Fri Aug 06, 2021 10:30 pm

### Re: Tricks for slower walking animations on tilemaps?

Your char does not seem to have legs, how else is it supposed to walk if not like a penguin?
The hands should swing a bit, dont overdo it, for one game a graphic designer gave me a char that swings its arms like running a marathon, yet it walks, so it constantly looks like a comedy act, running at place.

The stuttering is annoying, it can be avoided by using a timed walking yes.
You can simply add that by incrementing a time keeper during update whenever you walk and then use modulo to get the frame to show, for example like:
frame= math.ceil((T*animationspeed) % nr_of_frames)
Set T to 0 if standing and have the resting frame nr 0.
That has the merit that the animation speed can be freely selected independent of the walking speed. plus, you can put a step sound on a specific frame there and it is automatically synced.
obey
Eglaios
Prole
Posts: 36
Joined: Mon May 03, 2021 8:45 pm

### Re: Tricks for slower walking animations on tilemaps?

I'll try stuff by myself considering all of that, and see what I'm good with...
I should have made a few precisions :
-The character kinda has no legs on purpose, that's how I want it to be, though I still wanted to have it walk "longer" steps
-I didn't animate the arms because I wasn't sure yet which sprites I'd keep, so I only made feet to first see how it would be. I still planned to make the animation look cleaner (and get rid of this 1-frame glitchy thing that can be seen on the video, each time it reaches a tile)

Currently working on game music...
Eglaios
Prole
Posts: 36
Joined: Mon May 03, 2021 8:45 pm

### Re: Tricks for slower walking animations on tilemaps?

Well... Turns out the walking speed looks definitely better whith arm movement, I sure should have followed this advice earlier, and I'll keep that in mind...

I made a sort of walking switch : I have 2 tables containing forward/backward arm movement, and it switches like this (example for forward movement) :

Code: Select all

function init()
MoveUp = {
{quads table containing forward arm animation},
{backward arm animation}
}
moveSwitch = 1
end

if "character finishes moving to a tile" then
moveSwitch = 3 - moveSwitch
end
if "character moves up" then
end