Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Map lagging conditions.
Map lagging conditions.
Jun 30 2010, 4:32 pm
By: Norm  

Jun 30 2010, 11:06 pm Lanthanide Post #21



Quote from Norm
I disagree with some of that, here is my reasoning:

1. X Deaths of X remains constant for the entire game based on which character is selected. This condition is always true.
Depending on exactly what you're doing, this means it is definitely the one to put first!

Lets say you have 5 characters, and each character has 100 triggers of this type. If you put that condition first, it means for any particular player, 400 triggers will return false on their first condition, and only 100 triggers will return true on their first condition. That is much better than waiting until the 2nd, 3rd or 4th condition to wipe out 4/5 of triggers.

The way you need to think about it is highest cull rate, and cost. You want to order by cost and then cull rate, so out of all of the cheapest conditions you want to have the conditions with the highest cull rate first. Then out of all of the expensive options (bring, basically), you want to have the conditions with the highest cull rate first - eg if you have multiple 'bring' conditions in a particular trigger, put the bring that it least likely to be satisfied first.



None.

Jul 1 2010, 6:05 am Wormer Post #22



Quote from name:Azrael.Wrath
Bring can cause a memory leak, Command can't.
Woot, a memory leak?! :crazy:
Quote from name:Azrael.Wrath
As outlined by rockz above, Command is much more similar to Accumulate than it is to Bring.
Disagree. Accumulate only accesses a single variable, when Command iterates through the units array.
Quote from name:HCM™Aristocrat
AFAIK Command scans the array of units and checks for the number of units with the same ID, but it is possible that a variable is assigned to the number of units owned by the player and is modified on creation/removal/death. In the first case it would be O(n) but in the second case it would be O(1) like the death and accumulate conditions.
Haven't understood about O(1) thing (the bold part). Could you please elaborate more why you think it's O(1) but not O(n)?
Quote from name:HCM™Aristocrat
Bring, however, functions like this: (as far as I know)
-Iterates through all units.
-Once a unit of the type is found, It locates the center of the unit and uses arithmetic to find the four corners of the unit.
-Then, it performs four comparisons for each corner, to check to see if they lie within the location.
-If so, then the unit is in the location and 1 is added to the "bring count".
-When all units have been scanned it checks that number.
Actually it operates a bit differently. There is a cache which is filled with all units on a given location. Bring fills the cache with units and then iterates through this cache. If the cache wasn't invalidated and if the next Bring runs on the same location, SC won't reiterate through all units performing "narrowing" (when it checks whether a unit is in the location), it uses the cache instead. Some actions doesn't invalidate the cache (like CreateUnit) which is a well known bug when a unit appears to be invisible for the Bring condition.

Moral: always group multiple Brings working on the same location.

Quote from Lanthanide
Lets say you have 5 characters, and each character has 100 triggers of this type. If you put that condition first, it means for any particular player, 400 triggers will return false on their first condition, and only 100 triggers will return true on their first condition. That is much better than waiting until the 2nd, 3rd or 4th condition to wipe out 4/5 of triggers.
Right. Norm wasn't very clear and I read it literary that all 2500 Deaths conditions are always true.

Post has been edited 4 time(s), last time on Jul 1 2010, 6:12 am by Wormer.



Some.

Jul 1 2010, 6:21 am (U)Bolt_Head Post #23



This whole thread has me baffled... How many thousands of triggers do people make now days where you are debating the computational complexity of starcraft's conditions? I've been out of SC1 mapping for quite some time now but I had never saw reason to suspect anything other than actions that resulted in a graphical change would cause negligible lag. Even on the computers of the past...

So what am I missing? Is everyone taking theoretical lag reduction to the next level of crazy or there been some serious changes in the last 5 or 6 years?



None.

Jul 1 2010, 8:40 am NudeRaider Post #24

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from (U)Bolt_Head
This whole thread has me baffled... How many thousands of triggers do people make now days where you are debating the computational complexity of starcraft's conditions? I've been out of SC1 mapping for quite some time now but I had never saw reason to suspect anything other than actions that resulted in a graphical change would cause negligible lag. Even on the computers of the past...

So what am I missing? Is everyone taking theoretical lag reduction to the next level of crazy or there been some serious changes in the last 5 or 6 years?
Suffice to say, the trigger limit has been found at 64k triggers.
Trigger duplicators have become really popular.




Jul 1 2010, 10:03 am Wormer Post #25



Quote from (U)Bolt_Head
This whole thread has me baffled... How many thousands of triggers do people make now days where you are debating the computational complexity of starcraft's conditions? I've been out of SC1 mapping for quite some time now but I had never saw reason to suspect anything other than actions that resulted in a graphical change would cause negligible lag. Even on the computers of the past...

So what am I missing? Is everyone taking theoretical lag reduction to the next level of crazy or there been some serious changes in the last 5 or 6 years?
I believe this is dictated more by practical limits than theoretical craziness. You see, people try to emulate computations on triggers engine. SC triggers aren't intended for such things, which leads to a huge amount of triggers. SC isn't suited to have that much, and isn't optimized to handle large amounts of them. I found my personal practical top triggers limit at about 16k trigger checks every second frame. I believe 16k trigger checks is where you must optimize triggers for conditions. However the lag may already be noticeable to a trained eye at about 12k trigger checks, however exact values of course vary from map to map. Up to date computers are fast, but most of their computational power is spent by the trigger engine in vain...

Post has been edited 1 time(s), last time on Jul 1 2010, 10:09 am by Wormer.



Some.

Jul 1 2010, 11:29 am Ahli Post #26

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

Quote from NudeRaider
Suffice to say, the trigger limit has been found at 64k triggers.
65536 or more triggers will disable your save ability causing a crash. I don't know what the actual limit for running a map is (maybe trigger section size, maybe map file size, ...). Everything else works with that many triggers (tested with 71k triggers).

btw, I guess we don't really know how SC checks the location cache because centering the location on itself will revert the order of the units with the same x coordinate (-> it doesn't only scan the unitnode for units within the location because that would result in a static order).




Jul 1 2010, 1:09 pm Aristocrat Post #27



Quote from Wormer
Quote from name:HCM™Aristocrat
AFAIK Command scans the array of units and checks for the number of units with the same ID, but it is possible that a variable is assigned to the number of units owned by the player and is modified on creation/removal/death. In the first case it would be O(n) but in the second case it would be O(1) like the death and accumulate conditions.
Haven't understood about O(1) thing (the bold part). Could you please elaborate more why you think it's O(1) but not O(n)?

Only certain events can cause the unit count to change (created unit either with triggers or through buildings, killed unit through triggers or combat, and removed units through triggers or unplaceable errors. It is simple to allocate space for each unit (variables like "dragoonCount" or w/e), and modify its value with a few extra ASM statements. Accessing it then becomes O(1).

I wasn't aware of the exact mechanism of Bring so I thought of a simple optimized system, but I realized that it's not how SC checks it (see my last statement in the same post). Thanks for clearing that up; it helps =).

I've had a 230k trigger map run smoothly; it depends more on the trigger contents than the count.



None.

Jul 1 2010, 2:11 pm Azrael Post #28



Quote from Wormer
Disagree. Accumulate only accesses a single variable, when Command iterates through the units array.
I didn't say they were identical :wtfage: Command doesn't access a location, which makes it far more efficient than Brings.

Quote from (U)Bolt_Head
This whole thread has me baffled... How many thousands of triggers do people make now days where you are debating the computational complexity of starcraft's conditions?
I can make a map that lags the living fuck out of your computer with only conditions, and easily has less than 1000 triggers.

Actually, I will do that when I have time anyways and post it in this thread, because I think it would be a good visual aid.

As has been stated, you can make a map with tens of thousands of triggers and have it run well. Alternatively, you can make a map with a few hundred triggers and have it run like shit. It's not how many triggers there are, but the content of them.

Post has been edited 4 time(s), last time on Nov 18 2012, 7:31 pm by Azrael.




Jul 1 2010, 2:51 pm Wormer Post #29



Quote from Aristocrat
I've had a 230k trigger map run smoothly; it depends more on the trigger contents than the count.
I wonder how long you waited for that map to load and how long you waited the final score screen to close... :rolleyes:
Must have been minimum several minutes.

Of course you may put all blank preserve triggers or only death conditions, but the point is that in a real map you can't do anything interesting only with deaths, you necessary need to interact with units.

For everyone interested in exact SC mechanisms concerning bring/command conditions strongly recommend the following thread: http://www.staredit.net/54441/.



Some.

Jul 1 2010, 2:58 pm Aristocrat Post #30



Quote from Wormer
Quote from Aristocrat
I've had a 230k trigger map run smoothly; it depends more on the trigger contents than the count.
I wonder how long you waited for that map to load and how long you waited the final score screen to close... :rolleyes:

About few seconds. Nothing really noticeable.



None.

Jul 2 2010, 6:39 am (U)Bolt_Head Post #31



Quote from name:Azrael.Wrath
Quote from (U)Bolt_Head
This whole thread has me baffled... How many thousands of triggers do people make now days where you are debating the computational complexity of starcraft's conditions?
I can make a map that lags the living fuck out of your computer with only conditions, and easily has less than 1000 triggers.

Actually, I will do that when I have time anyways and post it in this thread, because I think it would be a good visual aid.

As has been stated, you can make a map with tens of thousands of triggers and have it run well. Alternatively, you can make a map with a few hundred triggers and have it run like shit. It's not how many triggers there are, but the content of them.

Could that map be created using standard StarEdit? I have no idea if 'new' triggers have been discovered, I remember having Player 9-12 triggers and being able to use them. I do know however that I had created some really trigger intensive things in my day. (at least action intensive, such as centering a location and performing actions on 100+ of different spots every hypered trigger cycle)
So Aside from editing the standard input for the parameters are there new triggers?. Has there been ways to run triggers for non standard (1-8) players? Has the location limit been broken?

So a theoretical idea/question of mine is. Have people used things like a Location grid to create simulated locations? So for an example... You want to check if a unit is within the bounds of (X1,Y1)(X2,Y2). And then it is achieved by moving a series of locations (or one) to those coordinates and checking it with simulated OR conditions?

And speaking of OR conditions. Are there tools now that greatly simplify the creation of OR condition triggers without going though the hassle of coping the trigger for each OR and disabling them all when any one executes?

(sorry for my newbism)



None.

Jul 2 2010, 6:59 am Vrael Post #32



Quote from (U)Bolt_Head
I remember having Player 9-12 triggers and being able to use them.
Are you sure? We can use P9-12 units, but they still can't run triggers.

Quote from (U)Bolt_Head
So Aside from editing the standard input for the parameters are there new triggers?.
No. We can read certain things in memory now, so in a sense there are new conditions, but not new triggers.

Quote
Has there been ways to run triggers for non standard (1-8) players? Has the location limit been broken?
No and no.

Quote
Have people used things like a Location grid to create simulated locations?
Yes, I think so. Sorta.

Quote
Are there tools now that greatly simplify the creation of OR condition triggers without going though the hassle of coping the trigger for each OR and disabling them all when any one executes?
Yes and No. There is nothing which simplifies the "OR" problem itself, but people like Wormer have made tools like Macrotriggers which can greatly simplify the mass production of triggers in a loop-like fashion.

As for some idea of how many triggers maps nowadays have, Ahli probably has the largest amount in an actual map, (idk if aristocrat's 230k was just fooling around or what), but Kaias & Lethal's Nightfall had around 11k, my own map is approaching 6k, Norm had 3k or so? So yeah, little things like condition order start to matter.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
[2024-4-17. : 1:53 am]
Vrael -- bet u'll ask for my minerals first and then just send me some lousy vespene gas instead
[2024-4-17. : 1:52 am]
Vrael -- hah do you think I was born yesterday?
Please log in to shout.


Members Online: Roy