Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: subspark on Sun 02/12/2007 20:44:20

Title: Foot Planting
Post by: subspark on Sun 02/12/2007 20:44:20
Is there any way to allow non uniform movement for a character in any given direction?

For example:
(http://www.shuugouteki.net/paul/Development/footplant_example.gif)

Note:
Title: Re: Foot Planting
Post by: SSH on Sun 02/12/2007 21:08:10
The animation only moves once per loop, so its up to you to make your animation move forward properly within the loop.

Having said that, I have considered making the code of the walkcycle generator actually do the whole walking to make the footsteps fall perfectly.
Title: Re: Foot Planting
Post by: subspark on Sun 02/12/2007 21:20:33
QuoteThe animation only moves once per loop, so its up to you to make your animation move forward properly within the loop.
Believe me the animation is as perfect as I'm gona' get it. (Besides actually painting over the placeholder limbs).
It's based off of video reference of myself walking in a controlled straight line. I even had poor man's foot markers just to be safe.

The problem is that no matter how much you shift the character within the square, it's always going to center the sprite internally in AGS.
I don't know if center pivot actually effects anything but the animated preview.
Perhaps it could be worked around by making some of the sprites non square but then again, the feet plant for several frames then break again on the loop over.

As far as my knowledge brings me, this is practically impossible without some sort of scripted intervention.
Is anyone willing to try scripting something?  :)

Cheers,
Paul.
Title: Re: Foot Planting
Post by: Misj' on Sun 02/12/2007 21:52:22
Quote from: subspark on Sun 02/12/2007 20:44:20
  • The blue lines indicate the exact chunk of movement required to get the feet to plant in AGS. It is non uniform.

    Is there any way to do this besides Chris adding a foot plant feature of his own?
Based on this (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=32172.0) thread I would say no, unless a module is crated that includes both the frame-manipulation (frame number, exposure time, and amount of movement) and a pathfinder...or to quote Chris (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=32172.msg415586#msg415586): "This isn't as simple as it sounds, due to the way that the pathfinder calculates the movement path using the character's movement speed -- therefore it's not that easy with the current system to vary the movement based on the animation frames."

Misj'
Title: Re: Foot Planting
Post by: scotch on Sun 02/12/2007 21:56:17
If you keep the frame size the same for all frames then the centering will be the same, you're free to move the character wherever you like inside the box, so you don't need to use scripting. Best thing to do would be to change the animation so the feet are constant rate, but if you don't want to do that you'll have to move it about inside the frame. A scripting solution would be possible but quite awkward.
Title: Re: Foot Planting
Post by: subspark on Sun 02/12/2007 22:00:34
Again, moving the character about inside the frame is futile. When it comes time for the loop to occur the character is either too far ahead of himself or too far behind.
It might be tricky, but this can't be impossible in code.

If no one has any ideas, I guess I'll move on. There are other things to do besides this right now however it would be a lovely feature.

EDIT: After reading that post, Misj, it's even more of a lovely feature than I initially thought. Chris, you said this wouldn't make 2.8, how about 3.0 v1? It's a pretty well known feature in the original SCUMM system for DOTT, and Sam & Max. There are a lot of people besides myself who would benefit from such a feature.

Cheers,
Paul.
Title: Re: Foot Planting
Post by: scotch on Sun 02/12/2007 22:56:29
I do understand, your overall foot movement is not divisible by the number of frames so there have to be some small modifications for it to loop right, as AGS does it now. I'm just saying that movement inside the frame and slight foot adjustments could both smooth out your animation and make it work sooner than waiting for a feature to be implented. If you're ok with waiting, fine.

What sort of feature are you asking for?  A "skip X pixels each walk animation iteration" type feature could sort it out in your case, but it'd still need some moving work. Specifying a movement value for each frame could also work, and wouldn't need frame tweaks but it's more effort to implement and use. It's one of those things that it's hard to design a system for that everyone would like.

Did SCUMM really have this? Does anyone know which approach it took? Most games that have pixel perfect feet do it through animation timing alone, which I understand is harder if you are rotoscoping.
Title: Re: Foot Planting
Post by: subspark on Mon 03/12/2007 02:50:08
QuoteMost games that have pixel perfect feet do it through animation timing alone, which I understand is harder if you are rotoscoping.
It's hard in general, yes. If I did tweak my walkcycle to plant his foot evently each frame then the animation would look off and his legs would stretch too far or too little. In reality, nobody walks uniformly anyway. The minute we plant our foot on the ground we cause friction which in turn slows us down. Remember in true locomotion we use our feet to push up as well as forward.

QuoteWhat sort of feature are you asking for?
Basically this:
(http://www.shuugouteki.net/paul/Development/footplant_tool_example.gif)

QuoteIf you're ok with waiting, fine.
While this is a feature I would love sooner rather than later, it's not something I'm going to halt production for.

Edit: By the way Chris, turning small fonts on doesn't seem to solve my wacky layout problem. Just FYI.

Cheers,
Paul.
Title: Re: Foot Planting
Post by: Pumaman on Mon 03/12/2007 19:14:15
Is this a feature that anyone else would be interested in?
Title: Re: Foot Planting
Post by: FSi++ on Mon 03/12/2007 19:21:56
If these shifts would help against jerking of speech animations, then count me in :P
(Imagine character like Stan from MI: he waves his left hand, sprite's center shifts and it looks like he moved his whole body, which is at least strange; all my characters are simple and symmetric though, so that might as well be a leftover feeling left from v2.55)
Title: Re: Foot Planting
Post by: Khris on Mon 03/12/2007 21:06:40
I took the liberty of evening out the foot movement (using only the first half):

(http://i208.photobucket.com/albums/bb259/khrismuc/guy.gif)

Edit: FSi, not sure if that's what you're talking about, but fixing jerky animations is explained in the BFAQ (http://americangirlscouts.org/agswiki/Graphics%2C_Characters%2C_Text_%26_Rooms#Jerky_character.2Fsprite_animation).
Title: Re: Foot Planting
Post by: SSH on Mon 03/12/2007 21:10:34
Am I missing something, or do these problems only occur when people over-trim their sprites?
Title: Re: Foot Planting
Post by: subspark on Mon 03/12/2007 23:15:02
QuoteIs this a feature that anyone else would be interested in?
This would provide a means to doing things like peg legged pirates or zombie limping. Thinks of LeChuck and his ever cool non uniform limb dragging action.

QuoteI took the liberty of evening out the foot movement (using only the first half):
Wow Khris. You can see now why I'm using video reference. My animation sucks kachugas. Looks smoother, more accurate and I'm about to test whether the feet line up in the engine.

QuoteAm I missing something, or do these problems only occur when people over-trim their sprites?
Trimming sprites has nothing to do with my problem, SSH. In fact you can see in my original post that my walkcycle sprites were square.

Cheers,
Paul.
Title: Re: Foot Planting
Post by: Khris on Tue 04/12/2007 00:54:12
Here's a short demo showing non-uniform movement using only built-in frame/view settings: http://www.2dadventure.com/ags/Froggies.zip

Space to switch frogs, move the mouse to the top to take a look at the frames.

The green frog's sitting frame has a long delay to prevent it from sliding while it's moving diagonally.

(Before I cropped the blue frog's frames to an odd width, the movement was jerky even when it moved horizontally only. I assume the method AGS uses to calculate the pivot of a frame with an even width yields random results.)
Title: Re: Foot Planting
Post by: subspark on Tue 04/12/2007 01:08:08
Hmmm.
I readjusted all my frames to try and keep even foot placement. Alas I still had to adjust a couple of frames. Frames 1 and 6. When I adjusted them, other frames went out of line.
I can quickly see how this is going to be a nightmare without some kind of official support for non uniform movement.

I'll have to move onto something else for now.
Thanks anyway Khris. Cool demo by the way!

Cheers,
Paul.

EDIT: I just had a thought. You could also use non uniform movement to have the character step down into an indent in the floor without the need for additional or specialized views.
And then of course theres 'stairs' which could easily be done!  8)
Title: Re: Foot Planting
Post by: Khris on Tue 04/12/2007 01:48:43
The adjusted version I've posted consists of the same 6 frames I used in AGS to test the walk-cycle. As long as the movement speed is set to 3 and the character walks straight to the left/right, the feet don't shift at all; they stay right where he put them down.

If a game uses lowres and the character is able to walk freely in every direction, it isn't possible to avoid an occasional visible jerk, even when using 8 loops.

I assume that the char coords are handled as floats internally because the character keeps his speed perfectly when walking diagonally. That makes the offset of the next frame pretty much unpredictable.

Also I still fail to see why implementing this feature is even necessary. Everything it'd do can be achieved already by moving the pixels inside the frame.
Title: Re: Foot Planting
Post by: subspark on Tue 04/12/2007 05:58:02
QuoteAlso I still fail to see why implementing this feature is even necessary. Everything it'd do can be achieved already by moving the pixels inside the frame.
I am suggesting it because in all cases it is by far more efficient, easier, quicker and neater if you can simply click a spinner than having to manually sift through your sprites in Photoshop and adjust them frame by frame. I can't understand your neglect of such an obvious plus for AGS.
Even as an artist, I still vote the easier method. :)

I've had no luck with what you suggested at all by the way. Got Fraps? Would you be so kind as to record your test and send it to me? My email is public.
I can only be sure I'm doing something wrong if yours works differently to mine. I adjusted the rest of my frames based on your generous example, set the speed to 3 (I predicted that one) and recorded it using Fraps.

Frame by frame I noticed shifting by one pixel here and there and on a low res game that can become quite a noticeable hindrance in full screen.
I would appreciate a recording if you have the time. You've been a great help so far Khris.

Thanks a lot,
Paul.
Title: Re: Foot Planting
Post by: Misj' on Tue 04/12/2007 13:14:24
Quote from: KhrisMUC on Tue 04/12/2007 01:48:43
Also I still fail to see why implementing this feature is even necessary. Everything it'd do can be achieved already by moving the pixels inside the frame.
It's more logical (especially from a graphical/animation point of view), and it's much more easy to make small adjustments within the AGS-software.

Besides, from a sarcastic point of view one might use the same argument ('why have a simple method, if it can be achieved already (albeit in a more clumsy way)') to question the whole existence of AGS, since everything can already be done using C. (sorry, I couldn't resist the remark ;) ) - No, the reason why I think this is a useful addition to AGS is, because it strengthens AGS as a stand-alone tool for adventure games; and especially for more complex and/or professional animations, where a better control is required over the sprites.

And if one were to be able to adjust these parameters in-game (which fits within the stand-alone argument), one could for example make a jump slightly shorter or smalled depending on the distance required (where only the specific 'in-flight-frames' are affected by this)...the same goes for the walk cycle.

I can think of more arguments why this feature makes a lot of sense. However, the biggest (though not the only) argument against (having to rewrite the pathfinder) could be considered (to me) to outweigh each of these arguments...which is why I didn't beg any further in the thread I mentioned earlier.  :D

Misj'
Title: Re: Foot Planting
Post by: Khris on Tue 04/12/2007 14:34:01
Lowres sprites need some careful planning, that's all. Stick to a few rules when drawing them, and they will look just fine in-game, with perfect foot planting.

Here's the vid (http://home.arcor.de/choala/ags/walk.html).

QuoteI can't understand your neglect of such an obvious plus for AGS.
An obvious plus for AGS would be if people stopped to request "make my game" type stuff every other day. It's a powerful, free engine that's developed in CJ's free time.
Stop wasting that time just because you're too lazy to move some pixels.
Really, do I have to spell it out?

Edit: MrColossal: And I'm perfectly capable of deciding when and how to voice my opinion without you patronizing me, thanks.
Title: Re: Foot Planting
Post by: MrColossal on Tue 04/12/2007 15:11:04
I think CJ is perfectly capable of deciding what is a waste of time and isn't for him to do without need for insulting other members, KhrisMUC.
Title: Re: Foot Planting
Post by: Pumaman on Tue 04/12/2007 20:24:41
Quote from: KhrisMUC on Tue 04/12/2007 14:34:01
An obvious plus for AGS would be if people stopped to request "make my game" type stuff every other day. It's a powerful, free engine that's developed in CJ's free time.
Stop wasting that time just because you're too lazy to move some pixels.

I don't buy this argument, because then you could well say "why should AGS have a Repeat Music option, just because you're too lazy to put a check in for when the track finishes and restart it yourself?", and go on stripping out features until there's nothing left.

As with any other suggestion, if it's something that there's popular support for as a feature that would make game-making easier, then it will be considered for a future version.

QuoteEdit: MrColossal: And I'm perfectly capable of deciding when and how to voice my opinion without you patronizing me, thanks.

Please, this is the Technical Forum, not Aunt Mavis's Daycare Centre. Let's keep it civilised.
Title: Re: Foot Planting
Post by: subspark on Tue 04/12/2007 22:09:18
I respect your opinion Khris but I'm highly inclined to agree with CJ. He relies on this community to provide feedback on features that are most desired.
A suggestion may seem like a waste of time to one member, but be perfectly reasonable to everybody else.
So again I respect your opinion, but I don't believe I deserve to be criticized for my own.

EDIT: Ideally, if you have correct foot planting at full scale either by sprite editing or the suggested feature you can solve the foot sliding problem that occurs if AdjustSpeedWithScaling is turned on. I imagine you'd simply need to tweak your frame's coordinates for each scale state. That is if states is the way Chris would go about this.

Cheers,
Paul.