Don't walk...jump.

Started by Misj', Tue 21/08/2007 00:15:57

Previous topic - Next topic

Misj'

Hi,

I had some free time, so I decided to spend at least some of it on praticing my animation-skills. The object to play around with was my version of Blue Cup (the original sketch can be found here), and I wanted to make him walk, well...jump, since he doesn't have any feet (see the figure below).

If you're still with me, you might be wondering why I'm not posting this in the critics lounge, so let me get to the actual problem. When I loaded the (nine) frames into AGS, I wanted to use it as a walk-cycle...but the walk assumes that the character moves the same amount of pixels every frame. In this example, however, the character does not move on frame 1, 2, 3, 8, and 9; the entire movement of the jump is performed in frame 4-7.

Yes, I'm able to do this using the script-editor, but I' would prefer to set it internally using the the normal walk-cycle. To do that, an option has to be added to the walk-cycle, in which I could set the frame movement. This value would in my opinion have to be either a percentage or 'auto'. For Blue Cup I might for example set these values to: Frame1(0), Frame2(0), Frame3(0), Frame4(auto), Frame5(auto), Frame6(25), Frame7(10), Frame 8(5), Frame9(0). The 'auto' for fram 4 and 5 would then split the remaining pixels (60%) evenly between those frames set to auto (30% each). If all frames are set to auto, you get a normal walk where the movement if each frame is the same (of course being able to set the total distance for a walk/jump-loop would be usefull too for this...since a thin cup might jump further than a fat cup).

Anyway...I have no idea what kind of engine slow-down the required calculations would cause (for a moving crowd(?)). But I think it's something that - if used with caution - could be useful to several kinds of walking animations (for example a pirate with a wooden leg wouldn't move evenly and might even stand still on some frames; just to give an example from the top of my head). Chris, do you think something like this would be possible (and worth your time) to implement?

Misj'



Khris

It's possible to achieve this using only the editor's features, although it won't look that good if the character is moving diagonally.

Say you chose a value of 10 for the x speed in the character pane. Now add 20 pixels to the right side of the 2nd frame. This will move the cup 10 pixels to the left of the sprite's center. In-game, the sprite's center will move 10px per frame, so the cup will appear to stay in one spot although the sprite has moved.

The actual x speed is jump distance/frame count.

In percent: 100%/9 = 11%.

Frame/offset: 1/0%, 2/-11%, 3/-22%, 4/-3%, 5/+16%, 6/+30%, 7/+29%, 8/+23%, 9/+12%

So e.g. add (11% of the jump distance)*2 to the right side of the 2nd frame.

Shane 'ProgZmax' Stevens

Another interesting idea would be to be able to inject a delay in how long each frame appears before it is changed over, that way you could make a frame appear for several loops without duplicating it in the view list.  The character would still move the same distance but the timing of the animation itself would depend on the delay values you set for each frame.  0 delay would assume a frame change every game loop while higher values would slow things down.  AGS already supports a single delay for an entire animation so it wouldn't be very difficult to implement individual delays for each frame.

As for your suggestion it would involve changing the move speed on a frame-by-frame basis, which doesn't sound that difficult to implement either, really.  It's just a matter of enough people liking the idea and CJ having the time.

strazer

Quote from: ProgZmax on Tue 21/08/2007 05:59:16
Another interesting idea would be to be able to inject a delay in how long each frame appears before it is changed over

Not sure I understand you correctly, but isn't that exactly what the SPD setting for each frame in the view editor does?

Khris

I believe this setting is ignored if the view is used as a character's walk cycle view.

Pumaman

That shouldn't be the case.

As for the original post, it's an interesting idea. Perhaps the simplest way would be a checkbox for each frame to say whether that frame advances the character's movement or not. Probably won't make it into 2.8, though. Would anyone else find it useful?

Misj'

Quote from: Pumaman on Tue 21/08/2007 22:18:06
As for the original post, it's an interesting idea. Perhaps the simplest way would be a checkbox for each frame to say whether that frame advances the character's movement or not.

Depending on how you implemented the walk, allowing the user to enter absolute numbers (rather than the percentages I proposed in the original post) per frame for movement might also be an option. This could offer the user quite some possibilities (including accelerate-in and -out of a movement, or making the character take smaller/bigger steps depending on the distance the cursor was clicked (assuming the value could be chanced through the script-editor) and thus reducing in-game walk-time).

Cheers,

Misj'

RickJ

Isn't what's really needed is the ability to specify how many pixels each frame advances.  Maybe the check box could be used to allow the frame speed number to be interpreted as pixels.

Pumaman

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'

Quote from: Misj'Depending on how you implemented the walk ... etc ...

Quote from: Pumaman on Wed 22/08/2007 20:09:57
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.

I kinda guessed/feared something like that...

But to quote the text on one of my colleague's doors: Everything is possible for him who doesn't have to do it himself. ;)

I still like my idea (and see several possibilities for it), but I think we all agree that a good pathfinder is far more important.

Misj'

Scummbuddy

Just posting to say that this is a feature I expect to use in two of my upcoming games.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

RickJ

Quote
Everything is possible for him who doesn't have to do it himself. Wink
Hehehe, I'll have to remember this one, it may come in handy some day!  ;D     

Perahps I could re-ask my question in a bit of a different way?  Isn't the frame speed parameter currently currently just added to the character's default walking speed (i.e. Speed = FrameSpeed+DefaultSpeed).  So why not have an option to make this calculation in another way (i.e. Speed = FrameSpeed%*DefaultSpeed).   Actually I think this is something like Misj or someone else already suggested.



Shane 'ProgZmax' Stevens

Hmm, I thought it didn't work right for walkcycles either.  I'll have to check again.

SMF spam blocked by CleanTalk