GameSalad

Cutting down on actor numbers

jay2dxjay2dx Posts: 599Member, PRO

Ok so I'm testing this at the moment but wondered, say I have 300 actors in a level, all 64 by 64 and I change the image of each actor texture based on the world number ie grass zone 1,marble zone 2, or toxic 3, does this really impact loading or memory usage,

You see, I'm trying to keep the number of actors low because its a pain browsing through them all, so for platformer level assets like floors walls ledges etc I just want to change the 64 by 64 image based on an Interger for world 1 world 2 etc!

Seems to work good but does anyone have any experience of this beyond 300+ actors for level building I'm just worried about load times or lag at the start of a level,

While we're at it, what's people's experience of spawning 500+ 64 by 64 level tiles based of a table?

Thanks guys looking forward to the discussion in this :)

Comments

  • pHghostpHghost London, UKPosts: 1,755Member

    500+ should be fine. I tried 10 000 and that was too much... memory went crazy and crashed the app.

  • jay2dxjay2dx Posts: 599Member, PRO
    edited February 21

    Cool I tried 1000 and that was fine, I don't think my level tiles will go over 2000 really, but this is good to know :)

    Spawing from a table seems slow to me so I guess I'll just have to build each level as a separate scene, I've finished up all my game mechanics so it's just level building and art now :)

  • pHghostpHghost London, UKPosts: 1,755Member

    When you say spawning from a table -- are you actually spawning the actors? Or just loading their texture from a table?

    Yes, actual spawning would take some time. Are he various levels different in size? If so, you could just make one scene with the maximum needed level size, with the tiles outside the current level's boundaries turn black (or any other color you have set the background to be).

    Even with the spawning, I'd recommend this test:

    1. Build two levels as separate scenes. Make the same levels in one scene with spawning.
    2. Run the app on a test device, to get more accurate loading times. Measure the loading time when switching scenes.
    3. On the single-scene spawning version, cover the scene with an overlay image that says 'loading,' while the spawning is going on. Time that.

    My suspicion is that the spawning with an overlay might be faster than switching scenes. And even at a similar length, you can animate the "loading" transition, which makes it a lot more bearable.

    It needs to be tested on a device, though, because otherwise you won't get reliable load times on scene switch.

  • jay2dxjay2dx Posts: 599Member, PRO

    Cheers for the input @pHghost will have a go :)

Sign In or Register to comment.