HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Question about two triggers

02-22-2009, 07:17 PM#1
mobofone
This is what im asking, its not that important its just i want to know, if i have to many triggers will it make the game play lag? or it wont effect it if you have a fast computer? also im confused on the quest things, Do i need to use variables for that ? just simple questions
02-22-2009, 07:24 PM#2
Michael Peppers
Quote:
Originally Posted by mobofone
This is what im asking, its not that important its just i want to know, if i have to many triggers will it make the game play lag? or it wont effect it if you have a fast computer? also im confused on the quest things, Do i need to use variables for that ? just simple questions

1. Usually, for simple triggers, there won't be any lag, just try to avoid triggers that check something every "x" seconds and you're fine

Events like this:

Trigger:
Sure Lag
Collapse Events
Time - Every 1.00 seconds of game time

are sure lag. XD

2. If you want a quest to be shown (or updated), you just need a simple trigger, example:

Trigger:
Quest 1
Collapse Events
Unit - a unit dies
Collapse Conditions
Unit type of (Dying unit) equal to (Footman)
Collapse Actions
Quest - Create a main quest titled Quest 1 with the description Quest 1 using icon path ReplaceableTextures\CommandButtons\BTNSorceressMaster.blp

But obviously it depends on what you want to do, so I'll say "yes and no". Be more specific and you'll get a better answer
02-22-2009, 08:05 PM#3
Zerzax
It's totally circumstantial as to how much lag your triggers will generate: Firstly, they are handles, and increase the handle count - that's more memory that the game has to sustain per trigger. But honestly, triggers won't truly be the lag issue, unless obscene numbers are created - it's really the code they execute and how fast that code is. Periodic triggers aren't that bad really - especially with a high interval such as 1 second. You'll notice that many spells involve a global timer running constantly at a very low interval, which is essentially the same thing as a periodic trigger, as long as spells are being cast. Of course, if you create tons of those triggers at low intervals such as 0.02 sec, the processor will take a hit. Your second question is too vague for me to understand.

EDIT: Think of it this way - a spell trigger most often registers EVERY TIME a spell gets cast, or a unit is attacked, and just look at damage detection - that's pretty heavy as it is. Something that runs a thread every second is probably equivalent to, if not more efficient than, a 1-second trigger
02-22-2009, 08:17 PM#4
Michael Peppers
Quote:
Originally Posted by Zerzax
Periodic triggers aren't that bad really - especially with a high interval such as 1 second. You'll notice that many spells involve a global timer running constantly at a very high interval, which is essentially the same thing as a periodic trigger, as long as spells are being cast. Of course, if you create tons of those triggers at low intervals such as 0.02 sec, the processor will take a hit.

Quote:
Originally Posted by Michael Peppers
1. Usually, for simple triggers, there won't be any lag, just try to avoid triggers that check something every "x" seconds and you're fine

Events like this:

Trigger:
Sure Lag
Collapse Events
Time - Every 1.00 seconds of game time

are sure lag. XD

Zerzax's right, but (personal experience) time-based triggers (mine was "every 1 second") with a huge code cause quite disturbing lags.

Look at what Zerzax says and you'll be fine.
02-22-2009, 09:30 PM#5
akolyt0r
Of course...when your triggers leak, they will cause lag no matter how many you have ...
Depending on how good eachs computer is time until the lag starts may be different for each player ...
02-22-2009, 11:19 PM#6
mobofone
Ah k thanks, just was wondering cause of having to many triggers will make it lag cause of all the things that would happen in my campaign map.
02-23-2009, 12:32 AM#7
ShadowWolf
Quests are created with triggers, they have their own section in the trigger editor drop down menu.

Large amounts of units will cause lag before lots of triggers do. Memory leaks can be an issue, but only really if your map is full of them and play time lasts for a while. What the other guys said is true too- it depends on types of events and such you have.