- Joined
- Aug 27, 2008
- Messages
- 130
I found that the following code is making a huge impact on performance when there are multiple players in the game. Can someone help me rework it? This code is being called by another action that calls it for every active player. It also doesn't impact performance when playing single-player.
The goal is to display overhead text on units of any type and each text waits for the previous one before appearing, that's done by adding the unit to a unit group while other calls wait using the Wait for (Conditions).
The lag that appears from this somehow stays and piles on throughout the gameplay even when there are no texts displaying.
Edit 1: I can't confirm it yet, but i believe that it is caused by the fact that I am not removing the text tags after creation. After adding a destroy at the end, the lag no longer seems to pile on. I thought that Fade Out Duration would remove it on its own after its finished.
Edit 2: I managed to improve performance, in some cases, over 500 times. Proof:
I did this by editing the code like so:
I still can't confirm anything as all my testers are offline. After I release this map I will be releasing a library with useful functions like this one, hopefully all optimized by then. The library will depend on GAx3 and possibly Renee's Warcraft 3 mod.
Edit 3: I can confirm that the problem is fixed.
The goal is to display overhead text on units of any type and each text waits for the previous one before appearing, that's done by adding the unit to a unit group while other calls wait using the Wait for (Conditions).
The lag that appears from this somehow stays and piles on throughout the gameplay even when there are no texts displaying.
Edit 1: I can't confirm it yet, but i believe that it is caused by the fact that I am not removing the text tags after creation. After adding a destroy at the end, the lag no longer seems to pile on. I thought that Fade Out Duration would remove it on its own after its finished.
Edit 2: I managed to improve performance, in some cases, over 500 times. Proof:
I did this by editing the code like so:
I still can't confirm anything as all my testers are offline. After I release this map I will be releasing a library with useful functions like this one, hopefully all optimized by then. The library will depend on GAx3 and possibly Renee's Warcraft 3 mod.
Edit 3: I can confirm that the problem is fixed.
Last edited: