Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Map is lagging for some reason
Map is lagging for some reason
Aug 10 2010, 12:24 am
By: Killer2121  

Aug 10 2010, 12:24 am Killer2121 Post #1



My edited version of this map is randomly lagging, there are hyper triggers and it doesn't lag if theres 1-3 people in game anymore and you can feel slightly greater lag each time. I have looked over the triggers many times and haven't found a cause for it can anyone help me with this? here is map vvv

Attachments:
Diplo Rp Iron DK.scx
Hits: 3 Size: 593.34kb

Post has been edited 1 time(s), last time on Aug 10 2010, 12:33 am by Killer2121.



None.

Aug 10 2010, 12:45 am rockz Post #2

ᴄʜᴇᴇsᴇ ɪᴛ!

I can't see anything superbly out of the ordinary, as you have zero order triggers. Generally, hyper triggers make starcraft work much harder than it was designed to do, so older computers can't handle everything perfectly. My newer computer hardly ever lags, however when it does, it's usually because of another person.

If hyper triggers are necessary for timing stuff, then you've got to find the move/order/create triggers which are lagging the game. If hyper triggers are not necessary for timing stuff, and only to speed up the responsiveness of bring and the like, then you can fairly easily delay the hyper triggers from 2 frame to 3, 4, 5, or even 6 frame hyper triggers. On fastest, waits are in multiples of 42s, so wait 42= wait 0. Wait 43 would be a 3 frame hyper trigger, wait 85 would be a 4 frame hyper trigger, and so on with the multiples of 42 +1. Slowing down the triggers should help alleviate any problems you have.



"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"

Aug 10 2010, 1:37 am Azrael Post #3



If worse comes to worst, a sure way to figure out which ones are lagging is by making a duplicate of the map and then deleting some of the triggers, like 100 at a time. If it continues lagging, delete some more. Once it stops lagging, you know which 100 triggers the issue is in. Then you can revert the map so those 100 triggers are back, and delete 50 of them instead. If it stops lagging, then the problem is in those 50. Continue this process until you've narrowed it down to the exact problem.

I've had to do this a few times and it works well. Once I did it in a map that had 13k triggers, deleting 1k triggers at a time, then 500, then 200. It wasn't long before the issue became apparent.




Aug 10 2010, 1:41 am Aristocrat Post #4



Are there lots of "Bring" conditions checking the entire map run by every player? That might be why it lags more with more players playing.

"Bring" conditions with large locations are notorious for causing significant lag. If possible, replace those conditions with "command".



None.

Aug 10 2010, 5:56 am Wormer Post #5



There are 670 bring and 194 command conditions. MapStats says there are 2200 triggers in the map. I however could only count 459 triggers in text.

Anyway, I believe "Bring" is the second major thing of the map lag. It collects all units data from the entire map (first pass) and then narrows them to the location by looking through all units again (second pass).

Though ~500 triggers is not that much, your map has many bring conditions. More players - the worse. More units - the worse. Much units clutter in limited space - the worse. Hence, always test your maps with all slots filled with computers or neutral.

Given you've looked through triggers in search for major lag issues like move/order/create/give and found nothing, you can be pretty sure it's the large amounts of bring. Along with replacing bring with command I suggest you the following two techniques against the lag:
1. Conditions are checked from top to bottom unless the false condition is met. Hence, guard bring conditions with lightweight death or switch conditions, which eliminate bring check in all cases when you don't necessarily need to check that.
2. SC precaches data from a bring condition check data (even if it was false) until it meets bring on a different location*, command or some actions which deal with locations (remove/kill invalidates cache for sure). This works among different triggers. The moral is to try placing bring conditions grouped by location and triggers grouped by the topmost bring condition location (which should have the highest chance to be false among brings).

Yes technically it means redoing the whole map from scratch. However I believe that consistent and proper use of these rules significantly reduces the lag and allows one to make up to another few thousands of triggers.

*Type of the unit doesn't matter, data remains precached as long as it's the same location.

Post has been edited 3 time(s), last time on Aug 10 2010, 6:06 am by Wormer.



Some.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[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
[2024-5-04. : 1:05 am]
Vrael -- I won't stand for people going around saying things like im not a total madman
Please log in to shout.


Members Online: Roy, Oh_Man, DiearAnother, Revenant