• 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.

Interval

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
A Periodic Timer of 0.01s interval is bad as we all know it.
But, does it really bad ?

I mean, what if the process is in the trigger is small ?
Would it still be considered as inefficient ?

And what is the criteria for a code to be 'heavy' or 'large process' ?
Math calculations ?
GUI BJs function ?
Location instead of Reals ?
Amount of lines in a trigger ?

I'm asking this because some properties needs to be <0.03s interval.
I'm doing a camera system at the moment and it updates the Rotation of the Camera Angle depends on the unit.

Now, I have tried a 0.03 interval but it seems the 'spikes' or the frame update can be seen - thus ruining the efficiency of the mechanics.

If I use the 0.01 interval, it is smooth, very smooth indeed.

So I need suggestions from you guys, whether I should stick to the 0.03 interval or use the 0.01 ?

The trigger's calculation is not that immense I think, calculating distance from UnitA and UnitB, etc.

And yes, this trigger is for running throughout the game purpose, it doesn't have a turn off trigger - except maybe each new rounds.
 
0.01 is fine, especially for something as cheap as math calculations.

The main issues come from when it stresses your GPU, not so much your CPU (the CPU issues tend to rise with much smaller intervals). For example, creating effects every 0.01 seconds is a lot more intense than creating effects every 0.03 seconds.

However, it is perfectly fine for camera movement. Although, you may be able to take advantage of some of the camera duration fields to eliminate the need for a 0.01 second timer. For example, OppiCam is perfectly smooth even with a 0.1 timeout:
http://www.wc3c.net/showthread.php?t=104786
Using PanCameraToTimed() and the other SetCameraField() natives.
 
Status
Not open for further replies.
Top