Feature Request: Walking animation keep going even if direction is changed

Started by AndreasBlack, Tue 05/09/2023 23:30:29

Previous topic - Next topic

AndreasBlack

What i mean is if you go to one side and then go down or up to the same side. "DOWN/RIGHT" or "UP/RIGHT", etc. it will cancel the ongoing animation and it looks really bad. Say when using a controller like a "d-pad" style beat 'em up game (Sorry i know it's like cursing in Church, but just to get the point across). Probably someone might do a point & click or RPG while using a controller in a "Grim Fandago" stylish manner and it just doesn't look right!

Thanks!

Crimson Wizard

This sounds like an oversight or a mistake in the engine.

I don't think this will be too difficult to fix, but my question is: may there be a reason to make this optional?
If so, is this a option per character?

AndreasBlack

Yes, you are probably right! Sorta like a tickbox in the characters options..

ContinuesAnimationMovement true or false  ??? Something like that perhaps  (roll)

Snarky

Can't the original behavior be accomplished by adding a Character.StopMoving() command before the redirection? If so, I don't think there is any reason to add another configuration setting.

AndreasBlack

Quote from: Snarky on Mon 11/09/2023 13:25:27Can't the original behavior be accomplished by adding a Character.StopMoving() command before the redirection? If so, I don't think there is any reason to add another configuration setting.

No, it's already in the keyboard module i'm using, look here:
Code: ags
    KeyboardMovement_CurrentDirection = newdirection; // update current direction to new direction

  } else { // if new direction is same as current direction
    player.StopMoving(); // stop player character
    KeyboardMovement_CurrentDirection = eKeyboardMovement_Stop; // update current direction
  }

but it does not work that way, unfortunaly. Khris (Module creator) said he'd might fix it in the future. But i think he shouldn't. Cause it's such a basic animation feature that it should be in the engine itself from the get go. (nod)


Snarky

That's not what that snippet does. It's for the tap-once-to-walk, tap-again-to-stop movement style used in Sierra games.

But anyway, I was saying that calling StopMoving() should assure the behavior that you don't want, for those who for whatever reason prefer that, without the need for a new configuration setting:

QuoteCharacter.StopMoving()

Stops the character moving and sets its graphic to the standing frame of the current loop.

Crimson Wizard

Quote from: AndreasBlack on Mon 11/09/2023 16:07:59No, it's already in the keyboard module i'm using, look here:

but it does not work that way, unfortunaly. Khris (Module creator) said he'd might fix it in the future. But i think he shouldn't. Cause it's such a basic animation feature that it should be in the engine itself from the get go. (nod)

Wait a minute.... I thought this is about a seamless walking, when you order ONCE and character makes turns along the pathway. I thought THAT does not work, which sounded like a true mistake.
But I used a inconvenient test case, I did a better one and can see that THIS actually works.

In fact, I found that it keeps the last frame number even when a new walking destination was ordered while character is still walking.

So... what is the problem then? @AndreasBlack, could you elaborate on this case? Which code do you use to order character to walk? If you are using a module, please post the link.

AndreasBlack

It is about seamless walking with a keyboard module/gamepad, i didn't write that, it seems? Sorry! Since AGS has no built in keyboard movement (it seems)! Perhaps that would be the new feature request instead! Anyway. All keyboard modules i've tried suffer the exact same faith = all AGS users will end up with the same issue.

The "new problem" seems to not be AGS engine related, sorry i didn't do my "debugging" right :-[. Something is off in the various Keyboard Module's coding. I believe the module's unfortunaly are doing their own "movement" and they are in fact not following AGS Engine's mouseclicking behaviour which i mistakenly thought it did ofc! The animation ends up cutting itself off when trying to walk seamlessly with any walk module available on the AGS forum (at least that i've tried)! Hopefully it's an easy fix like you say. If not. well don't bother.

Here's the script i use, and i warn you if stuff looks strange in the script, it could be my own attempts..

https://www.mediafire.com/file/i2yv1xi930ipqq0/Keyboard+Module.ash/file

https://www.mediafire.com/file/amul10iec7ipz8b/Keyboard+Module.asc/file



Crimson Wizard

I found what is the difference. In the keyboard module you are calling WalkStraight. Unlike Walk, WalkStraight has a slightly different code that results in resetting to frame 0 always. While Walk remembers the last frame.
This seem to be an oversight in the engine. The solution would be to make them work in the same way.

Meanwhile, the simple solution in script would be:
Code: ags
int frame = player.Frame;
player.WalkStraight(player.x + dx, player.y + dy, eNoBlock); // walk player character to the new coordinates
player.Frame = frame;



AndreasBlack


Crimson Wizard


eri0o

QuoteAll keyboard modules i've tried suffer the exact same faith

@AndreasBlack , have you tried my Controlz module? It works differently, maybe it would work for your game.

AndreasBlack

Quote from: eri0o on Mon 02/10/2023 15:12:08
QuoteAll keyboard modules i've tried suffer the exact same faith

@AndreasBlack , have you tried my Controlz module? It works differently, maybe it would work for your game.

I did, i think? If you did use "Walkstraight" in your module it would work the same, however it's been fixed now Crimson fixed it. But tbh it's still acting a bit strange this time in another matter, i don't want to make Crimson cry, but instead if you walk on a walkable area now what happens is if you stop at the "wrong places" it can freeze on random walking cycle frame instead, a bit odd. It happens using the gamepad or keyboard modules.

eri0o

It doesn't use WalkStraight, all animation is handled through script.

Crimson Wizard

Quote from: AndreasBlack on Mon 02/10/2023 15:16:10instead if you walk on a walkable area now what happens is if you stop at the "wrong places" it can freeze on random walking cycle frame instead, a bit odd. It happens using the gamepad or keyboard modules.

Can you elaborate on this?, I need to look into this as this in case this is a engine mistake.

AndreasBlack

@Crimson Wizard I'm quite sure it has to do with being on the edges of a tight walking area, not in the "middle" of a walking-area, if that makes sense? Like you have to walk out on the sides and stop the character = it can stay on a random frame in the walkcycle, until you continue walking. I can probably record a video later if you want to see it in action. For me personally it don't matter that much. I'm trying to focus on creating the game now. Big rooms left to draw! (nod) 

SMF spam blocked by CleanTalk