Announcement

Collapse
No announcement yet.

Blueprint best practices for performance?

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

    #16
    In fact it would be better to have close to nothing in the Tick event.

    Usually people start to do everything in the tick event, since its the only one they know that happens regularly. But the question is if the logic really needs to be executed every frame, or if its enough to be executed every second, or every 0.5 seconds? A looping timer could be used for these things and is most of the times the better choice.
    For example, talking about health/stamina/mana/whatever regain. Many people do that in the tick event. After the first time they start their game with a bit higher load on the system they realize that the regain is slower than before -> they take the Delta time into account, add it up each frame and do the regain when the added up delta is >= 1 second. This is a perfect example for a looping timer, that is not influenced by system load / frame rate and doesnt influence the frame rate itself.

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

    Comment


      #17
      If you intend to do very heavy loads, you are going to want to use tick to break that load up over the frames. For instance, I have 2 billion + iterations to run for a standard sized map, and using tick is basically how you do that in a performant way. The same for any other significantly large loops that you want to run without having a spike hit your frame rate. You smooth it out over the frames.

      But generally most things don't need to be updated 30-100 times a second, which is what tick will do if not properly managed.
      Map Generator 1.0
      Map Generator 2.0
      Map Generator 3.0

      Comment


        #18
        If you know what you do, most things are legit. But i do dare to say that for 95 percent of the users the golden rule should be to not overuse the tick event

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

        Comment


          #19
          I personally use Timers for things like regens and UI updates. I reserve Ticks mostly for tutorial lessons and prototyping ideas.

          Comment


            #20
            Object Pooling will ensure that the Garbage Collector doesn't cause framerate issues as well ..

            There is a primer here that explains it quite well:

            http://gamedevelopment.tutsplus.com/...s--gamedev-651

            Comment


              #21
              Originally posted by Yggdrasil View Post
              I personally use Timers for things like regens and UI updates. I reserve Ticks mostly for tutorial lessons and prototyping ideas.
              You should probably not do it on tick in tutorials. Why teach a potentially bad habit. :P

              Comment


                #22
                Originally posted by _cDub View Post
                You should probably not do it on tick in tutorials. Why teach a potentially bad habit. :P
                I'm trying to create a timeline to switch logic from event tick to it. Although i put it on autoplay and loop but it doesn't start automatically. Can someone show me how its done?

                Comment

                Working...
                X