Accname
2D-Graphics enthusiast
- Reaction score
- 1,465
In the trigger you add events for each unit spawned. These events add up, they are getting more and more each time the trigger is called. Thats a memory leak as well.
And games usually not start to leak due to lags. The lag only happens when the memory leaks are this heavy, that all RAM on your computer is used and it has to use hard drive memory to store game data. since hard drives are by far slower then RAM this process will take far more time thus lag the game.
but the main problem is not the lag but the heavy loading time when you exit the map, this time is needed to clean all the leaked memory in your map.
besides that its just bad style and why not avoid it if possible?
but as you can see in my example triggers this very simple ability can be done much easier and faster and with by far better performance.
And games usually not start to leak due to lags. The lag only happens when the memory leaks are this heavy, that all RAM on your computer is used and it has to use hard drive memory to store game data. since hard drives are by far slower then RAM this process will take far more time thus lag the game.
but the main problem is not the lag but the heavy loading time when you exit the map, this time is needed to clean all the leaked memory in your map.
besides that its just bad style and why not avoid it if possible?
but as you can see in my example triggers this very simple ability can be done much easier and faster and with by far better performance.