Memory snowballing

I read in a thread on here, that if you have many scenes for levels, the further you progress, the higher the ram usage. Some proposed that you destroy all actors from previous scenes before moving on to the next scene.

My question is, should I just make all my levels in one scene, wait for game salad to create a feature that automatically destroys data from previous scenes, or do it myself and create actors to destroy before going to next scene?

Isn't there a behavior with a "destroy everything in scene" statement? As far as I'm aware, the only to destroy an actor is to put that command within the actor with a condition. Doesn't that mean I would have to put it in every actor in the scene? It be much easier to just have one actor with a "destroy everything" on them.

Comments

  • TouchiMediaTouchiMedia Member Posts: 154
    I'm hoping they been misinformed.. as using multiple scenes seems like a pretty normal thing for development. I'm not quite sure how you would make a game with multiple levels without more then one scene.. Wouldn't one gigantic scene take way more ram usage as multiple scenes that load resources indepedently, then previous scene automatically has it's resources dumped.. ??

    I was planning on using around 60 scenes.. Can anyone confirm this won't kill memory usage ?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    My question is, should I just make all my levels in one scene, wait for game salad to create a feature that automatically destroys data from previous scenes, or do it myself and create actors to destroy before going to next scene?
    That's up to you. Depending on the type of game, I either build a single scene or use multiple scenes. While I haven't destroyed actors as suggested, I may do this next time around.
    Isn't there a behavior with a "destroy everything in scene" statement?
    There is not. I think it would be called Destroy All Actors and it doesn't exist. Pro members can submit feature requests on the forums.
    As far as I'm aware, the only to destroy an actor is to put that command within the actor with a condition. Doesn't that mean I would have to put it in every actor in the scene?
    Yes. It's a pain but if you build an app from the ground up, you can just add it as you go along. Making it a custom behavior can make the whole process more efficient as well.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822
    Isn't there a behavior with a "destroy everything in scene" statement?
    I've always thought that would be really useful, being able to destroy an actor from 'outside' of that actor.
  • TouchiMediaTouchiMedia Member Posts: 154
    So in the history of gamesalad, people haven't used multiple scenes for different levels in their games without manually dumping each actor in current scene before next scene loads????

    I love gamesalad but this seems like basic stuff (dumping resources when a new scene loads).. Using many scenes for any game is quite ordinary..

    For my tentative game.. I plan on having probably 40-50 actors when all said and done - then another 60+ scenes (for each level basically, and main menu, options, etc.).

    I have to Kill each actor in scene just before another scene loads just to keep memory management to a minimal? ack - I'm not trying to harp on gamesalad but just a little surprised this hasn't been tackeled in the earlier stages :(
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited January 2014
    So in the history of gamesalad, people haven't used multiple scenes for different levels in their games without manually dumping each actor in current scene before next scene loads???
    I'm not sure why you jumped to "in the history of gamesalad" but as I said, this is my common practice:
    I either build a single scene or use multiple scenes. While I haven't destroyed actors as suggested, I may do this next time around.
    I've never had a problem with memory management and actors but then I'm a sample of 1. Other people have reported issues. So you may choose to destroy actors or recycle them efficiently or not.

    Keep in mind also that GameSalad Creator is an ever-evolving tool. So just because something functions a certain way now doesn't mean it always was or always will work that way. http://gamesalad.com/creator/roadmap

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • TouchiMediaTouchiMedia Member Posts: 154
    Would be nice to know 'officially'- as I'd hate to include code for killing each actor of a scene if loading a new scene does indeed dump the resource for actors on previous scene.

    Oh well - I'll assume that gamesalad does indeed do it - I can't fathom developing seperate scenes and not clearing the resources from previous.. Guess I know when I get 30 scenes deep with equal amount of actors :)

    I understand Gamesalad is a work in progress and continues to get updated. And I really do enjoy it - therefore I'm a little startled if this is true about 'memory snowballing' with more scenes - as scenes are the basis of making levels and games!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    I have built some pretty demanding stuff and never had memory issues. The only time GSA had major memory issues is when the switched to the new LUA engine but the resolved that by replacing the garbage collection code to the native LUA version.
  • TouchiMediaTouchiMedia Member Posts: 154
    So it has hopefully been fixed for the most part... maybe not optimized but not dreadful after a couple scenes... Guess time will tell for me. Appreciate the insight.
  • RossmanBrothersGamesRossmanBrothersGames Member Posts: 659
    edited January 2014
    @henson802@hotmail.com I experience a problem somewhat like this. But it is not dreadful after a few scenes, it only is noticeable if the game has been played for a long time on the phone without ever completely closing the game (leaving it on in the background and coming back to it later). My game plays fine until this point, then gets very choppy if it has been open for over 6 hours. I haven't tried the destroy all actors approach yet, I'm hoping that version 0.11 fixes the problem, till then I may not need to worry about it since the game plays fine. However I do hope there is some fix as it wouldn't be the best user experience if a player has the game open for long periods of time.
Sign In or Register to comment.