Each player owns a unit. Suppose I had a trigger in my map that checks every move order given to the players' units, and if the pathing distance between the target and the position of the unit is greater than some value, it cancels the move order. Now suppose I have a handful of players in the game all using autoclickers. Will the players feel additional lagg or delay? What's the computational cost of this trigger? (In general autoclickers probably issue orders about 20-200 times per second)
I don't have a great answer for you, but if I was reading an answer by Nebuli posted here correctly->http://www.sc2mapster.com/forums/development/triggers/69635-resolved-general-how-often-does-sc2-check-events-for/#p6, the triggers would only register 16 of those 200 clicks from any one user due to there being a limit to how many times per second the triggers can be made to check for events. Nebuli's answer applied specifically to using periodic trigger events, so I'm not sure if it's uniform for all trigger event checks.
Hopefully someone more knowledgeable about this stops by.
Just because triggers only activate 16 times a second doesn't mean all the events won't fire. Maybe multiple threads are spawned every 16th of a second for every event that fired.
Also, it's more than just the strength of your PC, one person lagging will bog down the entire game, so it's more about making sure the game won't lagg for the average starcraft 2 gamer.
I think you greatly underestimate the power of modern computers. A functionality like this shouldnt cause any lag at all. Again - Just program your game and at the end, when its done, profile it. If required do optimizations at the correct spots. 99,9% of the time you dont need to care about lag.
If you really want your game to run smooth, make sure to keep an eye on actor, unit and behavior count.
Each player owns a unit. Suppose I had a trigger in my map that checks every move order given to the players' units, and if the pathing distance between the target and the position of the unit is greater than some value, it cancels the move order. Now suppose I have a handful of players in the game all using autoclickers. Will the players feel additional lagg or delay? What's the computational cost of this trigger? (In general autoclickers probably issue orders about 20-200 times per second)
I don't have a great answer for you, but if I was reading an answer by Nebuli posted here correctly->http://www.sc2mapster.com/forums/development/triggers/69635-resolved-general-how-often-does-sc2-check-events-for/#p6, the triggers would only register 16 of those 200 clicks from any one user due to there being a limit to how many times per second the triggers can be made to check for events. Nebuli's answer applied specifically to using periodic trigger events, so I'm not sure if it's uniform for all trigger event checks.
Hopefully someone more knowledgeable about this stops by.
lag is entirely up to the strength of each player's PC. like the previous user said, triggers only activate 16 times a second max.
it shouldn't lag too too much, but idk
Just because triggers only activate 16 times a second doesn't mean all the events won't fire. Maybe multiple threads are spawned every 16th of a second for every event that fired.
Also, it's more than just the strength of your PC, one person lagging will bog down the entire game, so it's more about making sure the game won't lagg for the average starcraft 2 gamer.
I think you greatly underestimate the power of modern computers. A functionality like this shouldnt cause any lag at all. Again - Just program your game and at the end, when its done, profile it. If required do optimizations at the correct spots. 99,9% of the time you dont need to care about lag.
If you really want your game to run smooth, make sure to keep an eye on actor, unit and behavior count.
I've noticed that what lags offline doesn't always lag online. I think some of the load is given to the server.
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.