Images loaded into RAM in first spawn of actor OR every spawn?

Does anyone know if images are loaded into RAM only during the first time the actor (with that image) is pawned or every time it is spawned? Assuming the actor has been deleted before it is spawned again

Comments

  • ericzingelerericzingeler Member Posts: 334
    An image is in ram if at least one live actor is using it. One image in ram will supply all actors in scene using it, so the image isn't re-loaded each time an actor is spawned.

    As far as what happens to a loaded image when actors are no longer using it, I'm not exactly sure and can only speculate.

    It probably depends on what else is going on in the game. If your game is a memory hog, than that image is probably trashed sooner than later. If your game is small and/or efficient, it could very well live in memory for the remainder of run time.
  • TheGabfatherTheGabfather Member Posts: 633
    What Eric said. Also, if you're worried about how your app is going in terms of RAM (and other metrics), you should use Xcode Instruments to measure. This should give you real-time data as you're using the app on your device. Read more about it here.
  • Yes Please GamesYes Please Games Member, PRO Posts: 21
    Thaanks gabfather. Ive used xcode but only to check the FPS. Ill check your link to see what else we can learn from using it.

    Thanks eric. I guess this means if we have a smaller version of an actor (say a Heart actor in the HUD compared to one that can be picked up in the game), it's better performance-wise to use the same big heart image on the smaller heart actor than creating and using a smaller heart image on the smaller heart actor.

    Is my understanding correct?
  • ericzingelerericzingeler Member Posts: 334
    Thaanks gabfather. Ive used xcode but only to check the FPS. Ill check your link to see what else we can learn from using it.

    Thanks eric. I guess this means if we have a smaller version of an actor (say a Heart actor in the HUD compared to one that can be picked up in the game), it's better performance-wise to use the same big heart image on the smaller heart actor than creating and using a smaller heart image on the smaller heart actor.

    Is my understanding correct?
    To a certain point this works. A very large image on a very small object will cause a large amount of aliasing. Images are not resized to fit objects in GameSalad at runtime.
  • Yes Please GamesYes Please Games Member, PRO Posts: 21
    I see. Thanks :)
Sign In or Register to comment.