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

Does this leak?

Status
Not open for further replies.
Level 11
Joined
Dec 8, 2006
Messages
334
Hi!
FPS In my map seem to drop over time, which, I fear, might be the memory leaks at work.
I'm always taking care of the ordinary Point/UnitGroup leaks, so it must be something else.
I'm trying to identify the problem right now, but I'm clueless :S So, just in case, I must ask:

Region - Move- Does this leak? (I remove the point I moved the Region to later, with call_RemoveLocation())
Set UnitU - Random unit from (udg_MyUnitGroup) - Does this leak? (I do not use call_DestroyGruop() action later, since MyUnitGroup is a variable with the same units all the time)
Please, answer only if you are sure. I myself, for example, never thought of these things to leak, but it has to be something, right?

Also, is there something that can help me keep track of the memory that warcraft3 uses? Or any comfortable way of identifying the source of the leaks?
Thanks!
 
Level 10
Joined
May 27, 2009
Messages
495
well there are many factors that affect fps drop.. not just leaks you know..

sfx, your comp, some other models, triggers, wc3's current state (if windowed or not), and the apps running on your comp

but it would be better if you post the whole code

---
if the moved region is a global var (meaning only 1 region is being used over time) or a preset region.. shouldn't be really a great problem..
 
Level 11
Joined
Dec 8, 2006
Messages
334
Thanks!
Yep, it's only one region being moved over time.
About posting the whole code, there's too much of it for that. But now that I keep scrolling over it, here's a part that I am unsure about:

This code gets executed every 2.00 seconds or so. It basically saves the 5 last locations my hero was at.
So, FootstepsPink[1] is where the hero is now. FootstepsPink[2] is where he was 2.00 seconds ago, FootstepsPink[3] is where he was 4.00 seconds ago, et cetera.

  • Custom script: call RemoveLocation (udg_FootstepsPink[5])
  • Set TempReal3 = (X of FootstepsPink[4])
  • Set TempReal4 = (Y of FootstepsPink[4])
  • Set FootstepsPink[5] = (Point(TempReal3, TempReal4))
  • Custom script: call RemoveLocation (udg_FootstepsPink[4])
  • Set TempReal3 = (X of FootstepsPink[3])
  • Set TempReal4 = (Y of FootstepsPink[3])
  • Set FootstepsPink[4] = (Point(TempReal3, TempReal4))
  • Custom script: call RemoveLocation (udg_FootstepsPink[3])
  • Set TempReal3 = (X of FootstepsPink[2])
  • Set TempReal4 = (Y of FootstepsPink[2])
  • Set FootstepsPink[3] = (Point(TempReal3, TempReal4))
  • Custom script: call RemoveLocation (udg_FootstepsPink[2])
  • Set TempReal3 = (X of FootstepsPink[1])
  • Set TempReal4 = (Y of FootstepsPink[1])
  • Set FootstepsPink[2] = (Point(TempReal3, TempReal4))
  • Custom script: call RemoveLocation (udg_FootstepsPink[1])
  • Set FootstepsPink[1] = (Point(TempReal, TempReal2))
This guestions me is:
FootstepsPink[1] doesn't get removed at first. After 2.00 seconds, it is queuoed into FootstepsPink[2], and the original FootstepsPink[1] gets removed before I replace it with the current postion of my hero.
So the original postion FootstepsPink[1] is removed only after 10.00 seconds, when it's stored inside FootstepsPink[5].

That's allright, right?
 
Status
Not open for further replies.
Top