Who has a "most updated and TESTED" version of Director 1.2?

I'm currently in the (fairly complicated) stage of updating my old Director 1.1 to 1.2. The more I do so, and the more I read through the forums, the more confused I get! I see "patches" and long discussions about the recursive "cleanGroups" removal, great solutions by Job Beebe and Frank S. and others (some of which might now be null and void), etc.

So my question is, who has a really solid, tested, and clean version of Director 1.2 running in their apps? If so, are you willing to share it? I want to emphasize again tested... not just "theoretical" code or Simulator code, but tested on actual devices: newer iOS devices, older iOS devices, Android, etc. etc.

My most recent confusion includes:
The suggested patch for a more efficient "cleanGroups" function, posted around late-March. Now it appears that this function is "unnecessary" since the old Corona "recursive group removal" bug was squashed? If so, how should I clean out my groups in Director 1.2, considering this core Corona fix? Reading through Tom's (Ansca) reply to the thread, does Corona now handle this all internally? Would it now be as simple as calling group:removeSelf() on the current Director scene/group, and Corona clears everything recursively?

I'm sure Ricardo is implementing or planning to implement these key changes in Director 1.3, but I'm just trying to get an advance start on this. If anybody can provide a truly solid and tested version of Director 1.2 (patched or modified or whatever), I'm sure several people here would appreciate it. :)

Thanks in advance!

Brent Sorrentino
Ignis Design LLC

I'm really interested in the same thing... have the exact same questions.

Isn't there a Github repository somewhere? If not, may I suggest setting one up? :)

will there ever be a 1.3 version? If i remember, Ricardo said he havent got many time nowadays...
Maybye someone will retake the project?
What would be awesome, is that director would be included directly in the SDK :)

Dear Ansca Mobile and Jonathon Beebe,

I really appreciate all the helpful resources that Jonathon Beebe has contributed and hope that now that he is on staff with Ansca (http://jonbeebe.net/on-being-an-ansca-staff-member), he can gives us a summary of what was accomplished for Director 1.2a, an update as to the future of the class, and answer some questions such as:

"Will the Director Class features become a part of the Corona SDK?"

Thanks Jonathon for all your help. I hope that you can be instrumental in pulling together all the various blog comments, forum posts, docs, bug lists, etc., into a format that helps all of us (and Ansca Mobile) succeed.

Side Note: Here is a link to a posting the Jon made that is related to this topic:

Proper Group Cleaning in Corona (Script Download)
http://jonbeebe.tumblr.com/post/3760389212/proper-group-cleaning-in-corona-script-download

Sincerely,

Paul Allan Harrington
http://www.pahgroup.com/

I also hope that a truly solid and tested version of Director can be established (which is why I started this thread :P). However, it's clear that Director might be a work in progress for quite some time. As Corona itself develops further, so will Director. I personally don't think it needs to become "part" of the SDK... there are bigger fish to fry, in my opinion.

The current version (1.2a?) seems to be quite solid. However Jonathan's new "cleanGroups()" function was causing my app to crash outright... I don't necessarily blame his function; it's more likely something else I implemented or failed to implement elsewhere. This function does seem to be working perfectly in other people's apps.

My vote for the next Director improvement is implementing a cleanGroups() function using the "new" Corona "display.remove(object/group)". This combines the power of removeSelf() and "~=nil" (see the documentation). More importantly, according to Tom (Ansca) this is recursive in the latest official build! So, using it should prevent the need for Jonathan's recursive cleaning function while also killing previous memory leaks (knock on wood :) ).

I have just implemented this concept in my own modified version of Director, but it's not fully tested. I would like others to test it, but first I want to see what kind of interest exists in the community. If most people are happy using the current 1.2a, then I'll just continue developing my version on the side. However if others are curious about my methods and my use of display.remove() I'm willing to type out the basic premise and distribute it for testing. Please chime in with a "+1" if you're interested.

+1

Hello everybody,

I could not help you for a while, I had to get away and you can be sure it does not please me at all. I'm working hard to pay my bills, things are getting better now. I read many of the messages you have posted here on the forum, I get notifications by email, but I felt compromised to write a response on this specific topic.

First, let me explain some things. I can't test Director on every device that has Android or iOS. Just for you to know, here in Brazil the things are too much expensive! For instance, an iPhone costs BRL 1400, this is almost USD 823, imagine if I have to buy more 5 or 6 devices. However, as soon as I could, I'll try to get a Galaxy Tab or a Droid to build for Android. I wish I could help like sometime ago answering about 20 e-mails a day, but I simply can't and I have to say THANK YOU for all that help and improve Director 1.2.

Well, let's talk about what really matter, Director 1.3. Today I'm studing the last release of Corona and the cleanGroup function. I think this will be the only change for this new version. I can't read all the topics, but if anybody have other requests, please put it here while I have time. If it is possible, I'll put it as well.

Again, sorry for all and thanks for the help.

Ricardo

Hi Ricardo,

Nice to have you back. Have you ever considered setting up a PayPal account for those of us who appreciate the efforts you have made to the Corona community and would like to contribute?

Just a thought, but I know I have gone to your site several times hoping to find a PayPal "Donate" link.

Thanks again for your time and efforts.

Sincerely,

Paul Allan Harrington
http://www.pahgroup.com

Hi Paul,

I really don't have a "Donate" button, I didn't made Director thinking on money and it will not change, but thanks for your intention.

I'm changing the cleanGroups function right now to add some features that I found on CoronaUI. I hope that Ansca will understand that it's just to get it better. I'm also thinking in a way to put a function callPopUp to show a screen without cleaning the currView.

Ricardo

@ricardo

Just want to give you a big thanks for your director class. I just started learning Corona a few weeks ago and it's REALLY helped me jump into the whole process.

My suggestion for director: The ability to recall the current scene.

I'm looking forward to new releases if you have any time!

Awinograd

Hi Awinograd,

Thanks a lot, Corona is really cool and you will like it a lot!

Recall the current scene is not easy just because there are several ways to code your apps and depending on how the developer did it, Director would crash when try to unload the package.

Ricardo

That's too bad, but thanks for your response!

Awinograd

Guys,

I need beta testers for the Director 1.3 on the link below:

https://bitbucket.org/ricardorauber/corona/downloads/director_by_ricardo_rauber_1_3.zip

Please send me some feedback.

Ricardo

Thanks Ricardo, I should be able to test in the next 24 hours. -Paul

Testing it now on Android :)

Testing now in the Corona Simulator (MAC) Version 2011.484 (2011.4.12). If all goes well, I should be able to build and test on iPhone 3GS, iPod Touch 4, and iPad2 (various iOS versions)

I'll keep you posted.

Best wishes,

Paul Allan Harrington
http://www.pahgroup.com

Update:

Testing Director 1.3 (thanks Ricardo) in the Corona Simulator (MAC) Version 2011.484 (2011.4.12). went well. No issues to report.

I'll post again after testing on iPhone 3GS, iPod Touch 4, and iPad2 (various iOS versions)

Best wishes,

Paul Allan Harrington
http://www.pahgroup.com

Just tested it and built it to my HTC incredible android phone. seems to work just fine. Could i ask what benefits are suppose to be apparent in Director Class 1.3? i have been using 1.2 for a long while and its worked great. Why should i start using 1.3? thanks for your hard work ricardo

Hi rxmarccall,

Thanks for the feedback! The cleanGroups function was changed, it was not ok on v1.2. Also, I created the PopUp to call a scene without cleaning the old one. For instance, you can call a popup with options or pause menu and go back to the same point you were before calling the popup!

Awesome, great improvements. keep it up champ!

Update:

Testing Director 1.3 (thanks Ricardo) with Corona Version 2011.484 (2011.4.12) on iPhone 3GS, and iPad2 (various iOS versions) went well. No issues to report.

I'll post again after testing on iPhone 4, iPod Touch 4 (various iOS versions)

Side Note: I am using Director 1.3 but also using cleangroup.lua (http://jonbeebe.tumblr.com/post/3760389212/proper-group-cleaning-in-corona-script-download) to do various cleanup tasks of non Director related Groups as well as other Objects, Listeners, etc..

Best wishes,

Paul Allan Harrington
http://www.pahgroup.com

isn't it true that with the latest updates to corona, using remove:self() to a group now properly removes it and all the child objects? Is there any reason to use the CleanGroup module anymore?

Personally, I don't believe there's a reason for CleanGroups() anymore, with this core Corona update.

I have modified my own version of Director (1.2) to utilize this recent API (display.remove()) and it appears to be working perfectly. In testing over the course of a few days, I haven't noticed any memory-leak-related lag using this method instead of CleanGroups().

However, I haven't gone to serious lengths to test it. I simply put a repeating function in my "main.lua" to collect garbage and print out both texture memory and Lua memory (this code was borrowed from Tom at Ansca). As I move around in different scenes and menus, it doesn't appear that I'm experiencing any memory leaks, but somebody would probably need to test this more thoroughly to be 100% sure.

Brent Sorrentino

If i am using the director class to print to the terminal the system memory, but im not using his method to clean my groups and such, will the printed memory still be accurate of how much memory im using? I feel like my game has a pretty bad memory leak, i start at my main menu with 276, then go to a level which puts me at 335, then when i go back to my main menu im at 342....

If it's true that you don't need to clean the groups anymore (using a recursive function), I wonder why CoronaUI has the same cleanGroups function with additional listeners removal?

When you return to your menu, does the memory ever drop back to "normal" amounts? Or does it continually hover around 342? If it does, you probably have a memory leak not related to Director...

I assume you tried using the latest CleanGroups() in Director 1.3? Despite the new improvements to this function, I still don't think there's any substitute for *manually* cleaning up your listeners, at the bare minimum. Even though the new function does this (apparently), I still make sure that all of my listeners and external references to scene objects are removed before I exit the scene.

Sometimes tedious, yes, but it's worth the effort. Better than trying to seek out a pesky memory leak when your game is 90% finished. :)

@Ricardo: If it's true that you don't need to clean the groups anymore (using a recursive function), I wonder why CoronaUI has the same cleanGroups function with additional listeners removal?

Good question Ricardo! Perhaps they haven't gotten around to updating it yet? If I recall, Tom at Ansca said the updates to the internal removeSelf() functionality *should* free up listeners too... because it clears the objects recursively and thus "un-links" those listeners and makes them eligible for Lua garbage collection.

I wish we could get a definitive answer on this, but it looks like thorough testing is the only way to be sure.

I did a test here:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
print ( "Texture: " .. system.getInfo( "textureMemoryUsed" ) )
--
local imagem, quadrado, grupo
--
local function loadImages ()
        imagem = display.newImageRect( "car.jpg", 200, 100 )
        quadrado = display.newRect( 200,200,200,200 )
        quadrado:setFillColor( 0,200,100 )
        grupo = display.newGroup()
        grupo:insert( imagem )
        grupo:insert( quadrado )
end
--
loadImages ()
print ( "Texture: " .. system.getInfo( "textureMemoryUsed" ) )
grupo:removeSelf()
collectgarbage( "collect" )
print ( "Texture: " .. system.getInfo( "textureMemoryUsed" ) )
--
loadImages ()
print ( "Texture: " .. system.getInfo( "textureMemoryUsed" ) )
imagem:removeSelf()
imagem = nil
quadrado:removeSelf()
imagem = nil
collectgarbage( "collect" )
print ( "Texture: " .. system.getInfo( "textureMemoryUsed" ) )

Changed the test:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
print ( "Texture: " .. system.getInfo( "textureMemoryUsed" ) )
--
local imagem, quadrado, grupo
--
local function loadImages ()
        imagem = display.newImageRect( "car.jpg", 200, 100 )
        --
        quadrado = display.newRect( 200,200,200,200 )
        quadrado:setFillColor( 0,200,100 )
        --
        grupo = display.newGroup()
        grupo:insert( imagem )
        grupo:insert( quadrado )
        --
        print ( "Texture: " .. system.getInfo( "textureMemoryUsed" ) )
end
--
local function showInfo ()
        print("imagem: " .. type(imagem))
        print("quadrado: " .. type(quadrado))
        print("grupo: " .. type(grupo))
        --
        collectgarbage( "collect" )
        --
        print ( "Texture: " .. system.getInfo( "textureMemoryUsed" ) )
end
--
loadImages ()
grupo:removeSelf()
showInfo ()
--
loadImages ()
imagem:removeSelf()
imagem = nil
quadrado:removeSelf()
quadrado = nil
showInfo ()

Thanks for doing these tests Ricardo!

"group:removeSelf()" might not explicitly "nil" the children contained within, but logically those should be eligible for Lua garbage collection following the function call, unless they are somehow being locked/held by an external reference. Would you agree with this?

You might also try display.remove(object/group). I actually changed every occurrence of "removeSelf()" in my entire game to this, since it combines the power of that API with a pre-check that the object/group ~= nil.

ricardo,

Can you give a quick explaination on how to set up a pop up director scene, as well as how to use the PopUp call?

I got the popUp working well! Nice job on that, very handy.

The only problem is that transitions that are running are not paused. I don't even know if it is possible to do, but if it is, that would be the bees knees.

You could use the Transitions Manager, i believe its available in the code exchange, its awesome, you can pause and resume or cancel all transitions with one line of code.

I tested v1.3 with the windows version in the simulator, I made a simple script to load a level, create and destroy thousands of objects, then go back to the main menu. Then it repeats that cycle 100 times. I monitored the texture and Lua memory after each cycle.

It seems to work just fine - I didn't detect any problems with memory leaks. That's all I was testing for in this case.

I should point out I was manually cancelling all listeners and timers in my clean() function.

I monitored texture memory and Lua memory, and it went up a bit at first, then stayed pretty steady, moving up and down a bit. I think that's simply related to timers, as per my post here:

http://developer.anscamobile.com/forum/2011/04/29/lua-memory-increases-director-class-scene-changes-normal#comment-34599

Any news on 1.3?

I've been testing Director 1.3 from the above link for the past few days and have to say that I'm pretty impressed by it. I've been using it in my latest game which is under development and Director 1.3 has performed very well.

When will it be finalised? Or is that it?

-- Chris

Director Class 1.3 Preview - http://www.youtube.com/watch?v=MZdD_CnydJ4

views:2353 update:2011/10/12 18:33:00
corona forums © 2003-2011