Wintermute Engine Forum

Wintermute Engine => Bug reports => Fixed => Topic started by: Dionysius on May 08, 2008, 04:06:22 AM

Title: PlayAnim() bug. When the first and the last frames are different
Post by: Dionysius on May 08, 2008, 04:06:22 AM
When the actor sits down and stands up it looks like engine plays twice the first frame of the animation. It is noticeable, that the actor twitches between "standup" and "idle" and between "sitdown" and "work".

Animations:
"sitdown"   - actor sits down at the computer
"work"       -  actor hits the keys of the keyboard (he is sitting)
"standup"   - actor stands up from the computer

Here is the exe-file, which demonstrates the bug: http://reptilesquest.mirgames.ru/download/bug.zip (5,2 Mb)

Press F1 - the actor will sit down.
Press F2 - he will stand up.

Code:
Code: [Select]
if(Keyboard.KeyCode==VK_F1)
  {
  actor.PlayAnim("sitdown");
actor.IdleAnimName = "work";
  }
  else if(Keyboard.KeyCode==VK_F2)
  {
  actor.PlayAnim("standup");
actor.IdleAnimName = "none";
  }
The actor has no "none" animation. I did this to show the bug better. It is noticeable, that at the end of the "standup" animation the first frame is played again.


Part of .act3d-file
Code: [Select]
  ANIMATION
  {
    NAME="sitdown"
    LOOPING=FALSE
  }

  ANIMATION
  {
    NAME="standup"
    LOOPING=FALSE
  }
 
  ANIMATION
  {
    NAME="work"
    LOOPING=TRUE
  }
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: Mnemonic on May 31, 2008, 11:51:38 AM
That's nice and sweet, but you could you *please* provide me with sources of this demo? Compiled and bound to executable it's pretty much useless for testing... Thanks.
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: Dionysius on June 02, 2008, 04:00:16 PM
Please, read the PM :)
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: Mnemonic on June 02, 2008, 09:30:47 PM
Thank you!
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: Dionysius on July 17, 2008, 02:25:24 PM
Fixed? Where I can take the patch?  :)
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: Mnemonic on July 17, 2008, 02:40:58 PM
Patience, young padawan. I'm trying to push in some more bugfixes.
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: Dionysius on July 17, 2008, 04:10:32 PM
Ok, master Yoda   ;D
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: rkitting on July 23, 2008, 08:33:16 PM
I think I am getting this too, switch IdleAnimName to 'lay', then play a 'standup' animation. Then set IdleAnimName to 'idle' again and it jumps to 1st frame of 'standup' really fast like 200ms, even though last frame of standup should transition smoothly to idle.
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: odnorf on July 23, 2008, 10:31:44 PM
Mnemonic (master Yoda? that's something I hear for the first time ;D ;D) has already said it's fixed for the next version. For now I think that 1.8.7 test version also has this bug fixed if you want to test it.
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: Dionysius on July 24, 2008, 03:08:32 AM
For now I think that 1.8.7 test version also has this bug fixed if you want to test it.
Are you talk about this http://dead-code.org/download/wme_test_widescreen.zip ?
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: rkitting on July 24, 2008, 04:38:44 PM
Sure I'll be willing to test it asap :)
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: cremen on December 28, 2008, 07:20:26 PM
WME 1.8.009 bug still present...
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: cremen on December 28, 2008, 07:37:03 PM
sorry, more info:
Actors are 3d (*.x-files)

and some code:
Code: [Select]
albina = Game.LoadActor3D( "actors\albina\albina.act3d" ); // mesh = albina.x
albina.MergeAnims( "actors\female\albinas_special.X" );
albina.IdleAnimName = "read";
so bug still present.
but, if this animation is in original albina.x file and named as "Idle", then no bug
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: Mnemonic on December 28, 2008, 11:17:50 PM
As far as I can tell, this bug is fixed and it doesn't matter if the animation is in a merged X file or not.
Can you provide a project (with sources) showing some faulty behavior?
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: cremen on December 29, 2008, 07:15:19 AM
ok, this is some sources (with some loading errors)
(sources and compiled package is some dirty archive)

points of interests: scenes\albina\scr\scene_init.script, see the comments

albina.IdleAnimName <- bug here
albina.SetAnimTransitionTime <- some tryouts to fix, but not working.

http://pinktown.ru/public/animbug.zip (http://pinktown.ru/public/animbug.zip) 2.8 mb (becouse contain compiled packages)
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: cremen on December 29, 2008, 07:22:02 AM
This animation are played successfully in DirectX SDK viewer. (loop without any artefacts)

P.S. In Brume C# Engine too.
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: Mnemonic on December 29, 2008, 09:32:44 AM
It's not a bug. The problem is the engine doesn't know the reading animation should loop and keeps restarting it all the time.
You need to add a definition file which adds more animation properties. Normally this is done in the .act3D file (like you did), however for merged animations each .X file must be coupled with a definition file.

Simply put, create a new text file called "stand_n_read.anim" where your stand_n_read.x is located and the file will contain the following:

Code: [Select]
ANIMATION
{
  NAME="read"
  LOOPING=TRUE
}

That will fix the problem.
Title: Re: PlayAnim() bug. When the first and the last frames are different
Post by: cremen on December 29, 2008, 09:58:07 AM
ok, it fix helped.

thanks for your time.