weird animation problem

Started by Buckethead, Wed 16/08/2006 12:24:10

Previous topic - Next topic

Buckethead

Ok.

I made a simple talk animation out of 2 sprites. I imported them and created a new view for the animation. I selected view 3 for (which is the talk animation) speech. Now when my char talks in the game the animation plays in a whole different place then the character actually is. How can I fix that?  :-\

Khris

Make sure that the characters are all centered within the sprites, since their hotspots are at the bottom center.



Using 1 and 2 together is fine, although they have different widths.
Using 3, too, would make the characters jump sideways.

Alynn

best way to do this is to crop, IIRC it crops to the smallest size the largest sprite can fit into. You can do them one at a time or as a group, however the group has to be the same size before cropping. But that can usually be done in a paint program and a reimport.

Buckethead

I don't think thats causing the problem. Just look how far away the both thing are from eachother.



Plus both images are centered.

Alynn

Wait, are you using (I can't remember which one is it) the talk style that uses portraits? It's quite possible that you are seeing the portrait of the person that is talking.

Buckethead

OMG yeah that must be it!! I can remember messing around with that and didn't change it back. I feel like such a noob. Thnx for the help  :)

strazer

Quote from: Alynn on Wed 16/08/2006 12:52:32
best way to do this is to crop, IIRC it crops to the smallest size the largest sprite can fit into. You can do them one at a time or as a group, however the group has to be the same size before cropping. But that can usually be done in a paint program and a reimport.

However, this only works if the actual images are symmetrical, right? Because if a character only waves one arm, for example, its center would shift when cropped?

Just asking, I haven't done this before.

Alynn

Strazer, if they are all the same size to begin with (with various sized transparent areas) it will crop all down to the smallest size possible by the biggest sprite. So it's possible for the center of the sprite relitive to the center of the entire image to be off, but if all views sprites are cropped the same way, everything will match.


It's most helpful when trying to size everything down to save on space (especially larger objects).

strazer

If I understand you correctly, for this to work you assume all view frames to be aligned left or right?
But for characters, the default alignment is their center. For special animations, that's less of a problem because you can use Character.LockViewAligned instead of Character.LockView, but for the frames of the walking view this wouldn't work since they are centered by default, right?

Alynn

#9
Well this is how it seems to work (and I'll demonstrate one problem)
we have 3 14X14 px images, each of them have a 10X10px square sprite (for simplicity sake).
One sprite is all the way on the left side of the image on the bottom, another is middle on the bottom, and the last is all the way to the left on the bottom.

What it does is look at the non transparent portions to figure out the largest size, in this case 10X10, it then looks at what is transparent, on each image.

So for the sprite where the block is on the left it removes the 4 transparent pixel colums to the right of it, for the sprite on the right side, it removes the 4 transparent pixel columns on the left. For the centered block it removes 2 from the left, and 2 from the right, now they all align perfectly by the center. It does the same for the top, but since all sprites are 10 tall and aligned to the bottom, it just removes the 4 pixel rows from the top for each image.

Now the issue is if you have the same scenero above, but one of the blocks is 12 pixels wide. The crop only takes away pixels, so say if the center aligned block was the 12 pixel wide, then it would remove one pixel from each side of that image, remove 2 from the right side of the left aligned image, and 2 pixels from the left on the right aligned image. Which causes a pixel shift if in a view and animated.

If they aren't fully aligned to the left or right, it attempts to center so if there is one transparent pixel on the left, and 3 to the right, it will remove 2 right pixel columns before it removes the left pixel column.... generally speaking though, it keeps them as even as it can. Unless your sprites are grossly missized they will only be off by one or two pixels.

I'd need CJ to back that up, but that's what it seems to be doing.

Also, we brought this thread way off topic....

PS I'd like to add, I haven't used this feature in years, so my memory may be fuzzy, and I may possibly be mistaking it for something else, it's quite possible that it just removes as many pixels from one side and the other as it gain until it reaches a non transparent pixel. My brain seems confused on this (and since I'm at work and not at home, I can't test it).

SMF spam blocked by CleanTalk