• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] FPS Drop when used...

Status
Not open for further replies.
Level 10
Joined
Aug 15, 2008
Messages
720
When this part is added in my 0.02 loop trigger it slowly drops FPS to bottom, meaning game is quite laggy and gets even lagier. I can't really find a leak here. This lag only stops if I disable this part of the trigger. A help would be appreciated ^^
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Boolean_StatusSWITCH Equal to True
    • Then - Actions
      • Game - Display to (All players) the text: (|cff18A0CDSpeed:|r + (String(Real_DrivingSpeed)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real_DrivingAngleIncrease Less than 0.00
        • Then - Actions
          • Game - Display to (All players) the text: (|cff18A0CDTurning to:|r + |cffFFDA06Right|r)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real_DrivingAngleIncrease Equal to 0.00
        • Then - Actions
          • Game - Display to (All players) the text: (|cff18A0CDTurning to:|r + |cffFFDA06Middle|r)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Real_DrivingAngleIncrease Greater than 0.00
        • Then - Actions
          • Game - Display to (All players) the text: (|cff18A0CDTurning to:|r + |cffFFDA06Left|r)
        • Else - Actions
      • Game - Display to (All players) the text: (|cff18A0CDHint #1:|r + Press |cffFFDA06ESC|r to fully stop the car.)
      • Game - Display to (All players) the text: (|cff18A0CDHint #2:|r + Say |cffFFDA06-switch cam|r to switch between camera modes (|cffFFDA062D|r and |cffFFDA063rd Person|r))
      • Game - Display to (All players) the text: (|cff18A0CDHint #3:|r + Say |cffFFDA06-switch status|r to toggle status (|cffFFDA06ON|r/|cffFFDA06OFF|r))
    • Else - Actions
 
Level 11
Joined
Apr 29, 2007
Messages
826
0.03125-0.05 is good enough. 1 second loops are choppy [if for movement (x,y)]

I think you should still lower the amount of messages displayed, or maybe have the messages in a different trigger on a different loop timer. You can also try Cinematic - Clear screen of text messages; or something along those lines, occasionally.

Clearing the screen will not protect you from the FPS decrease.
 
Level 8
Joined
Nov 9, 2008
Messages
502
Custom strings leak and cannot be cleaned up. Try not to use them in fast repeating triggers.

I'm not sure if this is entirely correct but maybe if you put the strings into global variables then use those in the trigger instead it won't cause repeating leaks because it's only a single handle to a global being used instead of one being created each time you make a new custome string.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
JASS:
"this is a string"
"this is a string"
"this is a string"
"this is a string"
"this is a string"
"this is a string"
"this is a string"

The above will "leak" only one string, because strings are allocated to some kind of internal table each time a new one is used; otherwise an old one is recycled.

JASS:
"this is a string"
"this is also a string"
"this is a string too"
"this is a bob"
"this is a pineapple"
"this is SPARTA!"
Those will each leak one string.
 
Level 8
Joined
Nov 9, 2008
Messages
502
Ok but is that valid cross-trigger-instance?

If it were then why does fps get progressively worse after every iteration?

It must be that w3 forgets you used the string before and makes a new handle again without removing the old ones.

So put the strings into globals and use the globals ^^
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
The repeating strings are not causing his FPS drop, what is causing the FPS drop is something else in his trigger that he hasn't posted yet. However, when people don't post the complete trigger, there is no way we can help him. People these days, jeeze, we are not mind readers.

Post the trigger, the whole trigger, and nothing but the whole trigger.

And to answer your question, triggers have nothing to do with how strings are allocated. Those strings are allocated to the entire map.
 
Level 8
Joined
Nov 9, 2008
Messages
502
I do believe you are wrong, sir.

If you read again his first post then you will see that the leaks stop when he disables that section of the trigger. He has successfully isolated the problem and given us the core information.

Good programmer.
 
Level 8
Joined
Nov 9, 2008
Messages
502
When this part is added in my 0.02 loop trigger it slowly drops FPS to bottom, meaning game is quite laggy and gets even lagier. I can't really find a leak here. This lag only stops if I disable this part of the trigger. A help would be appreciated ^^

Sounds like progressive lagg to me.

If you know so much more than me why can't you fix my trigger?

EDIT: Ok a chat event leak? Never heard of that one...
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
Let me rephrase: if there is a change in performance by using global strings, then that's going to be a groundbreaking testament to how badly GUI sucks.

Strings in JASS do not stack on top of each other. When you use the same exact string a gazillion times (which I've done quite a lot of) there is absolutely no leak. I don't know how the war3map.wts files are handled, but unless Blizzard is even more of a failure than we expected, that's not going to change anything.

Sorry for bursting your bubble. Hate it when people quote posts I'd rather delete.
 
Level 3
Joined
Apr 11, 2010
Messages
35
try setting a global variable message with three arrays on the map initialization, and then just call these with another trigger. just an idea.
 
Status
Not open for further replies.
Top