• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Map slowing down

Status
Not open for further replies.
Level 3
Joined
Sep 9, 2009
Messages
658
I'm making this map. But recently, it's slowing down every time I add new spells for it.

The spells work fine in an empty map so I don't think they're the cause of the problem.

I tried running the map with most of the scripts off except for the two spells. It still slows down.

Anyone know what could be the problem?
 

Attachments

  • Frozen Throne.w3x
    11.2 MB · Views: 48
I haven't checked it, but as you describe it, it's probably a case of "event polution".

Do your spells create and destroy a lot of units (dummies)?
If so, do you have any death/EnterRegion triggers with heavy weight?

Also, check your scripts for leaks if the lag builds up over time. Please don't expect us to do the dirty work for you; if you need help with a specific trigger, post it here, but we won't clean your map of leaks for you.


Also, your map is pretty huge with 11MB. You have a lot of imported models, I assume? Check out their poly counts then. A lot of the custom models on Hive and XGM are poorly optimized and have way more particles/polys than they need.
 
Level 3
Joined
Sep 9, 2009
Messages
658
I'm not asking for anyone to do the dirty work. I simply ask that someone look at the map and and give some insights on what could be wrong.

None of my spells create a lot of dummies except for one. And that one doesn't slowdown the game. Actually, none of the earlier spells I made slowdown the game.

As for EnterRegion, I have a few. Most of them for opening gates and one for healing units.

I use PhysicalDamageEngine by lookingforhelp, a trigger which shows damage done as floating text. And a multiboard trigger that shows the kills and hero kills.

Lastly, I have a trigger that spawns units on a command. Even then I tried disabling all of them except for the new spells and the map still slows down.

I'm not asking for someone to check what trigger leaks and to fix it. Because it appears they don't. At least not on a level to amke a significant difference because the problem persists even if I turn them off.

The high file size of the map is more because of skins than models. There're a few WoW rips installed but it's just a WoW Frost Wyrm, WoW Lich, Lady Deathwhisper, the Frozen Throne, and the Wrathgate. None of them were slowing the game down. It only started when I tried to test a new spell. Thinking that was the problem, I pasted it on an empty map, and no performance issues were observed.

I tried to make another spell. And the game slows down. So probably there's something else. I just don't know what.

The slowdown only occurs after I use newly made spells.

EDIT: There's also a periodic event to heal and revive trees as well as increase the gold in gold mines but turning it off didn't help with the slowdown.
 
Level 3
Joined
Sep 9, 2009
Messages
658
I don't think leaks are going to be a problem when I have this much turned off.

But yes, I have those kinds of leaks removed.

attachment.php
 

Attachments

  • Triggers Off.png
    Triggers Off.png
    26.9 KB · Views: 91
Level 25
Joined
May 11, 2007
Messages
4,651
Can you post the trigger of the spell?
Does the spell use any custom models that perhaps are not removed properly by the modeller? (Death animations, etc)

Does the game work properly when trying other maps?
 
Level 3
Joined
Sep 9, 2009
Messages
658
JASS:
scope Shockwave initializer Init
    globals
        private constant integer AID = 'A009'
        private constant integer SHOCKWAVE = 'e005'
        private constant real MISSILE_SPEED = 1200
        private constant real TICK = 0.03
        private constant real OFFSET = MISSILE_SPEED * TICK
        private constant real MAX_DISTANCE = 600
        private constant string A = "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl"
        private constant group GROUP = CreateGroup()
    endglobals
    
    private function Damage takes unit u returns real
        return I2R(GetUnitAbilityLevel(u, AID)) * 4000
    endfunction
    
    private function Kill takes nothing returns nothing
        local unit e = GetEnumUnit()        
        call KillUnit(e)        
        set e = null
    endfunction
    
    private function Callback takes nothing returns nothing
        local timer t = GetExpiredTimer()
        local integer id = GetHandleId(t)
        local unit u = LoadUnitHandle(udg_Hash, id, 0)
        local unit e = GetEnumUnit()
        local unit f
        local real x = GetUnitX(e)
        local real y = GetUnitY(e)
        local real facing = GetUnitFacing(e) * bj_DEGTORAD
        local real px = x + OFFSET * Cos(facing)
        local real py = y + OFFSET * Sin(facing)
        
        call DestroyEffect(AddSpecialEffect(A, x, y))
        call SetUnitX(e, px)
        call SetUnitY(e, py)
        
        set u = null
        set t = null
        set e = null
    endfunction
    
    private function Periodic takes nothing returns nothing
        local timer t = GetExpiredTimer()
        local integer id = GetHandleId(t)
        local unit u = LoadUnitHandle(udg_Hash, id, 0)
        local group g = LoadGroupHandle(udg_Hash, id, 1)
        local real CURRENT_DISTANCE = LoadReal(udg_Hash, id, 2)
        
        if CURRENT_DISTANCE <= MAX_DISTANCE then
            call ForGroup(g, function Callback)
        else
            call ForGroup(g, function Kill)
            call PauseTimer(t)
            call DestroyTimer(t)
            call DestroyGroup(g)
            call FlushChildHashtable(udg_Hash, id)
        endif
        
        call SaveReal(udg_Hash, id, 2, CURRENT_DISTANCE + OFFSET)
        set t = null
        set u = null
        set g = null
    endfunction
    
    private function Actions takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local unit s
        local timer t = CreateTimer()
        local integer id = GetHandleId(t)
        local group g = CreateGroup()
        local player p = GetOwningPlayer(u)
        local real x = GetUnitX(u)
        local real y = GetUnitY(u)
        local real tx = GetSpellTargetX()
        local real ty = GetSpellTargetY()
        local real dx = tx - x
        local real dy = ty - y
        local real distcheck = (dx * dx) + (dy + dy)
        local real facing
        local real px
        local real py
        local integer i = 1
        
        if distcheck > 100 * 100 then
            set facing = Atan2(dy, dx)
        else
            set facing = GetUnitFacing(u) * bj_DEGTORAD
        endif
        
        set facing = facing + 0.523
        loop
            exitwhen i > 3
                set px = x + 100 * Cos(facing)
                set py = y + 100 * Sin(facing)
                set s = CreateUnit(p, SHOCKWAVE, px, py, facing * bj_RADTODEG)
                call GroupAddUnit(g, s)
                set facing = facing - 0.523
                set i = i + 1
                set s = null
        endloop
        
        call SaveUnitHandle(udg_Hash, id, 0, u)
        call SaveGroupHandle(udg_Hash, id, 1, g)
        call SaveReal(udg_Hash, id, 2, 0)
        
        call TimerStart(t, TICK, true, function Periodic)
        set t = null
        set u = null
        set g = null
        set p = null
    endfunction

    private function Conditions takes nothing returns boolean
        if GetSpellAbilityId() == AID then
            call Actions()
        endif
        return false
    endfunction
    
//===========================================================================
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger(  )
        call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
        call TriggerAddCondition( t, Condition( function Conditions ) )
        set t = null
    endfunction
endscope


The games lags even if I just the frost nova model by blizzard. So it makes the custom model unlikely. But for this spell, I'm using Callahan's shockwave model.

Yes, the game works properly with other maps. So do the spells. It's just this map that's having the problems.

EDIT: Btw...I haven't finished the spell. Which is why the local group g and GROUP aren't used yet. I'm more worried about the map's problem than making this spell do damage at the moment.
 
I can not find anything fundamentally wrong with the spell (except that you use ForGroup instead of a FirstOfGroup loop, which is way faster... but that shouldn't matter here).

This is weird indeed. Have you tried removing some preplaced stuff?

Here's my suggestion:
1) Remove all preplaced units and see if it still slows down
2) Remove all preplaced destructables and see if it still slows down
3) Remove all Doodads and see if it still slows down

...in that order. Destructables are known for creating a shit-ton of overhead (units are even worse, but most of the time you won't have quite as much units as you have destructables).
 
Level 3
Joined
Sep 9, 2009
Messages
658
Well, I need the units to continuously do an actions until a given amount of time. I think for group does that better since you don't need to worry about the dummy units not being picked.



Anyway, there was a marked improvement when I removed the doodads. Though is still slowed down by a tiny bit (I think).
 
Just to clarify (and because it makes a difference):
Did you remove only the doodads or did you remove doodads AND destructables?

Usually, what causes severe framerate drops are destructables, not doodads, especially walkable destructables. Do you have a lot of walkable destructables?

If so, you might want to drop this baby in your map and see if it helps:
http://www.hiveworkshop.com/forums/jass-resources-412/system-destructablehider-219569/
 
Level 3
Joined
Sep 9, 2009
Messages
658
Both doodads and destructibles.

I only have 5 gates and 492 trees at the moment, one bridge and two icecrown thrones.

But what I still don't get is why the game slows down when I use the two spells I made. Any other spell works fine (Both custom and non-custom).

It's like a point has been made where all other spells I make will cause slowdown in this map.
 
Both doodads and destructibles.

I only have 5 gates and 492 trees at the moment, one bridge and two icecrown thrones.

But what I still don't get is why the game slows down when I use the two spells I made. Any other spell works fine (Both custom and non-custom).

It's like a point has been made where all other spells I make will cause slowdown in this map.
In that case, maybe check out the dummies used for the abilities. Any unusual values here? Extremely short intervals on timed abilities like AcidBomb? Extreme regeneration values?

Also remember that just because a spell effect model was made by blizzard, this doesn't mean that it's not taxing on game performance. There are some effects that spam a lot of particles and creating them in 0.03 second intervals might already cause an FPS dip.

Did you try the system I linked? If so, did it make a difference?

Also, what spell do you use to trigger the spell event? There are some abilities which are extremely taxing on game performance like war stomp and shockwave, as they create (poorly implemented) terrain deformations.
 
Level 3
Joined
Sep 9, 2009
Messages
658
For the Dummy...

Animation - Blend Time - 0.00
Animation - Cast Backswing - 0.00
Maximum Pitch Angle - 0.00
Maximum Roll Angle - 0.00
Collision Size - 0.00
Food Cost - 0
Formation Rank - 0
Maximum Hit Points - 3
Hit Point Regeneration - 0.50

Just the Frost Nova model. And I don't use that anymore. I use sPy's Ice Bomb (it's not here anymore) model in place of it.

Not yet. Still trying to figure it out.

Yes, it's based on shockwave. I'll try to replace it with Carrion Swarm and see if it makes a difference.

EDIT: GODDAMMIT! The problem was shockwave =.=

Both of the spells I made were line spells so I didn't think of changing shockwave. The map's back to normal. +Rep ^^
 
Status
Not open for further replies.
Top