PDA

View Full Version : Units of measure for ffc->Vx, Vy?



ScaryBinary
02-18-2008, 04:04 PM
What are the units of measure for the velocity components of the FFC velocities? Pixels per frame? It could be useful when doing collision detection - you could have a moving FFC push Link around, but in order to make it look right you'd have to take the FFC's velocity into account (otherwise the FFC might "run Link over" instead of moving him completely out of the way).

Of course, it may be more trouble than it's worth, having to figure out what to do with a velocity like 0.25.....? Guess a "bump" of 1 pixel in that case wouldn't look too bad.

Joe123
02-18-2008, 04:18 PM
Pixels per frame.
Link moves at 1 pixel per frame.

C-Dawg
02-18-2008, 08:27 PM
I don't think that's right.

Link moves at slightly more than 1 pixel per frame. I think every third frame he moves 2 pixels or something like that.


Link around, but in order to make it look right you'd have to take the FFC's velocity into account (otherwise the FFC might "run Link over" instead of moving him completely out of the way).


This isn't a problem, chief. Remember, Link doesn't have Vx and Vy. So you can only move Link by chaning Link's X and Y directly. If you make sure your moving FFC won't let Link closer than 17 pixels and adjust Link's X or Y if he is, then it'll never run Link over. (You'll have to worry about squooshing Link into a wall, though. Maybe set his health to zero in that event?)

Joe123
02-18-2008, 08:53 PM
If you move Link in the opposite direction to what he's walking in by one pixel per frame he doesn't progress across the screen.

C-Dawg
02-18-2008, 09:11 PM
If you move Link in the opposite direction to what he's walking in by one pixel per frame he doesn't progress across the screen.

I don't think that's right, either. I have a magnet script that pulls Link 1 pixel per frame (I believe) and you can still walk against it, albiet slowly. I'll check my script.

I wonder if it matters that I'm not using BS animation, and I am using Z3 style movement...?

Joe123
02-18-2008, 09:21 PM
Ah, I've had issues with doing this like this with Z3 movement.
And I was using BS Animation too.

Gleeok
02-18-2008, 09:55 PM
I always thought it was about 1.2 or something.

So it's the BS animation makes Link walk faster?

ScaryBinary
02-18-2008, 10:00 PM
Remember, Link doesn't have Vx and Vy. So you can only move Link by chaning Link's X and Y directly. If you make sure your moving FFC won't let Link closer than 17 pixels and adjust Link's X or Y if he is, then it'll never run Link over. (You'll have to worry about squooshing Link into a wall, though. Maybe set his health to zero in that event?)

I understand about Link not having Vx and Vy. Here's what I was thinking:

If an FFC has a velocity that is faster than Link's speed, we need to know that to figure out how far away to "bump" Link, because the next time the frame is drawn, the FFC is going to be Vx and Vy pixels away...so I was thinking the minimum "bump" necessary would be Vx and Vy pixels.

In hindsight, :eyebrow: I guess this is unnecessary if we just recompute Link's X and Y after the FFC as moved. I suppose things might look a little interesting if the FFC is drawn in it's new location first, and then the script is called; it would appear like Link was momentarily on top of the FFC?

Meh, I'm just going off into the weeds now. :rolleyes: At any rate, my original question was ansered. :D

ScaryBinary
02-18-2008, 10:01 PM
If you move Link in the opposite direction to what he's walking in by one pixel per frame he doesn't progress across the screen.

So Link can do the "Moonwalk"?

C-Dawg
02-18-2008, 10:01 PM
I understand about Link not having Vx and Vy. Here's what I was thinking:

If an FFC has a velocity that is faster than Link's speed, we need to know that to figure out how far away to "bump" Link, because the next time the frame is drawn, the FFC is going to be Vx and Vy pixels away...so I was thinking the minimum "bump" necessary would be Vx and Vy pixels.

In hindsight, :eyebrow: I guess this is unnecessary if we just recompute Link's X and Y after the FFC as moved. I suppose things might look a little interesting if the FFC is drawn in it's new location first, and then the script is called; it would appear like Link was momentarily on top of the FFC?

Meh, I'm just going off into the weeds now. :rolleyes: At any rate, my original question was ansered. :D

Nothing gets drawn until Waitframe(). Get everything set by then, and the player won't see a thing.

DarkDragon
02-18-2008, 10:47 PM
Link movement is... complicated. His speed is different if you're using classic or Z3 movement, and in the latter case, whether or not he's moving diagonally.

For classic movement, the distance travelled per frame depends on the precise pixel he's standing on, but averages to about 1.33 pixels per frame.

For Z3 movement, Link alternates between stepping 1 and 2 pixels per frame, for average speed of 1.5 pixels per frame. When moving diagonally, his speed is 1.41 pixels per frame.

Of course, slow walk combos, charging the sword, and swimming all further modify his speed.

Joe123
02-19-2008, 01:32 PM
Oh, looks like I was wrong then =P