Hi,

I created a character menu screen that displays a Combatant element with quite a lot of status values (I have over 25) and a lot of them are combined ones that are calculated with formulas. Whenever the menu is opened there is a considerable drop in frame rate. I assume this is because of all the status values being calculated.
Is it possible to lower the frequency of the calculations? Or is there any other fix for this lag?
  • Generally, combined status values are only calculated when the combatant's stats are recalculated/updated (e.g. due to a status value changing). Also, the HUD would only update if something changed.

    So, unless your status values are constantly changing, there shouldn't be much going on here.

    Which UI system are you using?
    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!
  • I'm using the new UI. But right now I can't reproduce the problem anymore. I guess I was too hasty in making this thread. :)

    But for sure when I opened my stats menu yesterday the FPS dropped by half at least. I don't think I was dreaming.
  • With the new UI, the initial creation of the HUD will have some impact, but that's a one time thing (or better, each time the HUD is displayed after it was closed). Afterwards it'd only impact performance when it needs to be recalculated due to value changes (e.g. a status value changed, like HP taking damage).

    Naturally, it'll also have an impact on general performance just by displaying it due to the UI being rendered, but that shouldn't cause troubles, unless you're displaying a lot :)
    E.g. if you have a HUD per combatant and there are 100 combatants displaying their HUDs, that will have an impact ...
    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!
  • gamingislove said: With the new UI, the initial creation of the HUD will have some impact, but that's a one time thing (or better, each time the HUD is displayed after it was closed). Afterwards it'd only impact performance when it needs to be recalculated due to value changes (e.g. a status value changed, like HP taking damage).
    Yeah I was watching the profiler and noticed the spike when opening the menu. And I also found out the reason for the lag was that the player had a status effect applied.

    So if the player has a status effect on and they open the stats menu the profiler looks like this: image
  • edited January 13
    Okay, I think something's gone horribly wrong. Whenever my player is in combat the frame rate just keeps dropping until the game freezes. When the combat ends it's normal again.

    Edit 2: Okay nevermind, this got fixed by limiting the AI radius in battle settings. :) The UI lag is still there though.
    Post edited by pesukarhu on
  • If the status effect is constantly changing a status value, that'll constantly recalculate the UI and impact your frame rate. Since it's in a menu, I'd recommend to use the Pause Game options in the menu screen - the status effect doesn't update during pauses, so the menu will not be forced to recalculate :)
    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!
  • It shouldn't be constantly changing the status value. :(

    It reduces characters agility by 100% set on apply. Doesn't even use a formula, just a direct 100 sub percent.
  • Hm, that's strange - could that cause any additional effects (e.g. via auto apply) due to the agility being low?
    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!
  • It doesn't. :( Agility doesn't even have a combined status value from a formula, it's just static.

    It seems to happen with every status effect, not just that one. Tested another one that gives +15 defense attribute bonus against beasts and it also lags when having all my character stats visible, even though attributes are not visible in the menu at all.
  • Hm ... I'll do some tests.

    Does your menu screen contain other parts or just displaying the combatant's stats (via the Combatant part)?
    Also, is there anything else displayed in the HUD beside the status values (and are they only in text or also as value bars)?
    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!
  • I also have characters equipment showing in an additional part. I attached a screenshot of the menu. I circled the status values that use a combined value formula to calculate them (if that changes anything). So I have a "Character" menu with Equipment Part and Combatant part showing.

    image
  • I have no impact at all on my end, the HUD isn't recalculated due to a status effect (unless it changes something while displaying the HUD).

    I'd need a Unity test project with your setup to look into it.
    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!
  • gamingislove said: I'd need a Unity test project with your setup to look into it.
    My project is quite large. Can I just send the ORK project?
  • Yeah, that should work too - but I'll need some instructions on which combatant and status effects are involved :)
    Send it to contact@orkframework.com (or upload it somewhere and send the link).
    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!
  • Alright, sent! Hopefully you'll find something. And if not, eh, it's not the end of the world.
Sign In or Register to comment.