Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Art on March 07, 2006, 12:02:52 PM

Title: Actor walking
Post by: Art on March 07, 2006, 12:02:52 PM
I have a question:
It seems to me, that after i prepare actor's walk animation and actor is walking on the scene, it take a little bit more delta, then it's set in walk animation sprite. May me some constant (about 2-3 pixels more) made by engine.
If so, can i turn off it, and make my actor move only on deltas i've put in the walk sprite animation?
Title: Re: Actor walking
Post by: Mnemonic on March 07, 2006, 02:38:34 PM
The walking speed is automatically adjusted according to actor's current scale.
Title: Re: Actor walking
Post by: Art on March 07, 2006, 09:40:30 PM
Then why walking looks different when i look it in sprite editor (it's good) and in engine (it's slips a little bit more, then in sprite editor)?
Title: Re: Actor walking
Post by: Mnemonic on March 08, 2006, 07:49:42 AM
Because it's scaled in game?
Title: Re: Actor walking
Post by: Art on March 08, 2006, 08:36:05 AM
I don't think so, i've set 100% scale to my scene - result is the same...
But it seems to me that except moving by deltas in sprite, engine adds some more delta to character's moving.
For example, if i make walking sprite with only one frame without moving delta - it's moved by engine anyway (see generic actor from tutorial). So does the shifting of actor done by engine only for _one frame sprite without moving_, or the same _additional_ shifting is performed by engine always?
Title: Re: Actor walking
Post by: Art on March 08, 2006, 08:43:26 AM
Even more:
I've just created right walking sprite, which actually moves left.

Code: [Select]
SPRITE {
  NAME="right"
  LOOPING=TRUE
  CONTINUOUS=FALSE
  PRECISE=TRUE
  FRAME {
    DELAY = 25
    MOVE {-10, 0}
    KEYFRAME=FALSE
    IMAGE = "actors\student\rr\right001.png"
    HOTSPOT {110, 421}
    EDITOR_SELECTED=TRUE
  }

  FRAME {
    DELAY = 25
    MOVE {-10, 0}
    KEYFRAME=FALSE
    IMAGE = "actors\student\rr\right001.png"
    HOTSPOT {110, 421}
  }

}

But when i try it in engine, it still canmove right.
So my opinion is that it should not :)
Title: Re: Actor walking
Post by: Mnemonic on March 08, 2006, 09:04:15 AM
Well actually the algorithm is relatively complex, because the actor needs to follow the walking "line", which determines the walking direction. And how fast the actor moves along the line is determined by the "Move X/Y" setting from the walking animation. The move values are scaled according to current scale to adjust walking speed, the values are taken *absolute* and the actor always moves at least by one pixel (so that he doesn't get stuck in case there's no move set at all).
Title: Re: Actor walking
Post by: Art on March 08, 2006, 09:06:30 AM
That's what i needed to know.
So as i see there is no way to turn this one-pixel-moving off?
Title: Re: Actor walking
Post by: Mnemonic on March 09, 2006, 09:47:48 AM
No, but that "one-pixel-minimum" is really only used when there's no Move X/Y set in SpriteEdit so there's no point in removing this functionality.