charcter speed problems

Started by Anarcho, Fri 01/04/2005 03:27:57

Previous topic - Next topic

Anarcho

I'm having a hell of a time with my main character's speed and animation speed.Ã,  It seems like no matter what setting I have it on, she moves way too fast.Ã,  I thought that if the speed is set at a higher number the character is supposed to move more slowly.Ã,  I've found that if I set it low, like at 0 she practically transports across the screen.Ã,  If I set it around 15 she moves really fast, but at least you can see her.Ã,  If you set it anything higher she transports again.Ã,  Additionally, I can't get her animation loop to slow down, I imagine I can just delay each individual frame by huge numbers, but the same thing is happening with the "animation speed" setting---it is just always moving too fast.Ã, 

I'm using v2.62.Ã,  I don't think I had this problem with the previous version of AGS.


MrColossal

have you tried turning on anti-glide mode?

it's in the general settings tab
"This must be a good time to live in, since Eric bothers to stay here at all"-CJ also: ACHTUNG FRANZ!

Anarcho

Yeah, I've tried it on both settings.  With anti-glide on and off.


strazer

QuoteI thought that if the speed is set at a higher number the character is supposed to move more slowly.

No, higher numbers mean faster walking speed.
A walk speed setting of 0 instantly moving the character to his destination is a feature.

Anarcho

Ok, I got the movement speed problem down.  But the animation speed is still troubling me.  In the help file it says:

To change the rate at which the character animates, change the Animation Speed box. Here, a smaller number means faster animation.

But no matter what number I set the animation speed in the character editor, she still moves at the same speed.  Why would that be?  I even changed the frame delays to different numbers in her walk views, and she still walks the same way---regardless.  I've also toggled the glide/anti glide setting.  There must be something obvious that I'm doing wrong.


Khris

#5
I've played around a bit with Roger, testing different speeds and animation speeds.
My conclusions so far:

Speed sets the amount of pixels the character moves between two walk-cycle frames.
Ideally, this number is chosen before drawing the walk-cycle; feet touching the ground should move this very number of pixels between frames to avoid gliding/moonwalking.
Values from 4 (many frames) to 8 (few frames) seem to give good results (low-res games).
Once the speed setting has been established, leave it alone! To change the character's velocity, use animation speed only.

Animation speed sets the time in game-cycles (1/40s normally) between two walk-cycle frames.
Let's say you want the main character to move at a speed of v=100px/s. (That way it'll take him 3 seconds to cross a 320-screen, which is a reasonable time, IMO.)
And let's say we set the speed (frame-to-frame-distance) to s=5.
Then the animation speed is: (s*40)/v=(5*40)/100, which evaluates to 2.
Or in general: animation speed = (speed * gamecyles per second) / desired velocity in px/s.

So: Every animationspeed gamecycles, the character moves speed pixels and the next walk-cycle frame is displayed.

Phew. Hope this helps.

Edit: It's funny that neither speed nor animation speed are actually speeds. The former is a distance, the latter's an amount of time :)

Anarcho

#6
I know you're trying to help me, but I have no idea what you're talking about.  When it comes to any kind of math, my mind shuts down.  :-\ 

But here's what I do know...my game is high res, the best speed I've found is 3, otherwise she goes too fast.  With the speed set at 3, no matter if I set the animation speed at 1, 2,3, 4, 5, 6, 7, 8, 9, 13, 25+---whatever, her animation loop goes at the same speed.  And that speed is too fast. 

UPDATE: So I also just figured out that the animation speed setting does work, but ONLY when the character is moving to a walk-to point.  For example, if you click the interact icon on a hotspot, and the character starts moving toward it, the animation setting and frame delay settings suddenly work.  I found this the hardway because I set the frame delay to 100 each, and it only worked when the character went to a hotspot.  I then set the frame delay back to 0, and played just with the animate speed setting in the character editor, and it again only worked in this manner.

what's going on?!?


Anarcho

Sorry to bump this, but I'm still having the same problem here, and I really need a solution.  No matter what number I set the Animation speed at for my main character, she walks at the same fast speed.  Does anybody know what I could have done that could have effectively disabled the animation speed setting in the character editor?!?


Scorpiorus

#8
Maybe the animation speed of a character is changed with the character[...].animspeed variable somewhere in the script?

Are you using AGS 2.62 now?

Can you post the main global script you're using?

EDIT:
Additionally, what if you try making another test game and setting walk and animation speeds, and then see if it works with Roger?

Anarcho

Ok, first of all, I'm using 2.7, but I had this same problem when I was using 2.62.  I do remember this problem cropping up around the time I updated to 2.62, but maybe I'm just imagining things.

As per you suggestion, I made a test game to see if the same problem occurs---and it doesn't.  I used the same animation cycle and everything, and when I change the animation speed to a higher number the animation is slower.

Finally, here is my global script:

http://www.geocities.com/princebusterlw/EE_MainGlobalScript.txt

There must be something somewhere that is turning off the character editor setting. 


Scorpiorus

Ah, that's because you have...

SetCharacterIdle(EGO, 33, 0);

within the repeatedly_execute function.

It is not supposed to be called multiple times (each game loop).

Just move that line to the game_start function instead:

function game_start() {
Ã,  // called when the game starts, before the first room is loaded

SetCharacterIdle(EGO, 33, 0);

}

Anarcho

Ah, that's it! Thank you Thank you Thank Scorpiorus.  You're my new personal hero.   ;D


Scorpiorus

You're welcome :)

I actually believe that the SetCharacterIdle function shouldn't behave like that. I gave it a test and found out that it just skips the current frame of animation when called while the character is animating (animation while moving counts as well).
And furthermore calling SetCharacterIdle(..., ..., -1) while char is moving stops him but moving animation continues playing.
It is not supposed to be invoked while char is moving but AGS doesn't report a warning unlike it does while the view is locked for animation.

So please could a moderator move this topic to the technical forums so that CJ could take a look?

Pumaman

Hmm you're right, it does skip the current frame if the character is animating at the time. I'll get it fixed.

The workaround is of course to only call SetIdle when the character is not moving/animating (eg. in game_start).

SMF spam blocked by CleanTalk