Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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:

  • All floor tiles are 64x64.

  • Floor tiles are world aligned.

  • Each frame in the animated tile is stored as a separate texture.

  • Each tic in the doom engine corresponds to 1/35 secs, and each frame of animation for the tile lasts a multiple of Heretic's tic rate.

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:

  • Main material: http://i.imgur.com/Div4bvH.png

  • Material function - MF_GameticToTime: http://i.imgur.com/dvnPSA5.png

  • Material function - MF_FlatBase: http://i.imgur.com/d0JGkzI.png

  • Material function - MF_FlatAnimatedLogic: http://i.imgur.com/bSwHF8I.png


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 :("

Product Version: UE 4.8
more ▼

asked Aug 11 '15 at 10:46 PM in Using UE4

avatar image

20 6 4 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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:

  • A>=B plugged to 1

  • A==B plugged to 0

  • A < B plugged to 0

I apologize for wasting your time on such a longwinded question for what was basically putting the wrong foot in the wrong shoe. :p

more ▼

answered Aug 12 '15 at 12:24 PM

avatar image

20 6 4 9

avatar image buscas31 Aug 12 '15 at 02:49 PM

Don´t worry my friend, it´s happen to everybody! =D

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question