I have some game events that use a node loop to repeat themselves.
I also tried using repeat event in the event interaction settings without the node loop in the game event settings.
Both give me the repeat results I'm looking for.
Which one is better for performance?

As far as my HUD goes, I have text that doesn't get updated, float variables, Status Value Numbers and Status Value Bars.
Would it be better for performance to have all status elements in one HUD, or should I divide each information and status element into it's own HUD?

I noticed a huge boost to the performance of my HUD'S when I disabled Show Shadow and Show Outline.
  • It's better for performance to use loops in the event (e.g. with a 0 second wait node between them) instead of repeating the event. Starting an event each time will have some overhead (e.g. doing some initial setup, clearing data from previous runs, etc.), but it's only really worth worrying about if you have a lot of them restarting each frame.

    HUD performance really depends on which system you're using, e.g. legacy GUI has a constant, small performance cost and the new UI has higher cost when initializing and updating a UI, but no constant performance cost.
    I can't really say if it's better to have a single HUD or multiple HUDs, it always depends on your game and how things are used. E.g. a single HUD is probably a bit better with performance, as it only uses 1 GUI box, but it needs to update everything in case something changes, while multiple HUDs have a small overhead through using multiple GUI boxes, but only need to update a smaller content.

    Shadown and outline definitely impact performance, as they basically draw the text another time :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Is it better to have a wait node between the node loop? Is it ok to do it without the wait node like this. https://www.dropbox.com/s/ubq2peo1llururq/Screenshot 2019-04-07 08.27.11.png?dl=0

    I tried doing the single HUD and multiple HUDs in real time battles, and didn't really notice
    performance differences . I did notice that when using multiple HUDs the batches number in the stats window was higher than the single HUD. Would more batches make any difference in performance?
  • Yes, unless there's some wait happening somewhere in your loop, I'd say its needed to have a wait node (e.g. 0 seconds to wait for a frame) in a loop. Otherwise the event would loop hundreds of times per frame - and it's only due to the event system's safeguards that this doesn't lead to a crash :)

    As for the HUDs (or generally), less batches is always better.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited April 2019
    What kind of effect would an event looping hundreds of times per frame do to performance? Would just lead to a crash like you said. I only ask because I've used event loops without the 0's wait node without crashes.

    If I use the wait for input fork node with it's wait time set to 0, should I still use a wait node for the loop?
    Post edited by FreedTerror on
  • ORK (and Makinom) have safeguards for a number of nodes that will be executed per frame to prevent crashes. Without it, a loop without wait times would be in an infinite loop, trying to perform millions of nodes per frame, leading to a stackoverflow error and crashing your game.
    Since there are safeguards, you can use loops without wait, but it just executes unneeded loops per frame with the same conditions, impacting your performance.

    A Wait For Input node with a wait time of 0 wouldn't really be able to get any input, so you could just use a regular wait node instead :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.