HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Issues with lightning effects?

03-18-2008, 06:27 AM#1
Ammorth
Has anyone had problems with lightning effects before?

I have seem to run into a problem with the game doesn't allocate enough handles for lightning effects. It seems it reaches 2000 or so and then no more lightning effects. I was hoping for at least 12960, since they work wonderful in displaying walls of a maze (don't have to deal with facing and all that jass, just give it 2 points and it does the rest; they also seem noticeably faster at creating and removing, compared to units and the like).

Any way to maybe increase the number of lightning effects the game will generate or anything else I could use in-place of lightning effects (besides units/destructables/etc.)?
Attached Images
File type: jpgLightningMaze.jpg (171.2 KB)
03-18-2008, 06:53 AM#2
Pyrogasm
Mayhaps you forgot about the Op limit and you've hit it through various function calls (not just lightning creation).

On a side-note, you could try using images instead of lightning effects.
03-18-2008, 07:55 AM#3
Ammorth
Quote:
Originally Posted by Pyrogasm
Mayhaps you forgot about the Op limit and you've hit it through various function calls (not just lightning creation).
Sadly, I am not. I am using .execute() for each lightning since I doubt I would make them all in the script I intended them to all exist in.

Quote:
Originally Posted by Pyrogasm
On a side-note, you could try using images instead of lightning effects.
I though about that but I'm scared I'll run into the same handle allocation issues as lightnings, since they are way less supportive. And then I need to change my calculations again, which I'm too lazy to do right now.

In the end, I'll probably use destructables or something of the like, but while testing, I would like something pain-free.

Edit: After further testing, it seems like I can go past the limit, but not in the same parent thread (requires a timer). Even execute function won't allow more (maybe some internal handle protection limit to prevent cpu flooding). I'll look into it more in the morning.
03-18-2008, 07:59 AM#4
Rising_Dusk
Why does your algorithm only create itty bitty pieces of a wall? Couldn't you optimize that system to generate longer walls where applicable and only use shorter ones as necessary? Otherwise, I don't think anyone (That I'm aware of) has played with lightning effects on the level of creating a couple thousand.
03-18-2008, 11:50 AM#5
Toadcop
Quote:
Edit: After further testing, it seems like I can go past the limit, but not in the same parent thread (requires a timer). Even execute function won't allow more (maybe some internal handle protection limit to prevent cpu flooding). I'll look into it more in the morning.
!!! yeah i know this feature ! it's the same with units. you can call CreateUnit every 0.01 of sec. but war3 will create only couple of units ~10 (-) it's begins after 2K+ of units
so yes you maybe right. butif you will create this lightning dynamicaly it will be odd =)
yes imho the only solution is a timer (which will create lightnings pereodicaly).

anyway i don't know why you need so much lightnings but "your concept" does suck =)
03-18-2008, 03:07 PM#6
Ammorth
Quote:
Originally Posted by Rising_Dusk
Why does your algorithm only create itty bitty pieces of a wall? Couldn't you optimize that system to generate longer walls where applicable and only use shorter ones as necessary? Otherwise, I don't think anyone (That I'm aware of) has played with lightning effects on the level of creating a couple thousand.

I want the system to be generic as it can use anything as a wall, all I have to do is change the creation/removal function.

Quote:
Originally Posted by Toadcop
!!! yeah i know this feature ! it's the same with units. you can call CreateUnit every 0.01 of sec. but war3 will create only couple of units ~10 (-) it's begins after 2K+ of units
so yes you maybe right. butif you will create this lightning dynamicaly it will be odd =)
yes imho the only solution is a timer (which will create lightnings pereodicaly).

Ya, thats seems like the only approach (somehow spread the lightnings around).

Quote:
Originally Posted by Toadcop
anyway i don't know why you need so much lightnings but "your concept" does suck =)

It was based off the Depth-First-Search Algorithm (which can be seen here: http://www.mazeworks.com/mazegen/ ).

I came up with an idea to better create the walls so I don't have to remove them to make the maze. Going to implement and test it now (amazing what a good night sleep gives you).


Edit: Implemented my new idea and it works flawlessly. Still works off the DFS algorithm, but only adds walls and never removes them. Generated a 90x91 maze and it took just under 1 second to create the cells in memory and approx 1 sec to generate the map and draw the walls (doing 500 passes every 0.01 warcraft seconds).