No announcement yet.

Penalty for using functions to make blueprints easier to follow

  • Filter
  • Time
  • Show
Clear All
new posts

    Penalty for using functions to make blueprints easier to follow

    To achieve the effects I want in the HUD (and other places), I find I am reusing all or most of the variables.

    This can become visually messy and hard to follow. But if I put content into functions and link input to Return Node. I can daisy-chain these functions, which simplifies the main blueprints, making them easier to follow and trouble-shoot. This is especially important if I change the variable values for subsequent use.

    Before I commit to the function approach, I'd like an idea of the performance penalty.

    For example, I need to redraw some textures:

    I am reusing OffsetX, OffsetY and Scale. But if I put the DrawTexture into a function, the function is messy (but understandable) and the main blueprint is clean and easy to follow.

    Does anyone have an idea of the performance penalty for this approach?

    Click image for larger version

Name:	Function3.jpg
Views:	12
Size:	113.7 KB
ID:	1400972Click image for larger version

Name:	Function2.jpg
Views:	10
Size:	116.8 KB
ID:	1400973
    Attached Files
    The universe can be a cruel place, but sometimes it does provide what you need, when you need it, but most importantly, you must be open to it.

    Performance penalty, in BP execution terms? Negligible if compiled probably... But not a fan of your approach at all...
    In daisy chaining, you've simplified wire layouts perhaps. But at the costly expense of readability / maintainability etc...
    These aren't worthwhile functions especially. They're not reusable / don't offer generality, and even have hard-coding.

    Functions work better when every parameter into Draw-Texture is supplied as an input. Why not use more variables?

    This just feels overcomplicated / hard to maintain without bringing tangible benefits. Look Instead to sample projects...
    Keep related Draw-Texture nodes together in the same Graph, and encapsulate detailed calc work into functions etc.
    Only put code into functions if the functions are general purpose and bring added flexibility to overall Blueprint design...
    What are the BEST Unreal Tutorials / Docs? There are none tbh... Here's why
    Instead its better to just take projects apart (see the free 'creators' listed here)