Timing problem with "animated" material
I have some issues getting an "animated" material working.
First, a little background on what I am trying to achieve here. As a learning process I am trying to emulate behaviours from an older game engine, more specifically the good old game Heretic (which in turn was built upon the classic Doom engine). What I am trying to do in this case is to replicate an animated floor tile. To quickly summarize:
I could probably achieve a lot of this by using more "modern" techniques (like FlipBooks). However, in the interest of learning, I'm trying to do as little editing as possible of the source material and more closely emulating the older methods.
I have set up a material (with parameters), and a three material functions in order to take care of the necessary behaviour. The current material is set to play three frames, each playing for 8 "gametics" (that is 1/35 sec multiplied by 8). To do this I have used a MatLayerBlend_TenLayerBlend, with each frame as a separate layer, using the layer mask to show or hide material based on a calculation with a Time node.
Ideally, frame A start playing when time is 0, frame B should start playing when time is approx 0.2286 (1/35 sec * 8) and frame C should start playing at 0.4571 (1/35 sec * 16) and should loop again after time has reached 0.6857 (1/35 sec * 24). However, what happens is that frame A shows briefly, then it skips straight to frame C.
Could anyone point me to what I've done wrong with my material? I'm sure it's just a silly, simple error, but I can not for the life of me track it down.
Pictures of the material and material functions:
The "Error" in the Material Attributes of MF_FlatBase is because I haven't assigned a Preview texture to it, but the material function itself works as it should. The error should, as far as I can see, have no actual bearing on the main issue.
For those interested, the comment for the Time node in the main material that is cut off in the image is supposed to read: "Hardcoded time (24 gametics) as you can't convert period to parameter :("
Found the answer. *sigh* A simple matter of having stared at the screen for too long.
All I had to do was edit MF_FlatAnimatedLogic:
I apologize for wasting your time on such a longwinded question for what was basically putting the wrong foot in the wrong shoe. :p
Follow this question
Once you sign in you will be able to subscribe for any updates here