• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Hitting the OP Limit. Again...

Status
Not open for further replies.

SpasMaster

Hosted Project: SC
Level 24
Joined
Jan 29, 2010
Messages
1,994
Hello, Hive!

Yesterday while working on the next version of my map, I hit the OP Limit. This happened to me ~2 years ago for the first time. Thanks to people in the forum, I understood what the OP Limit is and I "fixed" it twice. First time I changed most of my array variables to 1. The second time I encountered it, I had to merge many triggers with the same events to "optimize" them. Ever since, when working with triggers I have always been careful and with each version I merged more and more triggers to prevent myself from hitting the OP Limit again. I have been avoiding using array variables. The rare cases when I had to use them, the array size has never been greater than 1-10.

So yesterday I hit it again. What did I do to try and fix it?
• I did the same thing that Maker suggested to me back when this first happened:
Maker said:
Your map seems to indeed be hitting the operation limit, assuming there is no bug that aborts the initialization thread.

I think you could have shared variables beetween triggers more, so you would not need that many variables. But that is not the issue, variables are initialized ok.

The trouble is the triggers, you have so many. Initializing all of them cause the operation limit to be exceeded.

One solution might be to use

Event - Time elapsed time is 0.00 seconds
Trigger - Add an event a to trigger x
Trigger - Add an event b to trigger y
Trigger - Add an event c to trigger z

This way the events do not affect the op limit at initialization.

Or otherwise merge triggers.

I tried both with merging and by adding the events to triggers with <Event - Time elapsed time is 0.00 seconds>

• I removed ~25 unused variables.
• For testing purpose I removed a ton of actions from Initialization triggers.
• I moved many Initialization actions to a trigger with this event: <Event - Time elapsed time is 0.00 seconds>.
• Then I thought the triggers with <Event - Time elapsed time is 0.00 seconds> event might be hitting the OP Limit aswell. So I tried removing them entirely just to see if the OP Limit will go away.

None of those got rid of the OP Limit. What's weirder though is that on 3rd February I sat down to do some triggering (before that everything was fine), so I didn't do much that day. In fact I was doing some basic item abilities and text messages when going infront of a locked door. Nothing major. On the 4th February I test my map and see that I've hit the OP Limit. Usually, when this happened to me in the past I was always like: "Oh.. well, I will have to merge some triggers cause my trigger count got high" and that always fixed the issue, but obviously not this time, because I tried everything that fixes OP Limit to my knowledge.

Well, that's all. Help? Pls...? :D
 

SpasMaster

Hosted Project: SC
Level 24
Joined
Jan 29, 2010
Messages
1,994
Yeah, sorry for not stating that. The "symptom" is the same as in the first linked thread: At map initialization an Intro Cinematic should run. When that cinematic ends, it enables several core triggers of the map. So basically what happens is that cinematic doesn't run anymore. And I am certain it's because of the OP Limit because the exact same thing has happened several times to me in the past and I have not touched the intro cinematic triggers which have been running flawlessly for the last 4 years. :p

EDIT: Thanks to Object Manager, I tracked all triggers that are run on Initialization. I changed the events of all of them (except the Intro Cinematic) to <Event - Time elapsed time is X seconds>. Still nothing.
 

Attachments

  • Pic.png
    Pic.png
    11.1 KB · Views: 107
Last edited:
There are many things besides OP limit which can cause your thread to crash. For instance, division by zero, and infinite loops. Some times when writing jass, i forget to increase the index after each loop, which screws things up, although this is not really a problem in GUI. Another common issue is trying to use an uninitialized variable. For instance, if you try to set the position of a unit which is held by a unit variable, but the unit variable has no unit assigned, your thread can crash.
 
Status
Not open for further replies.
Top