• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Help with wait actions, varibles and lagg.

Status
Not open for further replies.
Level 4
Joined
Feb 13, 2015
Messages
60
So my map is really laggy and i wonder if its becouse of to many wait actions and if i can fix it with wait varibles instead, just i dont know how to make them. Exempel is that i have a couple of wait for boss spaws, timer windows and spells. Is it easly replaced? What more could be newbe mistakes for lagg?
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You might be shadowing global variables in which case, you have to null those variables as well.
Waits for gametime do indeed leak, normal waits dont.

If the lagg starts from the beginning of the map, you have some action that happens a lot and takes a lot of CPU.
A group loop is one of those especcially when you loop through all units on the map.

However, I think it is smart to read the "Things that leak" good and then read all your triggers.
You might find some.
 
Level 4
Joined
Feb 13, 2015
Messages
60
Lag starts with multiple players, when I test it myself, it does not lag. It starts direct with the match.

(leaks does not seems to be the problem when I dotn have those kind of triggers)
 
Level 12
Joined
May 22, 2015
Messages
1,051
Lag starts with multiple players, when I test it myself, it does not lag. It starts direct with the match.

(leaks does not seems to be the problem when I dotn have those kind of triggers)

Too many waits can definitely cause this. I had this problem at one point. I replaced the waits with JASS timer functions. It was funny. I even accidentally had them on repeat and there was no lag. They are way more efficient in multiplayer.

I'm sure you could get help with that, but do you use JASS at all?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,218
Wait game time (Pollew wait) leaks a handle.
It leaks a handle index, not a handle. This is because the "local declared local handle reference counter bug" is a bug and not an intended language feature.

wait varibles instead
varibles cant solve it?
What are you referring to? I have no idea what a "wait variable" is and have never seen or even read about one in over 10 years of WC3 modding.

TriggerSleepAction's duration variance in multiplayer games hints that it generates net traffic for synchronizing its duration. As a result if you use a lot of them it is very likely that it will create lag. Damage area native also has been reported to do this.

This lag is actually real lag and not the bad performance "lag" people keep incorrectly referring to. When such real lag occurs you can easily have full 60 FPS at full game speed however all orders will take several seconds from issuing to being registered as issued by the game (hence why it is called lag, because the game responsiveness is lagging behind). The result is similar to if a host server is suffering network congestion (ping >>1 second).
 
Level 4
Joined
Feb 13, 2015
Messages
60
Ok, fought just that varibles could replace wait actions (so called them similar).

So its its know to couse trouble with waits and every x second with multiplayer?

Then how do i replace those two?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,218
Ok, fought just that varibles could replace wait actions (so called them similar).
Variables store data. That is all they have ever done and will ever do.

So its its know to couse trouble with waits and every x second with multiplayer?
Yes as at the very least the timeout is inaccurate and always larger than it is in singleplayer. Since this happens it is possible that net traffic is generated as well which could cause bad latency lag.

Then how do i replace those two?
Two whats? There is only 1 TriggerSleepAction.

The basic idea is to use a timer with global variables for state persistence. If many such timer sequences can execute from the same source at the same time then you need some form of instancing system to manage the state. An example would be a standard parallel array instancing system such as used by vJASS structs which allocates a unique index in the parallel arrays to store data corresponding to one instance of the timed sequence. Another example would be to use a hashtable to map all state to the timer so that the timer itself manages an instance of the timed sequence.

As one can guess this can become a real pain for complicated once-off timed sequences such as commonly used in cinematics. In such a case some form of sequential data driven system might be recommended where you feed it delays and actions and it then manages timing them correctly.
 
Status
Not open for further replies.
Top