character speed (a.k.a step size)

Started by rich, Wed 12/09/2007 23:36:13

Previous topic - Next topic

rich

I may have asked about this before, but I don't remember the answer. The default "speed" for a character is 3. It doesn't really seem to mean speed at all but rather stepsize. I have come to learn that spped of 3 means when walking left/right, the character is moved three pixels with each cycle through the animation of them walking. If you truly want to make sure the character doesn't glide, you need to know this while drawing the animations and actually move the foot which is touching the ground three pixels backwards with each animation.

I've also learned that the standard speed of 3 moves the character up/down 2 pixels at a time, not 3... and 2 up/down and 2 left/right while moving diagonal, not 3 and 3. If anyone has imported a Sierra character sprite sheet, which moved 3 in all directions, you will see it glides in the up/down and diagonal directions a bit.

Is there a chart somewhere that shows the various pixel step size movements in each direction for each of the different speeds you can set a character to in AGS? Better yet, is there a way to change the step-sizes of each direction individually?

EDIT: I see that you can set the y (up/down) or x (left/right) speed independently by unchecking the "Uniform Movement Speed" option in the character options. I guess this brings up two more questions...

1. Will moving diagonally always utilize the current speed of x, and the current speed of y together?

2. Why is it that when I have speed set to 3, with "Uniform Movement Speed" checked that x is 3, but y seems to be 2... and the diagonal seems to be 2 and 2? Is there some sort of bug or am I just doing it wrong somehow?
I'm so excited!

ciborium

I don't have the answer to this question.  But I have a related question.

Is there a way to edit the diagonal movement speed independently from x-speed and y-speed?
My character movements look good on the x and y axis, but glide like crazy on diagonals.


rich

Actually, being able to edit the diagonal speed independantly from simple x and y is a feature I would love to have as well.
I'm so excited!

Khris

I'm pretty sure the diagonal speed is not a single number but consists of an x and y component:

dx=x*cos(angle)
and
dy=y*sin(angle)

I also believe that a result like 3.2 will show on screen as 3-pixel movement (or, in technical terms: the x step and x coordinate of the character are stored as ints, so the rounding error cumulates).

Having glitch-free diagonal walking on lowres is wishful thinking anyway (at least when using no diagonal loops).

Another thing I'm pretty sure of: the diagonal speed isn't x-speed + y-speed, it's less than that [s=sqrt(x*x+y*y)], i.e. the actual speed of the character will remain roughly the same, regardless of the direction.

Pumaman

The diagonal speed depends on the angle of movement. The basic formula is:

overallSpeed = spy + ((dx / (dx + dy)) * (spx - spy))
pixels_per_frame_x = overallSpeed * cos(angle)
pixels_per_frame_y = overallSpeed * sin(angle)

where spx/spy are the x/y movement speed for the character, and dx/dy are the distance to move.

SMF spam blocked by CleanTalk