[SUGGESTION] Custom Character Base Coordinates / Frame Offset

Started by TerranRich, Wed 28/10/2009 21:01:01

Previous topic - Next topic

TerranRich

Here is something that I'm surprised hasn't been implemented yet:

Custom character base coordinates/frame offset

If I have animations of my character bending down to pick something up from the ground, the animations don't align and there's this jerking effect when the "bend-down" animation starts and also when it finishes. I tried adding padding to compensate, but in one case I'd have to take away from one edge of the "bend-down" animation, and that's just not possible.

If we could set the character's base coordinates at the beginning of each animation view, this would solve the problem completely. Additionally, if we could set base coordinates on a per-frame basis, we could also eliminate the hassle of cropping/expanding our walk cycles, etc. to match center coordinates!

Please, Chris, consider this for a future version of AGS!
Status: Trying to come up with some ideas...

AngelicCharon

Actually, I'd prefer it to be done by the sprite, as opposed to by the view.

Allowing for a custom axis/offset per sprite would allow for lining things up much easier.

But yeah, I'd be down for something like that.

Pumaman

Yes, some sort of custom pivot point rather than always being the bottom-centre of the sprite would be good, it's something I've been meaning to do for ages.

For now you have the LockViewAligned and LockViewOffset functions to work around this.

Ryan Timothy B

You would need an animated preview to see if the new horizontal/vertical placement (per frame) is properly placed.  Otherwise it would be a big guessing game.

It would be even better if there were an animated loop preview which was interactive for the horizontal/vertical placement adjustment for the sprite frame (yes, that was a mouthful).  So you can move from frame to frame to see if it lines up (if not, you click the buttons on the sides, or top to adjust the placement.  Etc.
I would show a mockup of what I mean, but this temp computer is p***ing me off. :P

TerranRich

As for precise placement, you could have the ability to enter in coordinates manually (and get them from, say, Photoshop).

LockViewAligned only works if the edges or center align perfectly. :-\  No idea why I didn't think of LockViewOffset, which could work.

But an editor-based setting would just be better. ;)
Status: Trying to come up with some ideas...

Shane 'ProgZmax' Stevens

What I do is just make the image size the character is in large enough to accommodate most (if not all) animations for that character and center him in the middle.  That way I can have him jump, run, fall, and all those nice things without needing to muck with repositioning him so it doesn't look jerky.  The empty area doesn't significantly impact file size, either.

TerranRich

Yes, this is a great workaround, and you're right about the file size. But this requires that I have all my animations done before I can even put a walk cycle in the game. I have two sets of idle animations, walking, talking, thinking, and a few other animations (like bending down to pick something up, etc.), and this feature would save a lot of work.

For the time being, I am putting every single frame of every single animation into Photoshop (one file, each frame will be its own layer), grouping the animations together, aligning each group so the feet all match, cropping the entire batch (to remove space), then saving each layer as a file (via Photoshop script).
Status: Trying to come up with some ideas...

ThreeOhFour

Quote from: TerranRich on Tue 03/11/2009 01:21:47
Yes, this is a great workaround, and you're right about the file size. But this requires that I have all my animations done before I can even put a walk cycle in the game.

I don't understand why?

Characters are always centered. As long as you make sure his center is always in the bottom middle of each frame, it doesn't matter whether each frame is the same dimension as the others at all. I often have a whole heap of different animations for a single character and each unique animation has a completely different set of dimensions from all the others. As long as you keep him/her in the center of those frames, there's no need to get all your animations all done and make sure they're all the same size.

Apologies if I have misunderstood you.

Khris

Yes, currently, moving the character during an animation to avoid jerking is only required if a frame has to extend below the character's baseline.
Since a character is standing on solid ground most of the time, I can hardly think of a situation that required that, except maybe picking something up from the ground while facing towards us.

Even then, a line inside rep_ex_always like "if (player.Loop == 4 && player.Frame == 3) player.z = -5; else player.z = 0;" should be enough.

Shane 'ProgZmax' Stevens

Exactly.  Once you set the rules (the max dimensions you think you'll need for a character to do normal things) and position him consistently in your animations you won't have trouble.  For the few animations you run into where the dimensions aren't sufficient you can just adjust it in game.

SMF spam blocked by CleanTalk