Ok, here's an update, I managed to solve my memory leak problem by simply shifting the last 2 faces off my Tunnel's face Array. Pretty simple fix when I just sat down and thought about it.
So here it is in all its non-leaky glory! http://graphicfilth.com/bin-release/Hacker.html Thanks for the help Fabrice, and thanks Rob for developing such a good library. On Jan 26, 7:21 pm, Manic <[email protected]> wrote: > Hi, I just updated it and i've got to say, it has improved my > leakiness, it seems to leak at about half the rate it used to, however > it still leaks, so i assume this is more my problem than yours. > > I haven't had opportunity to code for the last few days so I'm gonna > attempt what fabrice suggested and move the faces from the back to the > front, I'll let you know how I get on. > > Out of interest, how often should I update my source? You seem to be > extremely proactive in making updates. > > On Jan 24, 4:03 pm, Rob Bateman <[email protected]> wrote: > > > Hey Manic > > > try updating your source from the latest trunk version 2.2.7 - there have > > been substantial improvements addressing memory leaks which should help your > > tunnel code. Although this version is still in development, so it would be > > interesting to hear if you notice any difference in memory consumption > > > cheers > > > Rob > > > On Thu, Jan 22, 2009 at 9:07 AM, Fabrice <[email protected]> wrote: > > > > shape changes can actually be done the easy way with the NormalUVModifier > > > without actually redo the mesh. > > > As3mod library also offer pretty cool options for this. > > > > for face generation, look into primitives package. > > > > Fabrice > > > > On Jan 22, 2009, at 12:14 AM, Manic wrote: > > > >> Thanks for the reply, > > > >> I've had a good look at the geometry class (mainly due to being thrown > > >> into it by errors) and can't really make heads nor tails of it. > > > >> The addFace function still requires a face to function (unless i'm > > >> missing something fundamental) and its creating the extraneous face > > >> objects which is giving me my memory leak. > > > >> I thought about simply scrolling the texture, but as the shape of the > > >> tunnel itself changes, it would give a different effect... wouldn't > > >> it? (I may try that tomorrow just in case actually). > > > >> The moving the faces thing sounds difficult, also I've tried updating > > >> the properties of a face and its given me lots of errors, I was > > >> probably doing something wrong though. > > > >> Cheers > > > >> Martin > > > >> On Jan 21, 10:13 pm, Fabrice <[email protected]> wrote: > > > >>> Hi Martin, > > >>> Take a look at the way it's done in Geometry class. > > > >>> Looking at your demo, why don't you just move the faces behind cam to > > >>> front instead of making new ones? > > >>> then you do not need to build new faces... no need to clear them... > > >>> You also can do this by just "scrolling" the map with the > > >>> TransformBitmapMaterial. > > >>> No mesh update required. Only if the objects are not moving in space > > >>> of course. > > > >>> Fabrice > > >>> On Jan 21, 2009, at 10:45 PM, Manic wrote: > > > >>> Hi, first of all introduction; > > > >>> I'm a graphic designer/coder based in Sheffield and I'm really > > >>>> enjoying getting into Away3d. > > > >>> enough about me, more about my problems ;) > > > >>> I'm creating a game where the player travels through a continuous > > >>>> randomly created tunnel. To do this I'm creating new faces and then > > >>>> using the add face command to create new sections to the tunnel. the > > >>>> problem is that this is creating loads of new face objects that I > > >>>> can't seem to remove from memory properly, thus I'm creating a memory > > >>>> leak. > > > >>> the demo is here; > > >>>>http://www.10thplanet-clients.com/bin-release/Hacker.html > > > >>> and the code is here; > > >>>>http://www.10thplanet-clients.com/bin-release/srcview/ > > > >>> (the offending code is at hack.Tunnel) > > > >>> I've tried just about everything I can think of and find online with > > >>>> no luck. > > > >>> If anyone can point me in the right direction I'd be eternally > > >>>> grateful. > > > >>> Cheers > > > >>> Martin > > > -- > > Rob Bateman > > Flash Development & Consultancy > > > [email protected]
