• 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.

[Solved] Models start glitching out when ingame

Status
Not open for further replies.
Level 2
Joined
Dec 22, 2016
Messages
9
Here a screenshot of how it looks like: http://i.imgur.com/4MshfEw.jpg

It starts around 10 minutes into the game. It doesn't cause lag or slows down the game, but it is obviously not playable. I only encounter the issue on one of my minigame-maps.

I do fix momery leak scources for Locations and Special Effects in my (GUI) triggers with custom scripts (except unit variables, because I can't find anything for that and it seems like Unit Variables don't leak, even if the target is not removed and the Variable gets reused).

I don't know what might be causing it and I haven't been able to find any similar post addressing it, so I have to ask for help in order to identify the issue, though I do have a guess what might be a cause.
However even if I am right, I wouldn't be smarter afterwards.

In order for you to understand what leads me to my guess, I'll have to sum up how the map works:
It runs with 8 players and hands out 1 random hero from a neutral passive hero pool to each player at the start.
Whenever a hero dies, he is being revived, added back to he hero pool and the player recieves another random hero from said pool after a short Timer expires.

Besides the glitch-issue that I mentioned earlier, I'm also (occasionally) seing units being teleported to the player and then suddenly turn back to neutral passive, which already suggests that something is wrong with my hero distribution triggers, however I was unable to find timing or variable issues, other than that everytime the player recieves a hero, the hero is set to a Unit Variable (Player1Hero, Player2Hero, etc.) and the Unit Variable keeps overwriting itself with new units.

I already tried to set the Unit Variable to a dummy and then remove the dummy from the game (in hope it clears the unit variable), but of course, it doesn't solve anything.
The obvious solution would be, to just not use the Unit Variables and identify the correct dead hero unit via a bunch of conditions, but even if this should fix the glitch, my question still remains:
Why is this happening?!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
I don't know what might be causing it and I haven't been able to find any similar post addressing it, so I have to ask for help in order to identify the issue, though I do have a guess what might be a cause.
However even if I am right, I wouldn't be smarter afterwards.
Why is this happening?!
WC3 does that if there is too much geometry per frame. After reaching a certain vertex count the remaining vertices are assumed 0,0,0 which is usually the middle of the map. Either that or after a certain number of bones are on screen some of them translate to 0,0,0 which is the middle of the map. I do not know the exact limit/problem, but it is likely one of those two. This causes some models to deform in strange ways as surfaces get stretched towards 0,0,0. If this is the case then reduce the scene complexity by having less models visible at once. For example do not show several hundred Tauren Chieftains at once.

3 possible causes if this is the case come to mind. First is you might be killing several hundred units on screen in a short time with a long unit decay time so several hundred corpses (each is the full unit model complexity) exist at once and overload the game. Second is that you have a special effect leak, all special effects persist until explicitly destroyed and produce render overhead even if the animation they end up on has no visual impact. Third is to kill a lot of items (hundreds, possibly as a result of use on pickup such as tomes, gold coins, healing runes etc) and never explicitly remove them, as items do not decay dead items still produce render overhead.

Alternatively it could be a sign of failing graphic hardware. Random transformations of surfaces can occur when various GPU processing elements start to fail. Usually the effect will get persistently worse, not apply to anyone else (as their GPUs are not failing) and eventually start to cause periodic driver crashes that ultimately will crash the game or cause a BSoD if a recovery is not possible. I had this happen on an old computer and the GPU did eventually die.

For diagnosing exact cause either post a test map where the issue is immediately present, or post a replay of the map being played which you have tested and can confirm the issue occurs at a specific point in time, which should be used as the point of reference for the issue.
 
Level 2
Joined
Dec 22, 2016
Messages
9
3 possible causes if this is the case come to mind. First is you might be killing several hundred units on screen in a short time with a long unit decay time so several hundred corpses (each is the full unit model complexity) exist at once and overload the game. Second is that you have a special effect leak, all special effects persist until explicitly destroyed and produce render overhead even if the animation they end up on has no visual impact. Third is to kill a lot of items (hundreds, possibly as a result of use on pickup such as tomes, gold coins, healing runes etc) and never explicitly remove them, as items do not decay dead items still produce render overhead.

Interesting ... is it possible for playing a living unit's death animation too often to be a cause as well?
There are ~2-3 heroes with an ability like this and the target's death animation is being spammed in order to add to the rediculousness of the map:

  • Blutelf SlicingPeriodic 1
    • Ereignisse
      • Zeit - Every 0.30 seconds of game time
    • Bedingungen
    • Aktionen
      • Set SlicingInteger = (SlicingInteger + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • SlicingInteger Ungleich 21
          • (Leben of SlicingZiel) Ungleich 0.00
        • 'THEN'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (SlicingInteger Gleich 10) or (SlicingInteger Gleich 20)
            • 'THEN'-Aktionen
              • Animation - Play Blutelf 0014 <gen>'s Attack Slam animation
              • Einheit - Cause Blutelf 0014 <gen> to damage SlicingZiel, dealing 325.00 damage of attack type Zaubersprüche and damage type Normal
              • Spezialeffekt - Create a special effect attached to the overhead of SlicingZiel using Objects\Spawnmodels\Human\HumanBlood\HeroBloodElfBlood.mdl
              • Animation - Play SlicingZiel's death animation
            • 'ELSE'-Aktionen
              • Animation - Play Blutelf 0014 <gen>'s Attack animation
              • Einheit - Cause Blutelf 0014 <gen> to damage SlicingZiel, dealing 75.00 damage of attack type Zaubersprüche and damage type Normal
              • Spezialeffekt - Create a special effect attached to the overhead of SlicingZiel using Objects\Spawnmodels\Orc\Orcblood\BattrollBlood.mdl
              • Animation - Play SlicingZiel's death animation
        • 'ELSE'-Aktionen
          • Einheit - Pause aus SlicingZiel
          • Einheit - Pause aus Blutelf 0014 <gen>
          • Einheit - Make Blutelf 0014 <gen> Verwundbar
          • Set SlicingInteger = 0
          • Auslöser - Turn off (This trigger)
Alternatively there are also two triggers, which fall under the category of
Second is that you have a special effect leak, all special effects persist until explicitly destroyed
, because it seems like I wasn't destroying special effects when making two abilities like this yet:

  • Karateansturm
    • Ereignisse
      • Zeit - Every 0.03 seconds of game time
    • Bedingungen
    • Aktionen
      • Set KarateInteger = (KarateInteger + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • KarateInteger Kleiner als 31
        • 'THEN'-Aktionen
          • Set KaratePunkt2 = (Position of KarateZiel)
          • Set Karatepunkt = (KaratePunkt2 offset by 40.00 towards (Facing of Es kann Karate. 0021 <gen>) degrees)
          • Set KaratePunkt3 = (Karatepunkt offset by -30.00 towards (Facing of Es kann Karate. 0021 <gen>) degrees)
          • Spezialeffekt - Create a special effect at Karatepunkt using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Einheit - Move Es kann Karate. 0021 <gen> instantly to KaratePunkt3
          • Einheit - Move KarateZiel instantly to Karatepunkt
          • Einheit - Cause Es kann Karate. 0021 <gen> to damage KarateZiel, dealing 50.00 damage of attack type Zaubersprüche and damage type Normal
          • Custom script: call RemoveLocation (udg_KaratePunkt3)
          • Custom script: call RemoveLocation (udg_Karatepunkt)
          • Custom script: call RemoveLocation (udg_KaratePunkt2)
        • 'ELSE'-Aktionen
          • Set KarateInteger = 0
          • Animation - Play KarateZiel's death animation
          • Spezialeffekt - Create a special effect attached to the overhead of KarateZiel using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
          • Auslöser - Turn off (This trigger)
 
Level 2
Joined
Dec 22, 2016
Messages
9
Yes that would do it. Destroy those special effects.

Seems like this was the solution already, at least I haven't encountered the glitch/bug again during multiple test runs.

  • Karateansturm
    • Ereignisse
      • Zeit - Every 0.03 seconds of game time
    • Bedingungen
    • Aktionen
      • Set KarateInteger = (KarateInteger + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • KarateInteger Größer als 1
        • 'THEN'-Aktionen
          • Spezialeffekt - Destroy KarateSpecial
        • 'ELSE'-Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • KarateInteger Kleiner als 31
        • 'THEN'-Aktionen
          • Set KaratePunkt2 = (Position of KarateZiel)
          • Set Karatepunkt = (KaratePunkt2 offset by 40.00 towards (Facing of Es kann Karate. 0021 <gen>) degrees)
          • Set KaratePunkt3 = (Karatepunkt offset by -30.00 towards (Facing of Es kann Karate. 0021 <gen>) degrees)
          • Spezialeffekt - Create a special effect at Karatepunkt using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
          • Set KarateSpecial = (Last created special effect)
          • Einheit - Move Es kann Karate. 0021 <gen> instantly to KaratePunkt3
          • Einheit - Move KarateZiel instantly to Karatepunkt
          • Einheit - Cause Es kann Karate. 0021 <gen> to damage KarateZiel, dealing 50.00 damage of attack type Zaubersprüche and damage type Normal
          • Custom script: call RemoveLocation (udg_KaratePunkt3)
          • Custom script: call RemoveLocation (udg_Karatepunkt)
          • Custom script: call RemoveLocation (udg_KaratePunkt2)
        • 'ELSE'-Aktionen
          • Set KarateInteger = 0
          • Animation - Play KarateZiel's death animation
          • Spezialeffekt - Create a special effect attached to the overhead of KarateZiel using Objects\Spawnmodels\Naga\NagaDeath\NagaDeath.mdl
          • Auslöser - Turn off (This trigger)
I still need to solve the odd hero distribution bug, but that's not the topic of this thread anyway, so the problem is solved.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
True, but it only leaks once in 10-20 seconds, while the other leak happens 30 times every 10-20 seconds, so I kinda ignored it when posting the hotfix.
Special effect leaks are the worst kind of leak though as they heavily degrade performance permanently when vieweing the area they are located at. Each special effect leak is a model that has to be drawn with multiple OpenGL calls every frame. It may appear invisible but it is most certainly not as far as computational overhead goes.

Items are prone to a similar leak as dead items never decay. Unless explicitly remove the item art remains on screen and rendered every frame. This is why using a thousand tomes without removing the items will cause low frame rates when viewing the area.
 
Status
Not open for further replies.
Top