Trigger Effency

Level 8
Joined
Dec 9, 2009
Messages
397
For each event, Should I use 1 long trigger, for example

In my RPG each attack is triggered with a DDS, a lot of classes will have a chance on hit passive

Should I put the chance on hit if's into the damage trigger because it's caused by the same event?

Or create a different trigger for each?
Or create 1 trigger for all my chance on hit skills, and keep the regular attacks seperate?
 
Level 8
Joined
Apr 26, 2011
Messages
403
many smaller trigger is fine.

not much difference in speed, because you will have to use lots of "if..elseif...else...if" if you combine into one big trigger.

and computer can handle thousands of small trigger every second without lag. (it depend on how many action happen inside trigger)
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
As far as I've experienced, what lags most are special effects, and number of units in screen.

All the system formulas (damage, integer relations, floating text, etc.) are too 'light' to lag a game. What could lag using these, are the actions within actions. Example:
If you are using (Triggering Unit) several times in the same trigger (specially if it's a periodic one) it's better to do 'U = Triggering Unit' and call 'U' variable instead of 'Triggering Unit'. Though, if you are using DDS (like Weeps) the units are already in a Unit Variable (DamageUnit, DamageSource)
 

Dr Super Good

Spell Reviewer
Level 62
Joined
Jan 18, 2005
Messages
27,051
Ultimatly you only want to make the events (aka hook the triggers to a certain event) when they are needed.

It is no point testing if a certain class does X when no one has choosen that class or can choose that class (in the case of no repicks).

Infact you only need to initialize systems when you are sure they can be used.

Thus a good map should have a management system sitting between the initialization of custom abilities and the actual game itself.

An example of a basic management system for script enhanced abilities is to only initialize the abilities for a certain class if and when the class is actually picked.

An improved management system could even only initialize script enhanced abilities when they actually become castable. Further more, it might even uninitialize (tidy up) such abilities when they become readilly unreachable.

You could even use a management system to reduce the scope of a scripted ability. It is stupid testing when every unit casts any ability when only 1 hero in the whole map can cast said ability so the management system could initialize the ability only for that unit using specific unit events instead of generic. Even if you still use a player wide generic event, that is far better than the same event being generated for all players.

The advantage of this approach is that it means that no unnescescary ability checks are performed. Additionally it means that no unnescescary objects are created. Ultimatly this makes your map much more scaleable (you could have thousands of scripted abilities without any real complexity at any time if only a few are reachable) and waste less time on stupid pointless checks.

The fact I have not heard of such systems reaching wide use sads and disgusts me. People really need to learn efficient programming practicies more.
 
Level 8
Joined
Dec 9, 2009
Messages
397
And so, have all ability triggers off by default, and only when a hero that can use it enters the map, do i activate that trigger

Sounds good.

And it'll allow me to make smaller triggers and keep them organized.

Though, 10 players max in map and 12 heroes, so... really only 2 could be not picked if everyone got something different.
 

Dr Super Good

Spell Reviewer
Level 62
Joined
Jan 18, 2005
Messages
27,051
I was refering to not creating the trigger objects and setting up the abilities before they can actually be used. Simply turning the trigger off does not solve the problem of the trigger still existing but maybe never being usable.

Also do remember that full houses are prety rare outside of popular pvp maps these days thus the system will give you more gain than you might think.
 
Level 8
Joined
Dec 9, 2009
Messages
397
Well my map will hopefully get full games, I'm putting tons of effort into making it very unique, and full house is encouraged later in game. Will have many days of gameplay.
 
Top