Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: [SOLVED] Lag and Triggers
[SOLVED] Lag and Triggers
This topic is locked. You can no longer write replies here.
Jan 3 2012, 9:00 am
By: Vrael  

Jan 3 2012, 9:00 am Vrael Post #1



So for the map I'm currently making, Tenebrous RPG, my last trigger count was 12,954. I am wondering if playing with laggers with such a high number of triggers actually affects the gameplay in some way? SC maps clearly weren't designed to have thousands upon thousands of triggers, and it seems to me that random trigger systems in my map start to fail when I play with laggers. Am I making shit up, or is there a legit correlation here?



None.

Jan 3 2012, 9:58 am Lanthanide Post #2



I've got approx 2531 triggers in DS Night (some of them are just comments, though, so don't actually run) although only a handful, like maybe 100 or so, will be actioned every cycle. The biggest chunks are to do with spawning units and progression for the increasing mineral rates. Anyway, when playing with laggers I haven't noticed triggers to not fire or screw up. In fact earlier today I was playing with someone whom I'm pretty sure had a slow computer as towards the late game we started get to lag that appeared to coincide with every 2nd frame and the 'drop players' lag box kept showing up with that guys name on it.

So in short: I've not experienced any trigger flakiness from lag, as far as I can tell.



None.

Jan 3 2012, 10:40 am Roy Post #3

An artist's depiction of an Extended Unit Death

From my understanding on game states and trigger execution, a slower computer attempting to run all these triggers would simply make all other players wait until it was finished (lag), but it wouldn't force everyone to drop trigger execution from this needed delay (if it was the case of dropping executions because the PC was too slow, the game states would desynchronize and the lagger would drop from the other players).

According to the oldwiki article, the trigger limit is actually 65,535. Of course, no map (excluding proof-of-concept spammed trigger count maps) has been created to need that amount of triggers, and it's difficult to say definitively if there are certain issues that occur when approaching this limit. Regardless, this is an entirely independent issue from lagging players.

With such a massive trigger system, my first guess would be that you have some type of logical error(s) in your map, and thus far you've only noticed them when playing under laggy scenarios (i.e., the lag is coincidental). I recall having some issues with a significantly smaller trigger system (~1700) where I could not figure out for the life of me why a cut-scene would randomly (as in it would be a different spot/trigger each time) stop executing specific triggers.




Jan 3 2012, 10:53 am O)FaRTy1billion[MM] Post #4

👻 👾 👽 💪

I remember something about that trigger limit only applying to savegames or replays or something ... maps CAN have that many triggers (there is no cap other than your computer's memory as the TRIG section can be split)



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Jan 3 2012, 12:01 pm Ahli Post #5

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

If you exceed the limit and you try to save the game with that high amount of triggers, sc crashes.
Replays and the map itself work fine. Savegames are the only thing limited.

The triggers shouldn't fail as the game frames are synchronized. It would just lag.




Jan 3 2012, 4:31 pm Heinermann Post #6

SDE, BWAPI owner, hacker.

It depends on the triggers. If you want to speed them up, then you should compress them with TinyMap for example to remove comments and unused stuff (like Always). Not sure if it supports the Preserve Trigger flag, but that would also reduce the total number of trigger actions needed to run when all conditions for a trigger are met.

Another thing is using any trigger condition or action involving units inside a location. If the location is a small location, then it will be one of the longest running conditions. If you can, make these conditions execute last, and make the location larger than the largest unit's width and largest unit's height.

I am not sure of the specific performance statistics of conditions, but you should put conditions that would execute faster (or more common) first, so if they fail, then the condition checking is done.

Please also keep note that a trigger owned by "All Players" will create a COPY of the trigger for all players in the game.
If you have a trigger owned by "All Players", "Force 1", and "Player 1", then the trigger will be executed 3 times for player 1. There will be 3 copies.

Also if you are lagging, then unchecking Options -> Speed -> CPU Throttle will help a little bit.

Post has been edited 2 time(s), last time on Jan 3 2012, 8:17 pm by Heinermann.




Jan 3 2012, 10:11 pm Vrael Post #7



Thank you for all your replies, but I'm not asking about the stuff you guys are telling me. I'm specifically asking if its possible for lag to cause trigger failure, a question I'd only expect Heinermann or maybe Farty to be able to answer (no offense to the rest of you guys). I ask this because I ONLY notice these random trigger failures in playthroughs with bad lag. I don't lag myself, when I play the map by myself or with other people in no lag everything works fine. That's not to say the map is perfect and glitchless, only that glitches and errors which no longer appear, or have never appeared before (meaning systems which work suddenly fail for no apparent reason), over the 4 or 5 years of my producing the map, suddenly appear. Could it be some new trigger I've been working on interfering? Possibly. If the answer to my question is a definitive "no, lag cannot desynchronize triggers", then it definitely is.

Quote from Roy
my first guess would be that you have some type of logical error(s) in your map, and thus far you've only noticed them when playing under laggy scenarios (i.e., the lag is coincidental).
This is the most logical response, and often correct, but I've just been working on it for so long that I've come to suspect there might be another cause.
Quote from Roy
Of course, no map (excluding proof-of-concept spammed trigger count maps) has been created to need that amount of triggers
I think Ahli could prove you wrong, considering he's the one who found the limit ;)


Quote from Ahli
The triggers shouldn't fail as the game frames are synchronized. It would just lag.
This is 100% true? I ask because of Heiner's response:
Quote from Heinermann
It depends on the triggers.

Edit:
I'm fairly certain that I'm making shit up, but I still need someone to tell me I'm making shit up.

Post has been edited 1 time(s), last time on Jan 3 2012, 11:18 pm by Vrael.



None.

Jan 4 2012, 5:46 pm Heinermann Post #8

SDE, BWAPI owner, hacker.

I was referring to the trigger lag. Triggers should not desynchronize or stop working correctly if there is lag. All triggers should run even if there are so many such that the processor takes 10 seconds to run them (Starcraft freezes for 10 seconds if this is the case, and other players have the wait timer for 10 seconds).

Triggers are added to a vector, which is resized and has no limit (except for your computer's RAM). Triggers will only be added for active players, so if you have 1000 triggers owned by All Players and there are only 3 active players, that's about 6.9 MB. If there are 8 active players, then that's about 18.3 MB for every client. If you have 12954 triggers owned by all players, and there are 8 active players, then that's 237.2 MB of triggers being executed for every player on every client.

Triggers are run by all players always. The loop is not broken until all triggers have been executed (or a wait occurs).




Jan 4 2012, 8:56 pm Lanthanide Post #9



Quote from Heinermann
If you have 12954 triggers owned by all players, and there are 8 active players, then that's 237.2 MB of triggers being executed for every player on every client.
And that amount of memory could really start to cause problems for people on older XP computers, which make up a sizeable proportion of players on b.net these days. Not that that would be specifically related to triggers failing to execute, of course.



None.

Jan 4 2012, 10:50 pm Vrael Post #10



Okay thanks, I think this answers my question adequately enough. Though when you say "should not", does that mean "will not, bar any ridiculous circumstances like a faulty processor", or "there IS some possibility that I know about but isn't worth explaining here"?



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[07:47 pm]
Ultraviolet -- Yeah, I suppose there's something to that
[2024-5-06. : 5:02 am]
Oh_Man -- whereas just "press X to get 50 health back" is pretty mindless
[2024-5-06. : 5:02 am]
Oh_Man -- because it adds anotherr level of player decision-making where u dont wanna walk too far away from the medic or u lose healing value
[2024-5-06. : 5:01 am]
Oh_Man -- initially I thought it was weird why is he still using the basic pre-EUD medic healing system, but it's actually genius
[2024-5-06. : 3:04 am]
Ultraviolet -- Vrael
Vrael shouted: I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
With the modern EUD editors, I don't think they're calculating nearly as many offsets as you might imagine. Still some fancy ass work that I'm sure took a ton of effort
[2024-5-06. : 12:51 am]
Oh_Man -- definitely EUD
[2024-5-05. : 9:35 pm]
Vrael -- I almost had a heart attack just thinking about calculating all the offsets it would take to do that kind of stuff
[2024-5-05. : 9:35 pm]
Vrael -- that is insane
[2024-5-05. : 9:35 pm]
Vrael -- damn is that all EUD effects?
[2024-5-04. : 10:53 pm]
Oh_Man -- https://youtu.be/MHOZptE-_-c are yall seeing this map? it's insane
Please log in to shout.


Members Online: RIVE, da real donwano