(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Modding > Triggers & Scripts

Triggers & Scripts Discussions regarding GUI triggers & JASS/AI scripts may be found here. Please review the » JASS Tutorials » Trigger Tutorials

Reply
 
LinkBack Thread Tools Display Modes
Old 10-16-2008, 04:40 AM   #1 (permalink)
 
Cokemonkey11's Avatar

Winning is for winners.
 
Join Date: May 2006
Posts: 280

Cokemonkey11 has little to show at this moment (15)Cokemonkey11 has little to show at this moment (15)


Can a loop occur more than 8000 times?

Referring to this post:

http://www.hiveworkshop.com/forums/876954-post6.html

My question is, if it isn't an infinite loop, and instead very large reoccuring one, can I do

exitwhen i > 7999
set i = i + 1

Or will that be recognized as an infinite loop and canceled?
__________________
Cokemonkey11 is offline   Reply With Quote
Old 10-16-2008, 05:25 AM   #2 (permalink)
 
spiwn's Avatar

Fast Learning retard
 
Join Date: Apr 2008
Posts: 1,064

spiwn will become famous soon enough (91)spiwn will become famous soon enough (91)spiwn will become famous soon enough (91)


Infinite loops are not ones that have more than 8k executions. This is a very varing thing.
Put simply if wc3 executes too much code between frame rendering(i.e. in one function(thread) without triggersleepaction calls) it will just crash. Grimmore has a nice feature war3err which tracks how much code has been executed in between frames and if it is too much, it terminates the code, keeping wc3 stable and telling you where the error is(Reached OP limit in function blah)(this is only for map testing).
There is almost no point in doing that(i<7999) - 8k will do only if the loop is empty(for instance) and it is just simpler not to make infinite/long loops.
__________________

Use the reputation system for people you think deserve it.
Bux.to - Get Money for viewing ads

Last edited by spiwn; 10-16-2008 at 01:29 PM.
spiwn is online now   Reply With Quote
Old 10-16-2008, 08:32 PM   #3 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,900

PurplePoot is a name known to all (732)PurplePoot is a name known to all (732)PurplePoot is a name known to all (732)PurplePoot is a name known to all (732)PurplePoot is a name known to all (732)

Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

It doesn't crash normally, it just halts the thread.
PurplePoot is online now   Reply With Quote
Old 10-16-2008, 11:01 PM   #4 (permalink)
 
HappyTauren's Avatar

EmoTauren (-.\\)
 
Join Date: Nov 2006
Posts: 6,601

HappyTauren has much of which to be proud (965)HappyTauren has much of which to be proud (965)HappyTauren has much of which to be proud (965)HappyTauren has much of which to be proud (965)HappyTauren has much of which to be proud (965)


Infinite loops crash depending on how much memory wc3 uses. Once it's got some certain amount, it crashes. When you infinite loop, you make the processor lag more and more, to the point where it is unberable, and it crashes... so it varies. It is also important WHAT is in the loop, if it is just set i = i + 1 than you'd need MANYMANY loops to crash, if you create unit each time, you won't need more than 10000 loops before crash.
__________________
HappyTauren is online now   Reply With Quote
Old 10-16-2008, 11:16 PM   #5 (permalink)

I own you. Get over it.
 
Join Date: Aug 2005
Posts: 2,445

Eleandor is just really nice (295)Eleandor is just really nice (295)Eleandor is just really nice (295)Eleandor is just really nice (295)Eleandor is just really nice (295)


Quote:
Originally Posted by HappyTauren View Post
Infinite loops crash depending on how much memory wc3 uses. Once it's got some certain amount, it crashes. When you infinite loop, you make the processor lag more and more, to the point where it is unberable, and it crashes... so it varies. It is also important WHAT is in the loop, if it is just set i = i + 1 than you'd need MANYMANY loops to crash, if you create unit each time, you won't need more than 10000 loops before crash.
I doubt it. When the OP limit is reached, the thread is halted. When you have a loop creating a unit each time, the OP limit will be reached faster and it still will not crash.
__________________
Warcraft 3 is full of bugs since the last patch... meh...
"Waiting for host" in Single Player ?!?
Eleandor is online now   Reply With Quote
Old 10-16-2008, 11:20 PM   #6 (permalink)
 
HappyTauren's Avatar

EmoTauren (-.\\)
 
Join Date: Nov 2006
Posts: 6,601

HappyTauren has much of which to be proud (965)HappyTauren has much of which to be proud (965)HappyTauren has much of which to be proud (965)HappyTauren has much of which to be proud (965)HappyTauren has much of which to be proud (965)


infinite loop doesn't crash for you? Strangely enough, it does for me.
__________________
HappyTauren is online now   Reply With Quote
Old 10-17-2008, 12:32 AM   #7 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,900

PurplePoot is a name known to all (732)PurplePoot is a name known to all (732)PurplePoot is a name known to all (732)PurplePoot is a name known to all (732)PurplePoot is a name known to all (732)

Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

A non-threaded infinite loop simply halts the thread it's in. A threaded infinite loop (say, a trigger firing itself), however, does crash warcraft, as there is no clear point to stop it.
PurplePoot is online now   Reply With Quote
Old 10-17-2008, 05:03 AM   #8 (permalink)
 
Cokemonkey11's Avatar

Winning is for winners.
 
Join Date: May 2006
Posts: 280

Cokemonkey11 has little to show at this moment (15)Cokemonkey11 has little to show at this moment (15)


Good to know thank you I get it now, its not about a loop firing 8000+ times, it's just sort of wc3 recognizing too much information passing.

+reps of course
__________________
Cokemonkey11 is offline   Reply With Quote
Old 10-17-2008, 10:25 AM   #9 (permalink)
 
Captain Griffen's Avatar

******
 
Join Date: Nov 2005
Posts: 751

Captain Griffen is a jewel in the rough (238)Captain Griffen is a jewel in the rough (238)Captain Griffen is a jewel in the rough (238)


Quote:
Originally Posted by Eleandor View Post
I doubt it. When the OP limit is reached, the thread is halted. When you have a loop creating a unit each time, the OP limit will be reached faster and it still will not crash.
An infinite loop creating a new unit each time would crash the game due to excessive units long before the op limit of 300,000 op calls was reached.
__________________
Quote:
[20-00-13] MasterHaosis: Because I am retarded douchebag
[20-15-23] MasterHaosis: I am faggot, retard and such..
[20-21-22] MasterHaosis: because I am chat moderator. And you dont have right to speak against me
~Void~: Knock it off, for fuck's sake. Get that bullshit out of your signature and stop being so immature. Let it die out.
Captain Griffen is offline   Reply With Quote
Old 10-17-2008, 02:22 PM   #10 (permalink)

I own you. Get over it.
 
Join Date: Aug 2005
Posts: 2,445

Eleandor is just really nice (295)Eleandor is just really nice (295)Eleandor is just really nice (295)Eleandor is just really nice (295)Eleandor is just really nice (295)


Quote:
Originally Posted by Captain Griffen View Post
An infinite loop creating a new unit each time would crash the game due to excessive units long before the op limit of 300,000 op calls was reached.
I've actually done this. Well, not an infinite loop, but a loop from 1 to 32k creating 1 unit per iteration. Warcraft 3 didn't crash, only a few thousand units were actually created before the OP limit was reached and the thread was halted. Then I've added sleep actions every 1000 iterations and 32K units were created, without any crash. Granted, it was pretty laggy, but that's not to the point.
__________________
Warcraft 3 is full of bugs since the last patch... meh...
"Waiting for host" in Single Player ?!?
Eleandor is online now   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Trigger] use a taver only 2 times? U.A.MEDIC Triggers & Scripts 15 06-17-2008 02:21 PM
Dark Times & Good Times Ralle Latest Updates and News 264 05-19-2008 07:49 AM
Bad Times, Good Times Ralle Latest Updates and News 13 01-05-2007 08:24 PM

All times are GMT. The time now is 09:25 PM.






Your link here 
Per Insurance | Property for sale in Spain | Facebook proxy list | Internet Advertising | Bad Credit Mortgages
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle