• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[General] Max number of variables/triggers in map

Status
Not open for further replies.
Level 3
Joined
Mar 5, 2010
Messages
14
1. I' m curious how many variables/local variables i can use in single map?

2. How many unique triggers/functions i can possess or use at once?
I saw topic that one guy get crash when he used 2000 of function calls.

I've seen benchmark threads about integers and diffrences in speed in usage of similiar functions,
but i've never found a single topic about limitations.
 
Level 3
Joined
Mar 5, 2010
Messages
14
It's immposible since Warcraft 3 has probably avarage 1ghz limitation of memory usage.
 
Here stands everything you ask for.

1. As far as i know too much to reach. The only problem happening is setuping Arrays to big as starting size so that the Initializing takes to much time -> Init of all Triggers breaks -> No Triggers at all. Guess Max is 4 GB RAM usage cause of 2^32.

2. There is a limit i forgot it. Sorry. But again only happens in non-default usage by unlimited recursion or stuff that should not happen at all. Your example with ths 2000 Calls sounds just like this pretty wierd way.
Accoding to the Link First, you should know what the op-limit is.
It is the operation limit of Warcraft III's engine for a particular thread.
Once you hit the op-limit, the rest of the code in that trigger/thread will never fire. It is almost like "Skip Remaining Actions". This can mess up your triggers.

The limit (according to PipeDream) is 300,000 byte code operations (which is trivial information unless you trace the byte code you use).

3. This benchmark stuff is only important for writing Systems or to Triggers with a high Frequenz. In a End-Project it is not so important.
 
Level 3
Joined
Mar 5, 2010
Messages
14
Really thanks for this link. Not the all information i want to know but it still really helps.

1. That makes sense so limit should be same like for arrays ~8192 diffrent variables.

2. Ye i know about operation limit. Thats nearly immposible to do so many actions in short period of time.
So basicly i can have as much triggers as i want but i need to watch out to not bypass the op limit?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
It's immposible since Warcraft 3 has probably avarage 1ghz limitation of memory usage.
Warcraft III has no such limit. I can confirm it runs perfectly on memory operating at 1333 MHz (1.333 GHz). Memory clock speed should be completely transparent to applications anyway.

Maybe you mean GB (gigabyte) instead of GHz (gigahertz), A unit of data storage and not frequency?


Guess Max is 4 GB RAM usage cause of 2^32.
Only if it was built to be large address aware as otherwise it will be limited to 2 GB and it may still be limited to under 4 GB if run on a 32 bit OS due to OS limitations. Large address aware 32 bit builds run on 64 bit OS will always have 4 GB of virtual memory address space available. 64 bit builds (which WC3 lacks) are always large address aware and have some excessive virtual memory address space limit beyond anything anyone will practically use.

1. I' m curious how many variables/local variables i can use in single map?
Probably hundreds of thousands. Do be aware that the hashtable structure used to map variable names to data has a fixed sized bucket array, as such performance of variable access operations decreases as variable number increases. Global and local variables use separate hashtable structures so will not affect the performance of each other.

2. How many unique triggers/functions i can possess or use at once?
Triggers are limited to the number of trigger and related handles that can be allocated. This is a pretty huge number in the order of thousands.

There is no real limit on function number. Eventually you will run out of memory or reach an impractically large map script though.

Only 1 function or trigger can execute at once. One will probably get a crash if one queues up too many trigger threads. One will probably get a crash if one nests function calls too deep so as to cause a stack overflow. Both these limits are quite massive so should not be a problem within the scope of reasonable programming. A bigger concern is how long the triggers take to execute, running too much trigger code instantaneously will cause frame drops due to game update/redraw deadlines being missed.
 
Status
Not open for further replies.
Top