Specific Unit Events vs General or Player Unit Events

jwallstone

New Member
Reaction score
33
Are Specific unit events much faster? When there are a constant number of relevant unit, such as making triggers for heroes, is it better to use the specific version rather than the Player unit or General unit events?
 
Reaction score
341
It makes sense that it would be faster to register, since you already gave it the unit.

General events would have to register every unit in the map which would seem a lot slower.

It's not really noticeable in performance, though.
 

jwallstone

New Member
Reaction score
33
Yeah, it seems that way, but I was wondering if anyone had done any tests or knew from something.

The thing that makes me think twice about this is that the General unit events are probably not just registering every unit. For one thing, the types of events that can be registered are different (general events are a subset of specific unit events).

I think there's probably just a built-in check that the engine does whenever a unit dies to see if any triggers with the General event need to fire. It may be that by registering a specific unit, you are introducing an additional hook that the engine has to check, and that possibly may be slower in return for additional functionality (what I mentioned before about greater wealth of event types).

If a unit dies, the engine might normally ask: 1. Any triggers with the Generic Unit Dies event? Now (depending on how the engine is written) it might have to ask: 1. Any triggers with the Generic Unit Dies event? 2. Did Specific Unit 1 die? 3. Did Specific Unit 2 die? 4. Did Specific Unit 3 die? ... etc

I'm probably just overthinking it, and it probably doesn't make much difference anyway, but I just wanted to throw it out there and see if anyone knew.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Actualy it doesnt work like that if you havent noticed the specifc event works only with preplaced unit unless you add the event with another trigger and in that case dont do it
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top