• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

About the dummy.mdl

Status
Not open for further replies.

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
I have a few questions about the dummy.mdl.
I don't have any knowledge about modelling.


Why are there 180 rotations but 181 sequences? I guess it is used for looping but the dummy.mdl doesn't loop.

Why are InTan and OutTan the same?

How are (certain) tangents computed? Most of the time it's for the current angle α simply: quat (0, 1, 0) (α-1), so one degree less rotated. But not always. Is there a system to it?

Why is the interpolation hermite at all? I've read somewhere that rotatios are best hermite but i have generated my own model and simply tried linear (or none? i haven't supplied any tangents) and it seems to work just fine.

Why does the interval start at 300? Can it be less?
Why in steps of (1/3)? Can it be less?


Now i already said that i generated my own model. The plan was to generate a dummy model which can be turned both around the x- and y-axis.

In my tests it seems like the number in the Interval-block and/or the number which represents the rotation cannot be greater than ~16000. Is this correct or did i just made an error somewhere? I *think* the specs says such number is a dword (4byte) which ofcourse shouldn't by limited by 16000.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I don't remember how dummy.mdl works, but hermite interpolation allows you to define tangents to make an animation speed curve.

For example, let's say you want a character to look from side to side by rotating its neck bone.
With linear interpolation, each frame the neck will rotate the same degrees, which ends up looking very robotic.
With curves (bezier, hermite), you can make it match reality better, by, let's say, starting to rotate slowly, speeding up, and then slowing down again towards the end of rotation.

Tangents are not computed, but rather manually made by the artist in a 3D modeling software like 3ds Max (although not with numbers, but rather with visual curves).
See the following image from BlinkBoy's animation tutorial - the curve defines the animation speed at every frame, and the things he's moving are the tangents.

51917-depth-animation-tutorial-3ds-max-curve-editor2.gif



In the case of the dummy, I doubt this benefits you in any way, and it should indeed use linear interpolation (or no interpolation at all, but I don't remember how its frames look).

The frame in which a sequence's interval starts is meaningless, you can change it to whatever you want, as long as all of the keyframes are changed as well, which is a pain to do since no tool allows to move sequences with their keyframes automatically (I was asked to make one in the past, but never did, oops!)

It's not very clear what you mean in the last paragraph. There is no need to rotate something more than 360 degrees.
Regardless, the frames are held in a signed 4 byte integer, and the rotations are held in a 4 IEEE754 single precision float quaternion (less words: int: float[4]).
 
Last edited:

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
Yes, it doesn't seem to depent on the interval number but i still can't get my model to work with too many rotations.
Here is the code i use.
What i want to do is to generate all these rotations:
quat (1, 0, 0) α ∘ quat (0, 1, 0) β ∀ (α, β) ∈ [0° .. 180°]²

If you look at the interval it works with a step-size of 15, crashes my wc3 with a step-size of 12 and only works partially with a step-size of 11.

I might just generate the mdl file wrong, or maybe the conversion to mdx fucks something up?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
I think there was some engine limit to the amount of sequences a model can have. Regardless, I don't have Make or Haskell and am too lazy to get them. :)

By the way, does it actually work with a negative frame? I know I said it's signed, because I saw a model that had a negative frame while working on the viewer, but I don't think I ever tested it in-game to see that it actually works.
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
I think there was some engine limit to the amount of sequences a model can have. Regardless, I don't have Make or Haskell and am too lazy to get them. :)

By the way, does it actually work with a negative frame? I know I said it's signed, because I saw a model that had a negative frame while working on the viewer, but I don't think I ever tested it in-game to see that it actually works.

The general model structure is defined in template.erb.
Is there a way to have more than that limit of rotations, maybe by splitting up all the rotations into different helpers?
Also the limit must be rather small then; like around ~200 rotations.
I could very well upload the broken 11 step-size model if wanted.
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
Again, it's not clear to me what you mean.
Limit to what rotations? do you mean sequences? keyframes? quaternion values?

Uploading the model will probably be good.

Being able to set both roll and pitch via SetUnitAnimationByIndex.
The attached map has a demo of such a model. But the rotations are not fine enough (only in 13° steps).
Again, if i lower the step-size the model wont work.
I also attached the raw mdl.
 

Attachments

  • new-dummy.mdl
    33.6 KB · Views: 89
  • new-dummy.w3x
    27.8 KB · Views: 88
Level 29
Joined
Jul 29, 2007
Messages
5,174
Yes, that's the sequences. There is a limit on them, I have no idea what it is.

Something you could do is split the rotations to two dummies, and attach them in the editor.
In fact, you can just use the original dummy, and use the normal facing functions for the second one, that gives you all axes.
 
Level 23
Joined
Jan 1, 2009
Messages
1,610
Something you could do is split the rotations to two dummies, and attach them in the editor.
In fact, you can just use the original dummy, and use the normal facing functions for the second one, that gives you all axes.

Elaborate? I'm not sure what you mean by attach. You cannot attach one unit to another afaik, only effects of which you can't set any rotation.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Any orientation can be expressed with two axes (rotation was the wrong word).

You'd usually not need roll for anything in games, unless you are making a flight simulator.

If you do need it, and since you can't attach units and can't control special effects...well, I guess that's that.

All of the wall-banging and frustration to allow attachments to be generic in the viewer, and it's not even allowed in the game :( (oh well, the real mess is because WC3 and SC2 models are in different coordinate systems...)
 

Attachments

  • base-attachments.png
    base-attachments.png
    56.2 KB · Views: 76
Last edited:
Level 23
Joined
Jan 1, 2009
Messages
1,610
You'd usually not need roll for anything in games, unless you are making a flight simulator.

Just because you don't need it, doesn't mean it's not useful. I can think of plenty of uses.
Some can probably be achieved via editing the model, but it's nowhere as easy as one line of code to roll any model dynamically.

Also lep stated in his OP that this was the point of him generating the model.

Now the question is, can we circumvent this somehow?
I think having different bones/helpers at different rotations might work, but would require recreating the effect or other tricks when rotating.
What about timescale in code? It stops the animation. Could we take the model with 13° steps, interpolate them over a long time and then jump to the correct position with
jassdoc/unit.j at 8b2b716fb7b86aec7adbd78a672a7bb483404c23 · lep/jassdoc · GitHub
? But I guess this then freezes the animation of the attachment also?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
If you can use it in a deterministic manner (= always be able to run code one frame later), then yeah, you could get far better accuracy than 13 degrees (about 360/255-ish on one axis, and any accuracy on the second axis).
But can you? I have no clue.
This also becomes a lot more involved than just setting the sequence, you'd need a timer running for each time you want to change the rotation, and it becomes an asynchronous action.

I can't think of any other way, WC3 is very limited in this regard. Not that I can call myself a WC3 guru or anything, I didn't even know about that function, or whether it works.
 
Status
Not open for further replies.
Top