Unfortunately my current game (using the chunk scrolling) is some time off from the App Store. Like alot of developers here, I have a “day job” that takes precedence over app development, so I can only work on my game in the evenings or weekends.
I don’t know exactly how Lime cleans up after itself, but there must be some method, otherwise the system would grind to a halt with a certain world size (imagine an immense over-world like that in “Zelda: Link to the Past” scrolling around on an iPhone, it would be lucky to get 1 FPS!). Graham or somebody else, do you wish to answer this for me, in regards to how Lime manages garbage collection?
For your game, if all the rooms are square, I think you could show the current room plus all 4 rooms around it (assuming there are doors on all 4 sides)… but limit it to that amount, not the entire world. 5 rooms would not be too heavy for the system to handle, unless you had something like 50 objects in every room, each with physics bodies and animation and much more. When the player exits a door, a nice easing “slide” move to the next room would look nice, in my opinion. 
Cleaning up objects can be tricky, but not necessarily so. In my chunk system, each chunk has a table (array) called “childTable”. This table is empty, initially. When the chunk is first displayed (slightly off screen, when approaching visible view) this table is populated with the Lua internal IDs of each object within that chunk. When the chunk eventually scrolls off the screen, and gets prompted for removal, I just loop backwards through this table… backwards is very important and there is/was a document on the Corona site describing why, but I can’t locate it anymore. 
Most important of all, just remember that every reference to an object must be removed before it can be garbage-collected. That includes the object itself, any “listener” on that object (such as a tap or touch sensor), and any references in other tables (i.e. the “childTable” example above).
The following 3 steps are essential for proper garbage collection:
-
object:removeEventListener(...)
(if one was applied)
-
object:removeSelf()
(this also removes physics bodies in the same step)
-
object = nil
Anyway, there are other methods to keep memory clean and each person finds their own preferred way. My “chunk” system is just one concept. Keep reading the documents and forums and soon it won’t seem so difficult, but avoiding those memory leaks can become an almost obsessive task, unfortunately. I think I finally understand why most games are the work of teams, not individuals. 
[import]uid: 9747 topic_id: 5597 reply_id: 19150[/import]