HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

thread/string limit-game crash-please help

08-03-2006, 11:02 AM#1
James1654
Sorry for long title. I tried to fit in as much as I thought would be necesary for someone who understands the subjects to see. Basically, my game crashes at 75 seconds into the game. These three triggers are responsible but very necesary for the game to be playable.


As unstable as TNT, the below is a necesary evil to create a massive amount of necesary rocks.
Trigger:
rock
Collapse Events
Map initialization
Conditions
Collapse Actions
Collapse For each (Integer A) from 1 to 10, do (Actions)
Collapse Loop - Actions
Set rockpoints[1] = (rockpoints[1] offset by (45.00, 0.00))
Destructible - Create a Rock Chunks at rockpoints[1] facing (Random angle) with scale 0.40 and variation (Random integer number between 0 and 5)
Set rockpoints[2] = (rockpoints[1] offset by (0.00, -45.00))
Collapse For each (Integer B) from 1 to 192, do (Actions)
Collapse Loop - Actions
Destructible - Create a Rock Chunks at rockpoints[2] facing (Random angle) with scale 0.40 and variation (Random integer number between 0 and 5)
Set rockpoints[3] = (rockpoints[2] offset by (0.00, -45.00))
Custom script: call RemoveLocation (udg_rockpoints[2])
Set rockpoints[2] = (rockpoints[3] offset by (0.00, -45.00))
Custom script: call RemoveLocation (udg_rockpoints[3])
Wait 240.00 seconds
Custom script: call DestroyTrigger(GetTriggeringTrigger())


The below was to avoid the thread/string limit
Trigger:
run rock
Collapse Events
Time - Every 3.50 seconds of game time
Conditions
Collapse Actions
Trigger - Run rock <gen> (ignoring conditions)
Wait 240.00 seconds
Custom script: call DestroyTrigger(GetTriggeringTrigger())


The below was made to try to give the triggers abit of a "rest". Before this, the game would crash at 57 seconds. with it, it crashes at about 77 seconds. That means it added 10 seconds to the time until my trigger got overloaded (not including the sleeping time)
Trigger:
pausecycle
Collapse Events
Time - Every 50.00 seconds of game time
Conditions
Collapse Actions
Trigger - Turn off run rock <gen>
Wait 15.00 seconds
Trigger - Turn on run rock <gen>
Wait 50.00 seconds
Custom script: call DestroyTrigger(GetTriggeringTrigger())


Any ideas? I will give reputation(if posible) for any help at all on the matter.
08-03-2006, 12:15 PM#2
Hemlock
This just looks plain insane, not only do you do for each integer from 1 to 10 and from 1 to 192 (which is 1920 loops) you forget to remove a few memory leaks as well, and that all every 3.5 seconds.

This is not healthy for your map
08-03-2006, 12:24 PM#3
Valdez
Might I ask why exactly you need that many rocks? I mean I've heard of having alot, but seriously thats like an insane amount.

IMO- Your problem might not be exactly your triggers..it could be that your making too many rocks and going over the doodad limit, I don't know if it matters in game tho, but just a thought.

Another thing that might help, instead of usin Map Initialization, try using Elapsed Game Time.
08-03-2006, 07:23 PM#4
James1654
erm, the map really needs the rocks. Anyway, i will remove memory leaks once the trigger works. It should crate about 100,000 rocks in a few minuits when its working. Insane, but a necesary evil.
08-03-2006, 08:06 PM#5
Captain Griffen
Probably the threads crash due to it thinking it is an infinite loop. Also, you should use game time waits.

Anyway, you destroy the trigger multiple times. Not a clever idea.
08-03-2006, 08:27 PM#6
The)TideHunter(
Make sure its not a thread limit.
It could be your placing a rock outside playable map area, which will cause a crash.
08-04-2006, 03:29 PM#7
James1654
it will only destroy itself once, and after that, the other qued actions will also be destroyed, including the qued destroy actions. I dont think it is outside playable area, because it does it like ud mow the lawn


OOOOPPPPPP O = rocks
OOOOPPPPPP P = not rocks
OOOOPPPPPP
OOOOPPPPPP (not to scale)

It lays em in columns like that, until all is done. It does about 22 columns of 2000 before it crashes. So, at about 44,000 rocks, it gets pissed off at me. Do you think if i gave the world editor a 30 seconds breathing time after the first 40,000, instead of a 10 second breathing time, the map would not hate me anymore? Or does it have nothing to do with the game overloading due to mass triggers in too short a time? Maybe something more sinister, more evil, like:

ARRRGH! My world editor is not working!
08-04-2006, 03:35 PM#8
The)TideHunter(
To be honest, now i think about it, 100000 rocks will cause severe lag, and it would be a thread limit.
After each 5000-10000 give it a breather of 5 seconds.
But i warn you, 100000 is asking for trouble.
Wc3 might not even be able to process that much memory, its really taking a risk.
08-04-2006, 03:43 PM#9
Captain Griffen
Quote:
Originally Posted by James1654
it will only destroy itself once, and after that, the other qued actions will also be destroyed, including the qued destroy actions.

It WILL try to destroy it multiple times, and this will almost certainly cause issues.
08-04-2006, 09:33 PM#10
James1654
Maybe the severe lag caused will be fun :) . Anyway, I will make the trigger run every 5 econd, and as shit load of minigame and crap to amuse players whilst the rocks set up btw, my "s" key i **cked, i need to press it like 2-3 timesss to get a bloody "s" (FF, that pied me off). I will alo add hit load of breather.

p. : any idea on how to get my "" key to work . . . (not eriouly, i will get it working myelf)

Anyway, i will call back here ometime tomorow if it my trigger till dont work and crahe.
08-04-2006, 10:35 PM#11
masda70
Try this as your main trigger and don't use any others: X is the number of iterations to do, and Y is a number smaller than X which is the max number of iterations that can be done before the thread dies.
X probably a high number.
A good Y will probably be 10 considering the example you gave us. Experiment with different values.

Trigger:
rock
Collapse Events
Time - Elapsed game time is 0.01 seconds
Conditions
Collapse Actions
Collapse For each (ITERATION) from 1 to X, do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((ITERATION) mod Y) Equal to 0
Collapse Then - Actions
Wait 0.00 seconds
Else - Actions
//DO the STUFF (Rock making)

EDIT: Oh yea, integer A is a global, make a new global integer (I called it ITERATION in the example) and use that instead for looping (can you do that with GUI?).
08-04-2006, 11:25 PM#12
Captain Griffen
Suggest you start new threads to avoid the limit.

Oh, and integer A is a global.