HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

NEW FAQ: Read this before you post

07-16-2002, 06:45 AM#1
dataangel
Make sure your question isn't listed here before asking:

http://dataangel.no-ip.com/faq.html

You can submit new questions and make corrections on this thread, and I'll add them to FAQ.
07-18-2002, 10:23 AM#2
littlecramp
data, you forgot to add the FAQ regarding ordering Hidden units at region!
07-18-2002, 04:57 PM#3
dataangel
DOH!

Thx :)

I'll add it either really late tonight or tommorow.
07-27-2002, 08:09 PM#4
Athifos
Hey dataangel...where can you download the special effects map that you used to have on your site?
08-03-2002, 06:14 AM#5
Mr.123
Just helped Madacc debug his map and it appears that triggers running in parallel may cause unexpected problems. In his case, it was something like:

event - unit dies
actions -
1. kills[i] = kills[i] + 1;
2. update leaderboard
3. if (kills[i] mod 20 == 0) then spawn unit.

The unit never spawns even when kills reach and pass increments of 20s. It only happens occasionally and only in large battles. I suspect that the trigger executes past 1 and before 3 and the trigger fires again b/c another unit has died and it executes 1 before step 3 of the first trigger can execute. In some cases, it may produce incorrectly behavoir. i.e. kills is at 19, trigger fires, kills set to 20, trigger fires again before the check, and now kills is set to 21 when the check occurs. 20 happened too briefly for the check to kick in. Using Trigger - Add trigger to queue and Trigger - remove this trigger from queue should solve the problem of parallel triggers. We will see if it was actually the problem in a few more large public tests.

I was looking for a use for queueing up triggers :P.
08-03-2002, 06:39 PM#6
dataangel
Triggers running simultaneously is infact the problem. Depending on how war3 rounds, you could setup something like:

kills / 20 > i, and if so set var i = i + 1
08-07-2002, 05:45 PM#7
Mr.123
Just to formalize the question for the FAQ.

Q: I think my kill counter/leaderboard is miscounting kills sometimes. What is the problem?

Warcraft 3 uses a multithreaded trigger system. In simple terms, it means triggers can run simultanously. This usually does not cause problems. There are a few rare cases where it can cause undesired trigger behavior. If you need absolute precision in counting kills, one way is to queue up the triggers so they execute in sequence rather than in parallel. Using the actions Trigger - Add trigger to queue and Trigger - remove this trigger from queue, you can avoid parallel triggers. If you are checking for a particular value, you can also try to check for a range of values instead.

Example of this problem:
Quote:
event - unit dies
actions -
1. kills[i] = kills[i] + 1;
2. update leaderboard
3. if (kills[i] mod 20 == 0) then spawn unit.

The unit never spawns even when kills reach and pass increments of 20s. It only happens occasionally and only in large battles. I suspect that the trigger executes past 1 and before 3 and the trigger fires again b/c another unit has died and it executes 1 before step 3 of the first trigger can execute. In some cases, it may produce incorrectly behavoir. i.e. kills is at 19, trigger fires, kills set to 20, trigger fires again before the check, and now kills is set to 21 when the check occurs. 20 happened too briefly for the check to kick in. Using Trigger - Add trigger to queue and Trigger - remove this trigger from queue should solve the problem of parallel triggers.

----------------------------------------------------------

There is also another problem that I think is caused by parallel triggers. It's hard for me to believe that Blizzard Devs did not take semaphores into account when implementing a multithreaded triggering system, but that is my assumption why the following problem occurs.

Using the same example as above:
Both triggers fire almost simultaneously. Trigger 1 reads the value of kills[i] and then it context switches to trigger 2. Trigger 2 reads the value of kills[i], adds 1, and write it back to memory. It context switches back to trigger 1. Trigger 1, using the old value since it already read it from memory, adds 1, and write it back to memory. We've just lost 1 kill even though we had 2.

If an action had to be ran until completion before a context switch is allowed, then this would not happen. If that is really how it's implemented, then the kill counting problem lies elsewhere. Again, queueing up the triggers will solve the problem. Most of the time, the leaderboard is just cosmetics anyway and it doesn't matter to be 100% accurate. In fact most people probably won't even notice that they lost 1 kill in 200. But there are some instances where it does cause big problems, that is why I wrote this huge reply :P.

I will update the leaderboard tutorial when I get a chance.
08-14-2002, 01:13 AM#8
Guest
actually, to make a unit act as a store, its better to use Blink and make a custom Ward. Because when using Select Hero on units, you gain control of them, well if you make a custom Sentry Ward, it doesnt matter becuase wards cant be moved and you can still use every slot for item purchase. plus, you dont get that pathing image floor thingy every bbuilding has, because its base isnt a a building, its a ward. Oh, and the custom ward should remove visibility, so when you do control it, you dont see invisible units.
08-22-2002, 05:24 AM#9
dataangel
There's some deep irony here....Ganon, that's already in the FAQ :P
08-25-2002, 02:37 PM#10
Guest
hes just pointing it out to ya :D
08-26-2002, 03:32 AM#11
Guest
The FAQ site won't load right now... don't know why.
08-28-2002, 04:10 PM#12
Guest
The FAQ site won't load for me either. Is it a dead link...?
08-29-2002, 10:00 AM#13
Guest
doesn't load..
09-01-2002, 03:50 AM#14
Guest
Are you going to fix the link? Just wonder i want to take a gander at it. :cool:
09-04-2002, 02:03 AM#15
dataangel
*Begin shameless plug*

Well, Unlucky_Footman, my host, had the power supply for his computer fry :P

So I need a new host!

*End shameless plug*