Hello,
It's a bit difficult for me to speak to the exact code inside of Reforged, because Brad Chan only gave us the debug symbols and not the exact original source code thus far, but I was able to test this same map file on my rewrite of Warcraft 3 that was made using Ghostwolf's render engine (Basically like "view in 3d" from hive, but applied to entire maps). And what I found was that:
- The same issue is happening in our open source remake of the render engine
- I can turn off the issue by removing the animation blend
So we can see the following:
Before I modified the game itself and recompiled it not to do blend time:
After I modified the game itself and recompiled it not to do blend time:
We can see this totally fixes your issue. The problem line of code is right here:
An emulation engine to improve Warcraft III modding - Retera/WarsmashModEngine
github.com
But I know that if you click on that code to review what's happening, that might be some gobbletygook if you're not a programmer.
The way to think about it is this: the game engine does
two interpolations on the location of the bone, not one. Usually we think about "
Translation" timelines with different keyframes in space, and how there is a setting
Linear or
DontInterp that exists here. But these settings refer to
interpolation between frames of the same animation sequence. So for example, if we use
DontInterp mode, then if Stand is playing from time 1000 to 2000 but our
Translation has a keyframe at time 1500, then this
DontInterp mode will turn off linear interpolation from time 1000 to time 1500. And this would cause our object to "jump" instantaneously as you expect.
But the interpolation you are seeing is a different piece of code. This is an interpolation from
Attack One - 1
to
Attack One - 2
. The rules for interpolating
between animation sequences are totally different. These rules do not exist in the "View in 3D" preview pipeline of Hive Workshop, and they do not exist in Ghostwolf's code, and so when I was making my own game client to mimic Warcraft III there was a time when eventually I had to reinvent these rules in my own way to do smoothing between animations, so that my mimic of the game experience would look similar to the original. Before I added the
special interpolation between animations, my code
looked terrible as a game experience. Every time a unit would start and stop walking, he would jitter visually and teleport between animations.
Unfortunately, the computer algorithm that I invented to smooth the animation position between two different animations does not actually match Warcraft III. Nobody that has ever seen me playing my rewrite of the game has ever commented on this, I think, because of how extremely difficult it is to notice that my code does not exactly match Blizzard's code. If you spend a lot of time looking at Walk animations on Warcraft III, you may notice that as units start and stop the walking they do not really exactly play the animation as given. There's some mathematics at play there in going from Stand to Walk that make them a bit more lifelike. My general impression is that they compute where the unit's Bone/Helper node is located by performing some type of sum between
where it was and
where it should be if we were not "blending" animations in this way. Or maybe I have that backwards and that's what my code does, looking back at it. But I think the other of the two algorithms -- the reason mine does not match -- is that you could imagine getting a similar (but different) result by actually running and playing two animations together at the same time until the "previous" one finishes. So you can tell, even while I'm describing this, I had it flipped in my head about how and why my hack-job mimic client doesn't match, and had to go back and check. The mathematics behind this are sufficiently complicated that I doubt anybody working on Warcraft III's code has bothered to even consider how it works for many, many years. There was a video around the days of Reforged Beta of Grubby or someone testing the Night Elves in the new Reforged graphics at the time, and the Ancient of Wonders explodes and forms onto the screen from all of his arms and legs sucking in from across the map. This was probably the same interpolator code, but making the mistake of interpolating from a bad "previous" animation data.
Despite my efforts to mimic this code being a different attempt to do the same thing, I fall into the same pitfall and it makes your model look bad on my code too. When we write the code for this game, the reasonable effort solution to "animation blending" is to blend nodes regardless of their Translation timeline's interpolation type (regardless of DontInterp). You could, in theory, probably, construct a version of the game that did not have this problem. However, I looked at my code for 5 minutes and decided
I don't even want to try to fix that in my remake, because it's not a guarantee that every node "blending" between animations has a Translation timeline, and the variable scoping is extremely optimized in the code I copied from Ghostwolf and so it's all wrong to make this change. There can be 5 copies of the unit in the world and they all read from 1 shared timeline variable for the model for that helper, so there's a divide between "model" and "model instance" and as it would happen the general concept of the 3D "skeletal" node (referring to animation skeleton software, not "undead" artwork) is scoped in such a way that calculations push location information onto it, but it doesn't have access to do a pointer read from the container with the timelines.
Maybe that sounds like a foreign language, but what I guess I'm saying is that
I don't think Brad Chan will fix this on Reforged, in much the same way that Reign of Chaos and Frozen Throne always had this problem. So, with that in mind, you have to make a choice:
- Go to Object Editor, click on Units, click on your guy, and change Art - Animation - Blend Time (seconds)
to a smaller value to effectively turn it off for that unit type!
- Go to your model file, and construct it in a different way so that it will not have this problem (maybe two independent and non-moving particle emitters)
Note that if you change the
Art - Animation - Blend Time (seconds)
setting and turn off the blending for that unit type, then the model can potentially have issues when changing between Stand and Walk animation, and may appear to "jitter" due to the instant teleportation between the middle of one sequence, and the start of another. Also, I have some recollection that if you set this Unit Editor setting to the value 0, then it may load a default value instead of truly "off," so you might want to try 0.0001 instead of 0.0. However, I am on a non-Windows computer that only has my open source rewrite of the game and not the original, and as a result I do not have access to the World Editor presently, so i did not bother to test myself if this theory is correct.