- Joined
- Jun 16, 2007
- Messages
- 415
Tutorial on how to reduce lag:
This is a different way to reduce your map's lag. We all know about using programs like wc3optimizer and removing leaks, but I am going to talk about a different source of lag, which I reckon is much greater.
I am using this system in my new map, and I tell you, if you use this smartly, it will wipe out your lag! It will seriously fucking improve your maps performance so much, it is unbelievable.
To prove my point:
My map uses this, and it literally never lags. In a 30 minute game, not one person ever lags. (People get disconnected somtimes, but that's their shitty dial-up's fault) This is not an just boasting, it seriously never ever lags.
Furthermore, I always play 6v6, with big hero brawls, and furthermore I use a system that tracks all the damage done, another one that tracks all the hero's health and mana and displays them on a multiboard as bars and several triggered spells with complex timed triggers. This would normally result in heavy fucking lag, but thanks to this system, I can use any kind of triggers without having to worry about lag.
This is a different way to reduce your map's lag. We all know about using programs like wc3optimizer and removing leaks, but I am going to talk about a different source of lag, which I reckon is much greater.
Events
Events.
-Basically an event is something that always checks whether something is happening. Thus the event "A unit starts the effect of a spell" will run every single time a unit casts something. "A unit is attacked" will also run every single time. Now, this is a fair bitch of processing if you ask me.
The problem with events is that unneeded events will run all the time. In most maps, 90% of the triggers and events will be not needed. They will be there even though no one needs them.
The probably biggest bitch is triggered spells. Imagine a hero map like dota with 90 heroes, and each hero has an average of 2 triggered spells. This adds up to 180 events of the type "A unit starts the effect..." which is a huge shitload. But let's face it, out of those 90 heroes only 10 will be picked. Thus only 20 of those triggers with their events are actually needed. This would be 89% less events being triggered upon spell cast. HOLY SHIT!
So, solution A is:
Remove the Garbage. Once repick is over and everyone has their heroes, remove all the garbage triggers that no one needs any more. Just use DestroyTrigger(gg_trg_Garbage) and boom, you just reduced lag.
Furthermore you can use this to remove triggers when players don't exist or leave the game. Why would I care whether player red types -arem when he isn't even in the game?
Solution B is:
Growing Triggers as I like to call them. The idea is to create triggers without events. This way the trigger takes no memory at all, since it doesn't actually trigger. The idea is to add the event to the trigger once it is needed.
Example: Once the hero Juggernaught learns Omnislash, we do: Trigger - Add Event: "Last Created Unit casts a spell" to Omnislash.
The advantage of this solution is that you can still repick classes and that the trigger only exists if the unit decides to learn the spell.
To prove my point:
My map uses this, and it literally never lags. In a 30 minute game, not one person ever lags. (People get disconnected somtimes, but that's their shitty dial-up's fault) This is not an just boasting, it seriously never ever lags.
Furthermore, I always play 6v6, with big hero brawls, and furthermore I use a system that tracks all the damage done, another one that tracks all the hero's health and mana and displays them on a multiboard as bars and several triggered spells with complex timed triggers. This would normally result in heavy fucking lag, but thanks to this system, I can use any kind of triggers without having to worry about lag.