Announcement

Collapse
No announcement yet.

Blueprint best practices for performance?

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

    Blueprint best practices for performance?

    Hello all,

    I've been wondering about this as well as searching for answers but haven't found any, so letme share it.

    Does anyone know if there are any best pratices for blueprints? In the sense of getting more performance out of it?

    I'm aware that blueprints only have 10% of C++ speed, but how can we get more out of it or at least make it less slower?

    Do you have a rule of thumb or trial and error to see how your code performs? Please do share.

    #2
    Do you have a running project made with blueprints ? Is it slow ?
    It cane be several factors affecting game speed like graphic effects, you can't put all blame on Blueprint and i'm not sure this 10% number is accurate.

    Comment


      #3
      Originally posted by Galeon View Post
      Do you have a running project made with blueprints ? Is it slow ?
      It cane be several factors affecting game speed like graphic effects, you can't put all blame on Blueprint and i'm not sure this 10% number is accurate.
      I developing a mobile games for now. Haven't builded it and play tested it on smartphone yet. I'm woried about smartphones processor not being able to handle my project for being made in blueprint.



      Originally posted by Jamendxman3
      I try and avoid casts wherever possible (I never cast every frame), I make lots of customizations to engine macros so that I can do things to the macro rather then doing them outside of it (and possibly multiple times). In all honesty, 10% of C++ speed is actually extremely fast when you consider how powerful modern computers are, and I've done programming in AS3 which has been said to be 1000x slower than C++, so it's a big step up for me, but I have been doing computer programming for 3 years so I am confident in my ability to optimize my code.
      The idea is to see where people have founds issues that slowed down performance and offer as guidelines to new comers. It would be very handy to everyone i believe.

      Comment


        #4
        That ten times slower figure came from a live stream about blueprints, but what they really meant was if you have lots of complex math going on, then you get the worst case scenario of 10x slower. The reason why it is slower is because blueprints runs on a virtual machine, and some nodes require a call to its native c++ code.

        Delegates, castes, and interfaces are your most expensive. So just limit those. Simplify your code, and you should be fine.

        Comment


          #5
          The most expensive thing so far would be an unmitigated event tick. That is noticeable right away.
          - Russell Meakim AKA The Castle
          BLOG: https://steemit.com/@thecastle

          Comment


            #6
            Originally posted by _cDub View Post
            That ten times slower figure came from a live stream about blueprints, but what they really meant was if you have lots of complex math going on, then you get the worst case scenario of 10x slower. The reason why it is slower is because blueprints runs on a virtual machine, and some nodes require a call to its native c++ code.

            Delegates, castes, and interfaces are your most expensive. So just limit those. Simplify your code, and you should be fine.
            My thinking was that math would be 100% as fast as C++ considering that math is pretty direct.
            Marketplace Assets

            Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
            Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
            Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

            Comment


              #7
              In the stream they didn't really say what they meant by math, just that a lot of complex math is what bogs blueprint down. I would imagine that the basic operators would be something that wouldn't be any problem. Maybe they were talking about doing a lot of stuff in general.

              Comment


                #8
                Originally posted by _cDub View Post
                That ten times slower figure came from a live stream about blueprints, but what they really meant was if you have lots of complex math going on, then you get the worst case scenario of 10x slower. The reason why it is slower is because blueprints runs on a virtual machine, and some nodes require a call to its native c++ code.

                Delegates, castes, and interfaces are your most expensive. So just limit those. Simplify your code, and you should be fine.
                Alright, so if that's the case. Should Event dispatchers be used in place of BPIs wherever possible?

                I am actually still trying to wrap my head around Event Dispatch use versus Blueprint Interface use.

                (sorry for the slight derail)
                Website/Portfolio: http://www.VictorBurgosGames.com

                Join me on stream: https://www.twitch.tv/BurgosGames for UE4 Game Dev. If you need help, just stop by and ask!

                Wishlist Neko Ghost, Jump! a 2D/3D Puzzle-Platformer : https://store.steampowered.com/app/1...ko_Ghost_Jump/

                Comment


                  #9
                  Hi all,

                  i really got to jump in now that i hear quite often that casting in Blueprints is a performance killer; which is simply wrong.

                  See https://forums.unrealengine.com/show...ting-expensive: It mostly compares Casting vs. Implements Interface checks, but you also get raw numbers. i.e. that one cast costs around 0.4 microseconds. And with looping 10k casts, you still are at 86ms per frame. Of course this is really much, but if you think about it, if you really need to loop even through 1000 objects each frame, you did something terribly wrong, no matter if you are in blueprints or in c++ code.

                  Cheers,
                  Indy
                  FinalCamera on Marketplace / Web Demo
                  TopDown Toolkit on Marketplace / Web Demo

                  Comment


                    #10
                    https://forums.unrealengine.com/show...ation-May-19th

                    If I remember correctly from that stream, they mention how blueprint exists on another layer from C++ and every time it runs a node it must go from one layer to another(C++ back to blueprint, and so forth). So basically, if you can perform an action in 3 nodes instead of 6, even if the same amount of stuff is going on among them, then you will be better off.

                    Another piece of advice would be to use structs to combine data into chunks. Many times you are going to want to pull several bits of data at once and compare them. If you can pull 1 struct and get many bits of data, you are saving a lot of time, especially if this keeps your array checks down to a minimum.

                    Lastly, I would say that if you have any functions that you use a lot or take up lots of performance, see if you can find away to turn that into a single blueprint node with C++.
                    Map Generator 1.0
                    Map Generator 2.0
                    Map Generator 3.0

                    Comment


                      #11
                      Originally posted by indygoof View Post
                      Hi all,

                      i really got to jump in now that i hear quite often that casting in Blueprints is a performance killer; which is simply wrong.

                      See https://forums.unrealengine.com/show...ting-expensive: It mostly compares Casting vs. Implements Interface checks, but you also get raw numbers. i.e. that one cast costs around 0.4 microseconds. And with looping 10k casts, you still are at 86ms per frame. Of course this is really much, but if you think about it, if you really need to loop even through 1000 objects each frame, you did something terribly wrong, no matter if you are in blueprints or in c++ code.

                      Cheers,
                      Indy
                      Well I do not assume casts to be expensive based on what I've heard, but personal experience, while looking at a graph, my FPS jumps when casting, or at least it did in one of my projects.
                      Marketplace Assets

                      Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
                      Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
                      Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

                      Comment


                        #12
                        Originally posted by Castle View Post
                        The most expensive thing so far would be an unmitigated event tick. That is noticeable right away.
                        Excuse my ignorance, but what do you mean when you say unmitigated event tick?

                        Comment


                          #13
                          Originally posted by LuLima View Post
                          Excuse my ignorance, but what do you mean when you say unmitigated event tick?
                          Having multiple things running On Event Tick.

                          So pretty much every frame that blueprint is running. You don't want that. Maybe leave it for some Hero assets/functions. Or if you want it to do it for a certain part of the game, use Set Tick Enable/Disables.
                          Website/Portfolio: http://www.VictorBurgosGames.com

                          Join me on stream: https://www.twitch.tv/BurgosGames for UE4 Game Dev. If you need help, just stop by and ask!

                          Wishlist Neko Ghost, Jump! a 2D/3D Puzzle-Platformer : https://store.steampowered.com/app/1...ko_Ghost_Jump/

                          Comment


                            #14
                            Originally posted by LuLima View Post
                            Excuse my ignorance, but what do you mean when you say unmitigated event tick?
                            If you place a delay node directly after an event tick it slows down the number of ticks to what the delay currently is. So a delay of 0.1 will have a big improvement over attempting to tick every single frame.
                            - Russell Meakim AKA The Castle
                            BLOG: https://steemit.com/@thecastle

                            Comment


                              #15
                              Originally posted by Castle View Post
                              If you place a delay node directly after an event tick it slows down the number of ticks to what the delay currently is. So a delay of 0.1 will have a big improvement over attempting to tick every single frame.
                              If you mean less logic on the event tick only for necessary situation wouldn't it be better to use a branch node and lock of parts of the code for certain situations?

                              Comment

                              Working...
                              X