Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Is there a way to get the "native" animation speed of a .X file?

Author
Message
Miguel Melo
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 22nd Aug 2005 11:52
While learning the ropes in dgskd, I was looking through the code for Dark Dungeon for the animation of the baddies and came across the somewhat strange

dbSetObjectSpeed( baddieIdx, 20000 );

line that contains the magic number "20000". I had noticed that the baddies in the demo animate a bit too fast so I loaded their .X files into dxsdk's mesh viewer. It turns out that in that viewer they play at the "perfect" speed, without me needing to specify any speed. This must mean that the .X file must have some sort of "native keyframe speed".

In Dark sdk, however, if I just load the .X file and do not set object speed for these files - it appears to default to 100 - the animation plays _incredibly_ slow (i.e. you can't even notice it animating). The documentation for this func indicates that the values passed should be between 1 and 100, so I half-expected the .X loader to "calibrate" the object saved speed so that the range 1-100 would be sensible for 99% of the meshes. Either that or, there should exist a some sort of funcion like dbNativeObjectSpeed() for the developer to work from.

Is this speed issue a bug in the loading (i.e. calibration should exist, but doesn't) or do you agree that we could use a "get native keyframe animation speed" function?

Thx,

Miguel
MiR
21
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 22nd Aug 2005 13:09
I don`t think the directx mesh viewer knows the right speed is as I`ve tested a model from DbPro and it runs too fast. It`s probably just a case of a having a better default value than DGSDK.


Gimme teh votez!!!!
Miguel Melo
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 22nd Aug 2005 15:27
Hmmm... If you load the Bezerker.x file into DXSDK's Mesh viewer and save it out as Text .X file you'll be able to look at it with a text editor. If you do that you will see a section with the following

AnimTicksPerSecond {
4800;
}

I suspect this is it, meaning that the .X files do support this feature.

What is probably happenning is that some content creation tools may not save this out so in that case we're hosed. But if it is there then we should be able to use it.
AlbertoT
19
Years of Service
User Offline
Joined: 16th Aug 2005
Location:
Posted: 23rd Aug 2005 21:24
it appears to default to 100 - the animation plays _incredibly_ slow

The same happened to me.
I loaded into DarkBasic SDK some .x files which I exported from CharacterFX.
I must set animation speed at 10.000 to get a normal normal animation.
Also the number of frames does not match the real one.
I created the animation with 36 frames and 5 key frames but DarkBasic SDK return a very high number of frames.
If I load the same file in Blitz3dD no problems
So I suspect it is a bug.

Alberto

Login to post a reply

Server time is: 2024-11-19 01:40:21
Your offset time is: 2024-11-19 01:40:21