Hi there.
I noticed that a lot of people complain about WSAD movement lag.
They often blame it on the keypressed event.
Well, I am working on a map, and I have WSAD movement too, and it runned smoothly on battle net. Tested a couple times, but only with 2 players.
The thing is, I wanted to avoid that Key-presed-b.net lag, so I downloaded maps wich use WSAD and lag on b.net.
While examining them, I noticed some things, and I have a couple very good tips why is this lag created, but im not 100%sure yet, as I only examinated about 5 maps. (And I cannot test things because I dont have SC2 myself - friends test it for me)
So, I would like to ask you ppl, to edit your maps wich lag with WSAD movement, remove all triggers that are not movement related, upload them, and give me a link. If some things are the same on all maps, im going to do a test if thoes things are whats causing the lag and let you know.
I would concentrate (and I am doing) on instead of trying to prevent the lag entirely (which simply cannot be done with the engine network code), to minimize it and build the rest of your game around there being a delay.
For example, I intend to have aim assistance to counteract the issues with aiming and dodging, and to make all weapons have projectile travel time to allow for dodging in the first place.
People have already created all sorts of WASD systems, but it's just not possible to make one without using Key-Press events. But Key-Presses are responsible for the insane lag that you might get. We're not just blaming it on them.
Tests are also very ambiguous - the lag differs depending on the number of players and the ping to the host. If the ping is good, the system will not lag much. If the ping is bad.. well.
Since Blizzard hosts the games the ping could very well change even if you're playing with the same group of people al the time.
well, I still would like to get some maps to check it.
Well, and yes, the lag differs depending on number of players, ping and stuff. But, in a ladder game, the delay between your orders is very low, so I dont believe a Key-pressed event will cause so much major lag. Its something in the code of the map. One of my friends just came online, so im going to try to break my own map to cause it to lag .. if it works, then I probably found it, ill post updates
The thing is that the key pressed event keeps checking whether a player has pressed a key in order to keep the game synchronized. You cannot work around it as it is in the game coding itself, in the key pressed function and how the game handles it. The only realistic way to change it is to have Blizzard do it, or possibly with some hacky way but I'd have no clue on that part.
Turn off key press detection when a key has been pressed, this might reduce traffic? Incorporating acceleration movement would also reduce the effects of lag. Just some ways i thot would reduce lag during beta, never really tested on bnet. Each player's movement having their own thread would help too.
Far as i can tell ASDW controls will always lag untill someone finds a way to make the key-pressed trigger without the periodic event every .015 seconds or player viewing angle variables being tracked. Thats where it comes from because its making the came constantly do stuff. Till you reach 6 or so players it usually isnt that bad, typical internet delays such as .2 or so second lag, but after 6 players is when it usually gets bad.
Not sure how bounty got his map to 9 without this issue. The rat wont let me look at his triggers lol.
Hi there. I noticed that a lot of people complain about WSAD movement lag. They often blame it on the keypressed event.
Well, I am working on a map, and I have WSAD movement too, and it runned smoothly on battle net. Tested a couple times, but only with 2 players.
The thing is, I wanted to avoid that Key-presed-b.net lag, so I downloaded maps wich use WSAD and lag on b.net. While examining them, I noticed some things, and I have a couple very good tips why is this lag created, but im not 100%sure yet, as I only examinated about 5 maps. (And I cannot test things because I dont have SC2 myself - friends test it for me)
So, I would like to ask you ppl, to edit your maps wich lag with WSAD movement, remove all triggers that are not movement related, upload them, and give me a link. If some things are the same on all maps, im going to do a test if thoes things are whats causing the lag and let you know.
Thanks.
The keypress lag is to due battle.nets synchronization due to it being an rts . not with the triggers. Will wasd movement ever become lag free
I would concentrate (and I am doing) on instead of trying to prevent the lag entirely (which simply cannot be done with the engine network code), to minimize it and build the rest of your game around there being a delay.
For example, I intend to have aim assistance to counteract the issues with aiming and dodging, and to make all weapons have projectile travel time to allow for dodging in the first place.
Just posting here to further crush your hopes.
People have already created all sorts of WASD systems, but it's just not possible to make one without using Key-Press events. But Key-Presses are responsible for the insane lag that you might get. We're not just blaming it on them.
Tests are also very ambiguous - the lag differs depending on the number of players and the ping to the host. If the ping is good, the system will not lag much. If the ping is bad.. well. Since Blizzard hosts the games the ping could very well change even if you're playing with the same group of people al the time.
@Noidealol: Go
well, I still would like to get some maps to check it.
Well, and yes, the lag differs depending on number of players, ping and stuff. But, in a ladder game, the delay between your orders is very low, so I dont believe a Key-pressed event will cause so much major lag. Its something in the code of the map. One of my friends just came online, so im going to try to break my own map to cause it to lag .. if it works, then I probably found it, ill post updates
@Molsterr: Go
Didn't bounty fix his by lowering lantency? Least that's what he said. And the delay is very small on his map hidden temple.
The thing is that the key pressed event keeps checking whether a player has pressed a key in order to keep the game synchronized. You cannot work around it as it is in the game coding itself, in the key pressed function and how the game handles it. The only realistic way to change it is to have Blizzard do it, or possibly with some hacky way but I'd have no clue on that part.
Turn off key press detection when a key has been pressed, this might reduce traffic? Incorporating acceleration movement would also reduce the effects of lag. Just some ways i thot would reduce lag during beta, never really tested on bnet. Each player's movement having their own thread would help too.
Far as i can tell ASDW controls will always lag untill someone finds a way to make the key-pressed trigger without the periodic event every .015 seconds or player viewing angle variables being tracked. Thats where it comes from because its making the came constantly do stuff. Till you reach 6 or so players it usually isnt that bad, typical internet delays such as .2 or so second lag, but after 6 players is when it usually gets bad. Not sure how bounty got his map to 9 without this issue. The rat wont let me look at his triggers lol.
I had what I believe is similar problems with unit ides event and my map.
Can't you bundle the lot under one keypress event?
That's how I fixed my lag.
Multiple threads causes lag. But one long ass trigger doesn't. So I bundle mine together,