Weapon DED & Weapon bob
Hello,
In need of a little assistance.
I have just been setting up a DED file for a new in game pistol model. Everything is set up exactly how I want it and works well.
The weapon idle state needs 4 frames due to a flashing light. Its basically set up so the state 'PISTOL' move onto another 3 states and back again. one of the sub models has a texture change over these states to create a flashing light. This works fine in game and does as it should.
However, the anomaly is when doomguy moves about the automatic weapon bobbing is jerky.
After some messing about it is indeed caused by the extra frames or longer tick count. For instance the animation may run over 4 ticks (1 tick a frame). I could just have 1 frame, but at 4 ticks which results in the same problem.
Im guessing the weapon bobbing only uses 1 frame (orignal default). So it effectifly only updates the weapon sway each time frame 1 or the original state name is reached. Whatever the reason, is there anything I can do to fix this behaviour such as increasing the frames the weapon bob processes?
If this can not be fixed would an animated texture work rather then changing it manually over set frames/states? Not sure if the engine supports this on models. Something like the way nukage is animated?
Thanking anyone in advance for any help.
In need of a little assistance.
I have just been setting up a DED file for a new in game pistol model. Everything is set up exactly how I want it and works well.
The weapon idle state needs 4 frames due to a flashing light. Its basically set up so the state 'PISTOL' move onto another 3 states and back again. one of the sub models has a texture change over these states to create a flashing light. This works fine in game and does as it should.
However, the anomaly is when doomguy moves about the automatic weapon bobbing is jerky.
After some messing about it is indeed caused by the extra frames or longer tick count. For instance the animation may run over 4 ticks (1 tick a frame). I could just have 1 frame, but at 4 ticks which results in the same problem.
Im guessing the weapon bobbing only uses 1 frame (orignal default). So it effectifly only updates the weapon sway each time frame 1 or the original state name is reached. Whatever the reason, is there anything I can do to fix this behaviour such as increasing the frames the weapon bob processes?
If this can not be fixed would an animated texture work rather then changing it manually over set frames/states? Not sure if the engine supports this on models. Something like the way nukage is animated?
Thanking anyone in advance for any help.
Comments
In this example the Skin tics and Skin range change the texture of the pistol_light.dmd every 4 tics. The worldtime flag makes it possible to have long model animation sequences in 1 tic thing states. Inter controls the position of the frames in the animation and Interpolate controls the length. The second value in the Interpolate is some offset (but I have never used it, so I don't really know what it does).
Also you may want to check the wiki about model definitions: http://dengine.net/dew/index.php?title=Model
I think I understand how this works, used 'Inter' before and stuff.
However, slightly confused how the 4 textures are displayed in sequence. First of all I presume they are assigned to the MD2 model it self such as using the MD2 tool.
It looks like in this bit texture 1 is displayed for 10.0 (As defined in Interpolate)
Then moving onto this bit, the next texture is displayed because of 'Inter = 0.5' and again for 10.0 by interpolate.
So what about the 2nd and 3rd texture, Im guessing thats what 'Skin tics' does, but bit confused how that effects things. Should there not be another 2 model sequences that just increase the 'Inter' count and specify length with 'Interpolate' ?
Finally, can I specify the skin file name to use, or must it be defined on the model by MD2 tool ?
Sorry for all the questions, im slowly learning all this stuff.
If your model only has 1 idle/ready frame, then you only need the Skin Tics and Skin Range. But if you have more than 1, then it's useful to use the Worldtime flag. I only used 2 frames in the example, so that it wouldn't get overly long.
Yea, it's a good idea to assign the textures/skins to MD2 or DMD file.
I pretty much understood this, and has solved the main issue of the weapon bob being jerky with more then 1 tick worth of animation.
However, in my experiments one thing does not seem to be working.
Say I use MD2 tool and add 4 skins to my lights sub model, 0,1,2,3. I use the following code and change the 'Skin tics' to set how fast I want to textures cycle.
This is no problem and works a treat.
So say I want to be awkward and have texture 1 stay on longer as thats when the light is on full bright. Then cycle through the other three textures faster. I cant use this method as I can only set 1 speed for them all.
So instead I use this code
This also works, but only changing the first 'Interpolate' seems to make a difference, effecting all sub states. Changing the values on a sub state such as in my example 'Interpolate = {3.0 0.0}; makes no difference. So im left with only changing the overall speed of all the lights and not individual speeds ?
Not sure if I am missing something here?
Also, im still a little confused what the flag 'worldtime' actually does. When not used things speed up dramatically, so I presume the 'Interpolate' is ignored?
Anyway, any thoughts would be appreciated. This has been so much help so far, so thanks. Really appreciate it.
Still having one small issue though thats abit annoying.
Is there a way to make the animation start again from the beginning ? For instance I use the code suggested
During Frames 'ready_01' and 'ready_02' the weapon is moved up and down a little and looks like Doomguy is breathing. When the gun is fired, it goes through its stuff and ends up in a position exactly like 'ready_01'. The engine now goes into 'PISTOL' state. However, it seems like the 'breathing' effect has continued to be processed and so rather then starting at Frame 'Ready_01' it may have animated through to Frame 'ready_02' which results in the animation having a jerk straight to that position after firing.
If the animation started from the beginning as soon the state 'PISTOL' is processed then there would be no jerky movement. The Flag 'worldtime' effects this but must be used to be able to animate over one state.
Hope that made sense lol
Any help appreciated
I thought this may have been the case, but its always good to ask just in case.
Still I have learned lots here and overall the main problem I had has been solved.
Thanks for all those above.