wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Project Discussion > Map / Campaign Projects
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 02-23-2015, 08:56 AM   #16
iNfraNe
PhD
 
iNfraNe's Avatar


Cinematics Moderator
 
Join Date: Dec 2003
Posts: 2,283

Submissions (7)

iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)

Approved Map: Mortar Ball

Send a message via MSN to iNfraNe
Default

Don't give up so easily! Use a model for the water instead (looks better anyway!).

If you just reverse the terrain deforms you did, wouldn't the terrain become flat again? Or maybe even... Does a new terrain deform "overwrite" the previous one?
__________________
Ever so slightly active.
Table:
Past Projects:
The Spirit of Vengeance (Cinematic, Blizzard contest winner)
Elimination Tournament
Mortar Ball

Last edited by iNfraNe : 02-23-2015 at 08:57 AM.
iNfraNe is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 02-23-2015, 11:16 AM   #17
Rao Dao Zao
www.raodaozao.net
 
Rao Dao Zao's Avatar


MDL & Resource Moderator
 
Join Date: Aug 2003
Posts: 2,511

Submissions (27)

Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)

Approved Map: When the Freedom Slips Away

Send a message via MSN to Rao Dao Zao
Default

Quote:
Originally Posted by iNfraNe
Don't give up so easily! Use a model for the water instead (looks better anyway!).
I've considered that, but I'm basically paranoid about the water animations not synchronising because each destructible is created a split second after the last (or more than a split second if I have to TriggerSleepAction to avoid the op limit).

I also can't do one large plane that covers the entire map, because destructibles are culled very aggressively once you can't see their origins. My solution to that would be to do it as a special effect underneath the player character (camlock means you could never see its edge), but then the water's ripples would move with them and look a bit weird.

At the end of the day, watery levels would be nice but I can live without them. The swamp in This Wreckage is famous for being difficult to navigate because it's so dank and fogged, so I'd love to bring that forward to here where you don't even have a meaningful minimap, but it's not a deal-breaker.

Quote:
Originally Posted by iNfraNe
If you just reverse the terrain deforms you did, wouldn't the terrain become flat again? Or maybe even... Does a new terrain deform "overwrite" the previous one?
According to an old post by Anitarf...
Quote:
Terrain deformations automaticaly dissapear when their duration ends; depending on if the deformation was set to permanent or not, the deformation dissapears completely or is replaced by a permanent terrain change. Either way, the "stop terrain deformation" action only works while a terrain deformation's duration is still running.

That makes sense against what I saw -- the destructibles were created at the correct height after the deformation had run out of duration and become "permanent". Although the trigger action says that permanent deformations won't be restored during save game load, there seems to be no way to clear them at this point.

Resetting them by applying a negative of the same deformation might work, but it sounds like a recipe for leaking -- after a few regenerated levels the world will be absolutely stacked with dead-but-not-dead deformations.
__________________
Rao Dao Zao is offline   Reply With Quote
Old 02-23-2015, 04:58 PM   #18
iNfraNe
PhD
 
iNfraNe's Avatar


Cinematics Moderator
 
Join Date: Dec 2003
Posts: 2,283

Submissions (7)

iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)

Approved Map: Mortar Ball

Send a message via MSN to iNfraNe
Default

Reversing the terraindeform seems to be working perfectly for me. I haven't noticed any lag with the script either (I'm not sure that the terraindeforms don't leak, but it seems to me that once they are done, they should be removed by the engine).

Load the map and simply press escape to create a new world!
Attached Files
File Type: w3x LandScaping.w3x (19.4 KB, 8 views)
__________________
Ever so slightly active.
Table:
Past Projects:
The Spirit of Vengeance (Cinematic, Blizzard contest winner)
Elimination Tournament
Mortar Ball
iNfraNe is offline   Reply With Quote
Old 02-23-2015, 05:15 PM   #19
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Heh, I started doing some testing before I read the last post from Rao, so I realized too late that I've tested all this before. :) Anyway, what I've seen so far is consistent with what I wrote in that post. What iNfraNe is suggesting should work, two terrain deformations with equal size and opposite depths will cancel each other out, provided that the first one has completed before the second one is applied.

GetHandleId shows no reuse of handle ids, so terrain deformations do appear to "leak". However, they don't use the main handle stack, their ids start from 0 instead, so this shouldn't be an issue.
__________________
Anitarf is offline   Reply With Quote
Old 02-23-2015, 06:12 PM   #20
iNfraNe
PhD
 
iNfraNe's Avatar


Cinematics Moderator
 
Join Date: Dec 2003
Posts: 2,283

Submissions (7)

iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)

Approved Map: Mortar Ball

Send a message via MSN to iNfraNe
Default

Quote:
Originally Posted by Anitarf
GetHandleId shows no reuse of handle ids, so terrain deformations do appear to "leak". However, they don't use the main handle stack, their ids start from 0 instead, so this shouldn't be an issue.
Unless there's a built in limit like for texttags
__________________
Ever so slightly active.
Table:
Past Projects:
The Spirit of Vengeance (Cinematic, Blizzard contest winner)
Elimination Tournament
Mortar Ball
iNfraNe is offline   Reply With Quote
Old 02-24-2015, 12:09 PM   #21
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

I didn't hit it (went above 1000 before I quit testing), but it's still possible it exists.
__________________
Anitarf is offline   Reply With Quote
Old 02-24-2015, 01:45 PM   #22
Rao Dao Zao
www.raodaozao.net
 
Rao Dao Zao's Avatar


MDL & Resource Moderator
 
Join Date: Aug 2003
Posts: 2,511

Submissions (27)

Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)

Approved Map: When the Freedom Slips Away

Send a message via MSN to Rao Dao Zao
Default

Quote:
Originally Posted by Anitarf
I didn't hit it (went above 1000 before I quit testing), but it's still possible it exists.
Well, in a 64x64 map, if I added say 10 large and soft deformations that would be 10 to create at the start and 10 to negate at the end -- even if 1000 is the limit that's 50 scenarios before things "might" start to fall apart.

My main problem right now is that, ~60 seconds of waiting for the terrain to generate results in a scenario that barely takes 4-5 minutes to complete. I don't really want your time playing the map to be 20% starting at a blank screen, so I need to either find more ways to populate each scenario (without extending the generation time even further) or somehow streamline my generators...
__________________
Rao Dao Zao is offline   Reply With Quote
Old 02-24-2015, 09:00 PM   #23
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Why does it take so long to generate the terrain?
__________________
Anitarf is offline   Reply With Quote
Old 02-25-2015, 08:21 AM   #24
Rao Dao Zao
www.raodaozao.net
 
Rao Dao Zao's Avatar


MDL & Resource Moderator
 
Join Date: Aug 2003
Posts: 2,511

Submissions (27)

Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)

Approved Map: When the Freedom Slips Away

Send a message via MSN to Rao Dao Zao
Default

Quote:
Originally Posted by Anitarf
Why does it take so long to generate the terrain?
The two longest parts are cellular automata iterations and critter population.

I have to TriggerSleepAction every so often to avoid going over the op limit and crashing out, which will be the cause of most of the waiting time (I do a wait 0.0 but I know that's not actually 0.0). I am fairly lazy in how I approach this; every iteration of some complex operation, I increment a "speed limit" counter, and once that reaches a threshold I reset it and call for a wait. The thresholds are based on anecdotal guesswork.

Cellular automata is expensive because you have to iterate over every tile (3600 iterations in this case), and for each tile query all of its neighbours, then perform some action -- doing this at least twice over the entire grid. Unfortunately the algorithm relies on advancing the current state of the grid, so I can't e.g. partition it and run several instances in parallel.

A lot of my other processes consume a lot of operations, too though -- enemy population relies on iterating over every tile again, checking if it's clear, deciding if there should be an enemy on it, then deciding which enemy to place. For critter/clutter placement, this relies on another smaller loop to decide which clutter to drop based on percentage ranges (so e.g. shrubs and flowers are more likely to be dropped than critter animals).

Though I measured it last night and it felt longer than it actually took; usually 22-24 seconds. As long as I can keep generation under 25 seconds, a few lines of cinematic intro dialogue should be able to fill the space.
__________________
Rao Dao Zao is offline   Reply With Quote
Old 02-25-2015, 08:30 AM   #25
iNfraNe
PhD
 
iNfraNe's Avatar


Cinematics Moderator
 
Join Date: Dec 2003
Posts: 2,283

Submissions (7)

iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)

Approved Map: Mortar Ball

Send a message via MSN to iNfraNe
Default

Quote:
Originally Posted by Rao Dao Zao
I have to TriggerSleepAction every so often to avoid going over the op limit and crashing out, which will be the cause of most of the waiting time (I do a wait 0.0 but I know that's not actually 0.0). I am fairly lazy in how I approach this; every iteration of some complex operation, I increment a "speed limit" counter, and once that reaches a threshold I reset it and call for a wait. The thresholds are based on anecdotal guesswork.
I think this method could use some improvement. Can't you use .evaluate() instead of using a wait? .evaluate() starts a new thread. That way you can just use an evaluate for every iteration.

Quote:
Originally Posted by Rao Dao Zao
Cellular automata is expensive because you have to iterate over every tile (3600 iterations in this case), and for each tile query all of its neighbours, then perform some action -- doing this at least twice over the entire grid. Unfortunately the algorithm relies on advancing the current state of the grid, so I can't e.g. partition it and run several instances in parallel.
Wc3 does not allow parallel computing, so you needn't worry about that.

Quote:
Originally Posted by Rao Dao Zao
A lot of my other processes consume a lot of operations, too though -- enemy population relies on iterating over every tile again, checking if it's clear, deciding if there should be an enemy on it, then deciding which enemy to place. For critter/clutter placement, this relies on another smaller loop to decide which clutter to drop based on percentage ranges (so e.g. shrubs and flowers are more likely to be dropped than critter animals).
Use the same method with .evaluate()

Quote:
Originally Posted by Rao Dao Zao
Though I measured it last night and it felt longer than it actually took; usually 22-24 seconds. As long as I can keep generation under 25 seconds, a few lines of cinematic intro dialogue should be able to fill the space.
This is of course always a good idea :)
__________________
Ever so slightly active.
Table:
Past Projects:
The Spirit of Vengeance (Cinematic, Blizzard contest winner)
Elimination Tournament
Mortar Ball
iNfraNe is offline   Reply With Quote
Old 02-25-2015, 09:21 AM   #26
Rao Dao Zao
www.raodaozao.net
 
Rao Dao Zao's Avatar


MDL & Resource Moderator
 
Join Date: Aug 2003
Posts: 2,511

Submissions (27)

Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)

Approved Map: When the Freedom Slips Away

Send a message via MSN to Rao Dao Zao
Default

Quote:
Originally Posted by iNfraNe
I think this method could use some improvement. Can't you use .evaluate() instead of using a wait? .evaluate() starts a new thread. That way you can just use an evaluate for every iteration.
Hmm, I have never heard of evaluate(). Remember that I am using plain old Jass here!

I figured I might be able to use ExecuteFunc, but word on the street is that the function passed in can't take any parameters -- how could I use that for a single iteration if I can't pass in the boundary conditions?
__________________
Rao Dao Zao is offline   Reply With Quote
Old 02-25-2015, 10:45 AM   #27
iNfraNe
PhD
 
iNfraNe's Avatar


Cinematics Moderator
 
Join Date: Dec 2003
Posts: 2,283

Submissions (7)

iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)

Approved Map: Mortar Ball

Send a message via MSN to iNfraNe
Default

ah the good old plain jass. Any specific reason as to why you would do that (to yourself)?

You can use ExecuteFunc, but it is rather dangerous (and slower? Ani?) than .evaluate or .execute in vjass. What these functions are in plain jass is executing or evaluating a trigger. So you would be able to do the same using a trigger and call TriggerEvaluate(trigger).

The way to pass variables is by globals. If needed (unlikely, since we want to avoid waits here) we can transform them into locals inside the trigger again.
__________________
Ever so slightly active.
Table:
Past Projects:
The Spirit of Vengeance (Cinematic, Blizzard contest winner)
Elimination Tournament
Mortar Ball

Last edited by iNfraNe : 02-25-2015 at 10:45 AM.
iNfraNe is offline   Reply With Quote
Old 02-25-2015, 11:15 AM   #28
Rao Dao Zao
www.raodaozao.net
 
Rao Dao Zao's Avatar


MDL & Resource Moderator
 
Join Date: Aug 2003
Posts: 2,511

Submissions (27)

Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)

Approved Map: When the Freedom Slips Away

Send a message via MSN to Rao Dao Zao
Default

Quote:
Originally Posted by iNfraNe
ah the good old plain jass. Any specific reason as to why you would do that (to yourself)?
Mostly irrational fear of 3rd party editors, the usual. I'm well aware that it's daft but at this point I'm most comfortable sticking to my hybrid GUI/plain jass mode than learning something new.

Quote:
Originally Posted by iNfraNe
So you would be able to do the same using a trigger and call TriggerEvaluate(trigger).

The way to pass variables is by globals. If needed (unlikely, since we want to avoid waits here) we can transform them into locals inside the trigger again.
Hmm, so it's not so much an asynchronous function call, but just running the same trigger many times in sequence? Every time I hit my speed-limit threshold, I'd exit the current loop, save the position in globals, then run the same trigger again?

Might take some wrangling to work that into my current setup (it's a straight string of function calls) but if the performance improvement is tangible then it'll be worth it.
__________________

Last edited by Rao Dao Zao : 02-25-2015 at 11:19 AM.
Rao Dao Zao is offline   Reply With Quote
Old 02-25-2015, 01:01 PM   #29
iNfraNe
PhD
 
iNfraNe's Avatar


Cinematics Moderator
 
Join Date: Dec 2003
Posts: 2,283

Submissions (7)

iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)iNfraNe is just really nice (266)

Approved Map: Mortar Ball

Send a message via MSN to iNfraNe
Default

I wouldnt use the op-limit threshold, but instead just transfer big functions to triggerexecute calls. That way you dont need overhead code to keep track of stuff.

For example, you could put every iteration in a trigger, and use a loop in the "main" code. (If it can handle 3600 triggerevaluates, which I think should be okay). If not, you could use a split in the main loop until it functions.
__________________
Ever so slightly active.
Table:
Past Projects:
The Spirit of Vengeance (Cinematic, Blizzard contest winner)
Elimination Tournament
Mortar Ball
iNfraNe is offline   Reply With Quote
Old 02-25-2015, 01:10 PM   #30
Rao Dao Zao
www.raodaozao.net
 
Rao Dao Zao's Avatar


MDL & Resource Moderator
 
Join Date: Aug 2003
Posts: 2,511

Submissions (27)

Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)Rao Dao Zao has a brilliant future (822)

Approved Map: When the Freedom Slips Away

Send a message via MSN to Rao Dao Zao
Default

Quote:
Originally Posted by iNfraNe
I wouldnt use the op-limit threshold, but instead just transfer big functions to triggerexecute calls. That way you dont need overhead code to keep track of stuff.

For example, you could put every iteration in a trigger, and use a loop in the "main" code. (If it can handle 3600 triggerevaluates, which I think should be okay). If not, you could use a split in the main loop until it functions.
But if I put the TriggerEvaluate in some main loop, will that outer loop "wait" for the TriggerEvaluate iteration to be done before moving on to the next one? Order is important for many of these operations, they do have to occur in sequence -- if two iterations executed out of order it would affect the cellular automata algorithm at least (though I think my enemy/critter population stuff wouldn't mind).

Or will storing the iteration index in a global variable just take care of that?
__________________
Rao Dao Zao is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:22 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services