Announcement

Collapse
No announcement yet.

Creating "useless" variables to aesthetically improve BPs - acceptable?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Creating "useless" variables to aesthetically improve BPs - acceptable?

    I'm wondering if it's acceptable to create variables in order to clean up BPs and make them appear neater, which would make them more easily navigable and improve readability.

    Here is an example where I create 3 "useless" (technically unneeded) local variables to improve neatness, before and after:

    Click image for larger version

Name:	1.png
Views:	1
Size:	60.7 KB
ID:	1154545

    Click image for larger version

Name:	2.png
Views:	1
Size:	57.6 KB
ID:	1154546

    Should I do this? Does it affect performance? Bad standards?

    #2
    It's mostly fine if they're local variables (since they'll be destroyed after the function is over) but I'd really recommend against using more memory in the game just to improve the experience in the editor. Now that reroutes can be created with a double-click, I feel like you can get great readable results by just liberally applying them all over. Ultimately it's up to you, but variables are not free. As long as you're aware of the extra memory being constantly loaded and unloaded you can do as you please
    Procedural, modular, on-the-fly animation - iTween For UE4
    - Actors - Components - UMG - Ease In - Ease Out - Path-constrained Animation - $0

    Runtime Datatable
    -All the fun of DataTables dynamically loaded from text or Google Sheets while your game is running!

    Comment


      #3
      Personally I prefer this method too since you may want to use those variables elsewhere later on so it's better practice to have them as a variable rather than calling them directly.

      As far as performance goes I can't really see it having any affect on it unless you have 10s of thousands of them.

      Comment


        #4
        Seems like a double edged sword..

        On one hand, of course I'd like to use the least amount of memory possible, but on the other, I may release what I'm working on and I'd like people to be able to easily follow along.. I'll probably only do this is even with reroute nodes it's still a tangled mess.

        Thanks for the replies !

        Comment


          #5
          Double-click to Reroute has become my standard. I do it automatically when I'm cleaning things up, it just makes things look nicer. Throw in a Comment box, drop a Reroute at the edge of the box and you have a nice flow to your lines.

          Variables take up the memory, that is true, but like ZoltanJr stated you would have to use 10s of thousands of them to notice any real performance issues due to excessive variables.

          It all comes down to personal preference, what you think looks best to you. Personally, I do both.

          Comment

          Working...
          X