Download

Best practice for Tick alternatives? and more performance things

Hello,

I’m new to UE4 in general and loving it so far. I have some optimization related questions with Blueprint, that I couldn’t get solid or recent answers for through searching. I’d like answers related to the efficiency, if possible. I know all about falling into the trap of pre-optimization, but I feel this particular area (tick and alternatives) is a good place to worry about such.

Say I want to run something every frame (yes every frame, not every other frame), but only when holding a key. Is it better (more efficient) to use

-looping timeline from 0-1, start on key down, stop on key up
-looping timer set to 1/target framerate time, resumed on key down, paused on key up
-tick itself, with a branch to check if the key is down or not

I imagine the 3rd option is the worst performing, since that branch is evaluated every tick. Personally I think the 2nd option seems best, since option 1 (timelines) have many other functions built into them, but I’m not sure. Any options I missed?

Some other stuff:

-I saw the thread about blueprint operators not using short-circuit evaluation. Is this planned to be added soon? It’s quite a huge issue in my opinion, nearly every language (and even most 2d gamedev programs) has this feature. A boolean for turning SCE on or off would be great. Is it possible to make custom nodes that work with SCE somehow? Has anyone done this if so?
-how accurate is this video about optimizing math in BPs? https://www.youtube.com/watch?v=Hs_MXF2BykQ I’d like to get in the habit of doing math correctly early on, because I already know I will be doing large operations sometimes.
-since short-circuit evaluation is absent, is it best to use a switch on enum with 20 enums, or 20 branches, even if that will be visually cluttering? Especially if, heaven forbid, this might be done on tick or similar?
-are “math” custom expression nodes horrendously slow?
-I am usually function-happy, and intend to use quite a bit, for everything. Is the impact of calling functions heavy, or is it relatively similar to how heavy they are in C++?
-is object-pooling with actual projectile weapon bullets common practice? is this something I should remember to do? My college class about Unity told me to do this. Most youtube tutorials tell me to spawn bullet actors on fire event.
-any documentation or tutorials about converting BP to C++, if I want to refactor down the line?

Thank you for reading.