• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Red Horizons map - help with increasing performance

Status
Not open for further replies.
Level 5
Joined
Jul 10, 2009
Messages
89
I've been working on this map for over a year, and I've accumulated lots and lots of triggers. I am worried that the amount of custom data and possibly inefficient (leaking?) triggers has begun to cause slowdown.

Would anyone mind looking over my map to see if I can optimize anything?
 

Attachments

  • (4) Whirlwind.w3x
    233.5 KB · Views: 66
Level 6
Joined
May 20, 2010
Messages
94
Okay, here we go. :psmile:

First of all, you should check this tutorial: Basic Memory Leaks

Basically, it says you have to store every Point, UnitGroup and PlayerGroup in a variable. You use the variable and after you finished with it, you need to add a Custom Script to remove them. Just check the tutorial, it's not really complex. But I'm a nice fellow and I'll give you an example.

It's from the trigger "Paladin Chance" and leaks 1 point.

  • For each (Integer A) from 2 to 2, do (Actions)
    • Loop - Actions
      • Unit - Create 1 Paladin Foot for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Sound - Play GarithosYes3 <gen> at 100.00% volume, attached to (Last created unit)
      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Set life of (Triggering unit) to 50.00%
      • Animation - Play (Last created unit)'s victory animation
Should be like this:
  • For each (Integer A) from 2 to 2, do (Actions)
    • Loop - Actions
      • Set Point_Variable = (Position of (Triggering unit))
      • Unit - Create 1 Paladin Foot for (Owner of (Triggering unit)) at Point_Variable facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Point_Variable)
      • Sound - Play GarithosYes3 <gen> at 100.00% volume, attached to (Last created unit)
      • Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Set life of (Triggering unit) to 50.00%
      • Animation - Play (Last created unit)'s victory animation

This is from your trigger "Pray for Angel"

  • For each (Integer A) from 2 to 2, do (Actions)
    • Loop - Actions
      • Unit - Create 1 Arch Angel for (Owner of (Triggering unit)) at (Random point in (Playable map area)) facing Default building facing degrees
      • Sound - Play LightningBolt1 <gen> at 100.00% volume, attached to (Last created unit)
      • Special Effect - Create a special effect at (Position of (Last created unit)) using war3mapImported\Judgement.mdx
      • Wait 4.00 seconds
      • Special Effect - Destroy (Last created special effect)
      • Wait 120.00 seconds
      • Unit - Remove (Random unit from (Units of type Arch Angel)) from the game

First of all, I do not recommend using wait, but you would need to learn mui to get rid of them. Second, there is 1 point leak again. Third, you should immediately destroy special effect, never use waits between these two actions. You will need to store the special effect in a variable, if you want to destroy it later.
This is from "Dragon Death"

  • Then - Actions
    • Unit - Remove (Triggering unit) from the game
    • Special Effect - Create a special effect at (Position of (Triggering unit)) using war3mapImported\BigBloodEX-NoSplat-NoGutz-2.mdx
    • Special Effect - Create a special effect at (Position of (Triggering unit)) using Objects\Spawnmodels\Orc\OrcLargeDeathExplode\OrcLargeDeathExplode.mdl
    • Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 256.00 towards 90.00 degrees) using Objects\Spawnmodels\Orc\OrcLargeDeathExplode\OrcLargeDeathExplode.mdl
    • Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by 128.00 towards 45.00 degrees) using Objects\Spawnmodels\Orc\OrcLargeDeathExplode\OrcLargeDeathExplode.mdl
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Destroy (Last created special effect)
    • Item - Create Dragon Gold at (Position of (Triggering unit))
    • Player - Disable Dragon King for (Owner of (Dying unit))
This doesn't work, they all refer to the same special effect. This trigger should be:
  • Then - Actions
    • Set Point_Variable = (Position of (Triggering unit))
    • Unit - Remove (Triggering unit) from the game
    • Special Effect - Create a special effect at Point_Variable using war3mapImported\BigBloodEX-NoSplat-NoGutz-2.mdx
    • Special Effect - Destroy (Last created special effect)
    • Special Effect - Create a special effect at Point_Variable using Objects\Spawnmodels\Orc\OrcLargeDeathExplode\OrcLargeDeathExplode.mdl
    • Special Effect - Destroy (Last created special effect)
    • Item - Create Dragon Gold at Point_Variable
    • Custom script: call RemoveLocation(udg_Point_Variable)
    • -------- ------------Set a new point------------- --------
    • Set Point_Variable = ((Position of (Triggering unit)) offset by 256.00 towards 90.00 degrees)
    • Special Effect - Create a special effect at Point_Variable using Objects\Spawnmodels\Orc\OrcLargeDeathExplode\OrcLargeDeathExplode.mdl
    • Special Effect - Destroy (Last created special effect)
    • Custom script: call RemoveLocation(udg_Point_Variable)
    • -------- ------------Set a new point------------- --------
    • Set Point_Variable = ((Position of (Triggering unit)) offset by 128.00 towards 45.00 degrees)
    • Special Effect - Create a special effect at Point_Variable using Objects\Spawnmodels\Orc\OrcLargeDeathExplode\OrcLargeDeathExplode.mdl
    • Special Effect - Destroy (Last created special effect)
    • Custom script: call RemoveLocation(udg_Point_Variable)
    • Player - Disable Dragon King for (Owner of (Dying unit))
This is from "Sea Pillage"

  • Then - Actions
    • Wait 0.20 seconds
    • Player - Add -50 to (Owner of (Attacked unit)) Current gold
    • Player - Add 50 to (Owner of (Attacking unit)) Current gold
    • Floating Text - Create floating text that reads Plundered 50 gold above (Attacking unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Wait 0.01 seconds
    • Floating Text - Change (Last created floating text): Disable permanence
    • Wait 0.01 seconds
    • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
You don't need to add these waits between the floating text actions.
This is from "Get Knockback"

  • Events
    • Time - Every 0.02 seconds of game time
Should be something between 0.03 and 0.04. Performs better and makes totally no difference.


Check the tutorial, learn how to remove leaks and go through all your triggers.

One other point: You have many triggers only to attach one single special effect. You could make this in 1 trigger with if/then/else conditions.

PS: Check the triggers in folder "Command Move". I don't know who made them, but they are 100% leakfree. :infl_thumbs_up:
 
Status
Not open for further replies.
Top