Walkable Areas

Started by Wolverine, Tue 08/02/2005 06:28:53

Previous topic - Next topic

Wolverine

OK. I'm getting frustrated. For a week now, I have worked around one of the most annoying bugs I have found in a long time.

I made a walkable area. But whenever ego hits the bottom or the top of the walkable area, he stops about two pixels above it. It's very obvious where he stops because it's a 320x200 image he's stopping on. Is there any way around this? I already tried resizing the walkable area by expanding it, but he just walks to the same point for a few attempts and then he suddenly walks way past where I want him to stop after that. :( HELP! :)

strazer

I'm not certain what your problem is, but a character's coordinate point is at the very bottom-middle of the sprite.
Make sure there's no empty space below his feet or make walkable areas smaller to compensate for this.

Radiant

I believe I've run into the same problem. The trick is that characters take 'steps' that aren't one pixel size, but rather depend on the character's speed (usually three or four pixels per animation loop). So, a character could always stop two or three pixels before the end of a walkable area.
This also means that if you use regions to trigger something, they must be wide enough to accomodate this.

Wolverine

Thanks guys. :) I'm going to try to crop off this little tidbit under ego's feet and see if this helps. If not, I'll mess around with his animation speed. Again, thanks, guys. I was about to scream last night I was so frustrated.

Wolverine

OK. Didn't help any. I cropped the sprites and such and there was like no difference  in his walking patterns. I even increased his animation speed to no avail.

Now, the walkable area is the right size. But he stops about three pixels prior to the edge of the walkable area. If I make the walkable area larger than that, he walks way out there, but if I make it the right size, he doesn't stop where he should. :(

Pumaman

You shouldn't expect the character to necessarily travel to the very edge pixel of the walkable area. As Radiant says, the movement isn't quite as accurate as that, but it should always get within 2 or 3 pixels. Is there a particular reason why you need the character to move to the very edge?

Wolverine

No particular reason. Just personal preference and being use to the way that AGI worked.

Radiant

You should DEcrease the walking speed to solve the problem, not increase it.

Pumaman -> a possible FR would be to always have the character move to the very last pixel of the walkable area. Then again this may look weird and/or be annoying to code.

SMF spam blocked by CleanTalk