Learn why you should NEVER use Event Tick in Unreal Engine

Поділитися
Вставка
  • Опубліковано 23 лис 2024

КОМЕНТАРІ • 40

  • @Mireneye
    @Mireneye 6 місяців тому +3

    Under the hood Timers are basically Delegates (terminology for the BP people). Which costs more to call than calling something directly. Say you set your tick rate so that it's 100 ticks per second, it'll be cheaper to call the same math and you can even choose it's tick group.
    The real solution here is to think about the unique problem you are trying to solve and choose the best option to solve it.
    Typically for the blueprint Virtual Machine there is one thing that matters for the bytecode that gets created for every function. And that is how often something gets called. Which is why it's a more like a scripting language, not a programming language. What I mean is, if you want to increase performance in Blueprint. Bring down the times you call something, and bring down the amount of nodes in your function graph.
    And copy as few variables as possible into new chunks of memory along the way.
    But don't replace Tick for when it's actually useful. Just be mindful of it's use. The Game Thread is precious for the CPU.

    • @chankulovski
      @chankulovski  6 місяців тому

      If Zak Parrish says to avoid it, we should avoid it. Thanks for your input :)

    • @moddes3980
      @moddes3980 Місяць тому

      @@chankulovski But he doesn't say that. ua-cam.com/video/2edoacF53F0/v-deo.html You will see he very specifically says for unexperienced scripters/artists to not use tick (because they will more than likely cause themselves performance issues). Not that no one in the use of Unreal Engine should ever use tick thats a very clear distinction that you are not making. Then he goes on to talk about using it in a smart way, not to NEVER use it.

    • @chankulovski
      @chankulovski  Місяць тому

      @@moddes3980 ok

    • @chankulovski
      @chankulovski  Місяць тому

      @@variann6488 Proves my claim wrong? I said what the guy said in the video, I've copied and pasted his words, and this person is writing a comment "But he doesn't say that". After that comment, it's useless answering anymore, so, yeah ...

    • @chankulovski
      @chankulovski  Місяць тому

      @@variann6488 Dude, your toxicity has no place in my Channel! Of course I will delete your toxic comments. Get a life

  • @ademonnamedburt1232
    @ademonnamedburt1232 27 днів тому

    This is actually an excellent video, It shows why event tick can be a bad habit to get into sometimes calling something at this rate is necessary hence why it is there but using a timer instead of event tick is much more performance friendly especially for large tasks since you can pick when to run the checks and to do them in an order rather then 100% of the time. it lets you pick the speed of the checks which is an awesome thing to be able to do. A while back while coding in c# monogame I actually used the update function which is similar to event tick so when I brought my game between computers the gravity speed was vastly different

    • @chankulovski
      @chankulovski  27 днів тому +1

      Exactly right! Especially if you are having multiple Event Ticks in different Blueprints, that's a total disaster of a performance!

    • @ademonnamedburt1232
      @ademonnamedburt1232 27 днів тому

      @@chankulovski For real lol, I saw all the comments complaining so I had to leave a supportive one since anyone having performance problem's would honestly benefit a lot from this

    • @chankulovski
      @chankulovski  27 днів тому +1

      @@ademonnamedburt1232 Yeah, of course they will complain. It's easy to call one node and do 10 other things for them, it's easy and convenient, but at what price? :) You know what they say "You cannot help a person who doesn't want to be helped". Thanks a lot for your supportive comment, it means a lot! P.s. another Tutorial is coming in the next few minutes :)

  • @GMTechArt
    @GMTechArt 5 місяців тому +3

    Timer not replacement EventTick.

  • @SleepDev.
    @SleepDev. Місяць тому

    Thanks for sharing your knowledge. I need to ask if i used event tick and I connected it to a print string and a branch between them, and when I need the print string I will change the value of the boolean in the branch to true, and after using the print string I will set the boolean to false. Is this a good way to use Event Tick so that it is only used when I need it (consider that print string is a something)

    • @chankulovski
      @chankulovski  Місяць тому

      Remember: Having a lot of Branch nodes will cause performance issues. So, even if you have only one Branch node connected to the Event Tick, this will tick that Branch node like crazy (regardless what you have connected after the Branch, but the more complex program you run, the worse performance you'll get), and you definitely don't want to do that to your game! I know that it's tempting to use Tick, and it's easy and convenient, but the price is too high for that. But if you are making some mini game or testing an idea out, you could try and see how it perfoms.

    • @SleepDev.
      @SleepDev. Місяць тому

      @@chankulovski i got it thanks for sharing your knowledge

  • @norvsta
    @norvsta 6 місяців тому

    Interesting ideas, inspiring a lot of discussion! I'll be watching for more. Are you on the Gold Coast?

    • @chankulovski
      @chankulovski  6 місяців тому

      Hi there, thanks for your interest ! Plenty of different opinions, someone agrees someone disagrees :) Yes I'm on the Gold Coast

    • @norvsta
      @norvsta 6 місяців тому

      @@chankulovski I'm just down the road in Byron, just starting out in game dev, watching your Health & Damage vid now. Keep up the good work !

    • @chankulovski
      @chankulovski  6 місяців тому +1

      @@norvsta Hi neighbour ! :) If you have just started, I have a whole course on Udemy perfectly created for starters. Btw find me on Linkedin or Discord ( links in my Channel Description ) and we can stay in touch. Cheers and thanks !

    • @norvsta
      @norvsta 6 місяців тому

      @@chankulovski I just bought your course on Udemy, very reasonable price, ty!

    • @chankulovski
      @chankulovski  6 місяців тому +1

      @@norvsta Thank you very much for your trust and kind words ! Feel free to contact me if you need any additional support or consultation. Happy learning !

  • @geltun1
    @geltun1 6 місяців тому +14

    Please do not watch this video. Author has no idea what he is talking about. Casting and event tick is not bad, only bad usage is. Counting how many ticks is per one hour is stupid and tells nothing. You shoud use profiler and meassure real impact and show comparision...

    • @chankulovski
      @chankulovski  6 місяців тому

      Well, I guess you know better than Epic staff ;) start watching Epic Games Gamedev Talks and come back to edit your comment :) I'm not inventing this, this is from developers way better than you and me, especially than you :)

    • @Theawesomeking4444
      @Theawesomeking4444 6 місяців тому +4

      yeah fr i was expecting him to give a proper explanation on why tick is bad but instead he said random irrelevant stuff like saying that the amount of time the game is running somehow matters, when it doesn't, unless you are logging (which can cause big log files), but this doesn't matter on shipping builds.
      instead what you should worry is having expensive nodes on the tick such as loops.
      not to mention he also forgot to say that you should uncheck the tick enabled box on the actor, im not sure if unreal 5 automatically disables it, but at least in 4.27 its enabled by default on all actors and it will slow down the game even if the event tick node is deleted.

    • @chankulovski
      @chankulovski  6 місяців тому +1

      @@Theawesomeking4444 Well, if ticking 400.000 times in 60 minutes isn't clear enough how bad Tick is ( even Epic Games staff is saying the same thing to avoid Tick ), then continuing the discussion is simply useless, because you want to believe that Tick is good to use. Make sure you use Event Tick in every node, and make 100 Blueprints with Tick inside :) it's your choice

    • @reasonboykang
      @reasonboykang 5 місяців тому +2

      what a clown

  • @DailyPaily
    @DailyPaily 6 місяців тому +1

    I never used cast or tick, delay yes....talk about it.

    • @chankulovski
      @chankulovski  6 місяців тому +1

      Tick and Cast are one of the worst nodes for creating a final game. But Delay also have a big impact on performance. If you know how, use Custom Events with Timers. I'm preparing more Tutorials with a lot of useful and important information, stay tuned. Thanks for your comment and interest. Cheers

    • @unigdesign2867
      @unigdesign2867 6 місяців тому +2

      And how you will use things that need a tick? You should minimize it... but say... NEVER is not correct.

    • @chankulovski
      @chankulovski  6 місяців тому

      @@unigdesign2867 Event Tick is Ticking 100 times in 1 SECOND ( if your computer runs on 100 fps ). You don't need a code that runs 100 times in 1 second throughout your whole game. Anything you want to tick, can be used Custom Events and Timers instead. You can control how much to tick, when to tick, and when to STOP ticking ( the most important part ). Epic Games staff said : FORGET ABOUT THAT NODE, EVEN IF YOU THINK YOU NEED IT, STILL AVOID IT. Btw I'm soon posting another video addressing exactly this, it will be more clear, so keep an eye on my Channel. Thanks for your comment.

    • @unigdesign2867
      @unigdesign2867 6 місяців тому +2

      @@chankulovski You can set how often the tick should be executed per frame. Your statement is therefore incorrect. Just because Epic says something doesn't mean it's true for everything. Have you ever used the profiler tool via session frontend to read out the performance for your project yourself? Or have you ever debugged via Unreal Insights and seen for yourself how many ns your blueprint needs with the tick? I doubt that with your sweeping statements.
      But I will keep my eyes open. Maybe there will be a correction...

    • @DailyPaily
      @DailyPaily 6 місяців тому

      @@unigdesign2867 Tell me things that need tick.

  • @glitch_city_gamer2846
    @glitch_city_gamer2846 6 місяців тому

    Thank you so much for sharing this knowledge. Every Udemy course and UA-cam I’ve ever seen uses either Cast to or Event Tick. Makes so much sense that a custom event running every 0.1 secs is only going to run 10 times as opposed to 100 times if you’re 100 FPS, for one BP. Can definitely see how this would impact performance over a large game complex logic . You chat with the Cast To feature and every second blueprint you using because it needs character information.

    • @chankulovski
      @chankulovski  6 місяців тому

      Hi there, thanks for your feedback ! It's my pleasure to share such important information with game developers, especially for people who are just starting. I've been through these things when I've started and there was nobody to teach me otherwise. Now I'm doing my best to show everyone not to make the same mistake like I did. Appreciate your comment and thank you once again!

  • @reasonboykang
    @reasonboykang 5 місяців тому

    what's the alternative to this node then?

    • @chankulovski
      @chankulovski  3 місяці тому

      Custom Events with Timers. The node is called "Set Timer By Event".