Can you have too many actors room?

AlanoAlano Member, PRO Posts: 70

....Sounds like a set up for a joke.

I'm creating a game with a lot of moving actors in a room. Think ball pit at Chucky Cheese. A massive herd (say 20 or 30) of circles moving around in a room like bouncing atoms. These will be "dummy" actors that just move about a room. There will be one main control actor within the herd moving as well.

1- Is there a concern about file/game size when doing this?
2- Do I just drag into the scene all these instance actors? Do I set up a replicate actor or a spawn actor for them? What is an efficient way to produce a lot actors in a scene. Graphically I'm keeping it simple by using a circle shape as the graphic.

Thanks!
Alan

Comments

  • quantumsheepquantumsheep Member Posts: 8,188

    Hey there,

    That really shouldn't be a problem at all.

    Here's my game DotMatrixx on the Mac from a couple of years ago - give it a go, it's free ;)

    https://itunes.apple.com/gb/app/dotmatrixx/id481691880?mt=12

    There's also an iPad 1 version and it works fine on that if you're worried about performance.

    The game spawns about 30 - 40 objects at the start - but it only does it once. When the actors are spawned in, they 'stay' spawned in thanks to 'pooling' - i.e. I recycle them by moving them from one position to another off-screeen.

    You can google 'pooling' if you're not familiar with the concept.

    File size wasn't a problem for me - it's about 13MB I think.

    It really depends on the details of your game, but as you can see, something similar can certainly be done!

    Hope that helps,

    QS =D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • SocksSocks London, UK.Member Posts: 12,822

    @Alano said:
    1- Is there a concern about file/game size when doing this?

    Generally speaking - no.

    @Alano said:
    2- Do I just drag into the scene all these instance actors? Do I set up a replicate actor or a spawn actor for them? What is an efficient way to produce a lot actors in a scene.

    Use whatever method best suits your game - without any context whatsoever you may as well be asking 'what colour should I make my actors' :smile:

    @Alano said:
    Graphically I'm keeping it simple by using a circle shape as the graphic.

    GameSalad and the target device won't know what the image is, whether it is a simple circle or a detailed monster, both will simply be seen as an image, that is to say there is no advantage in processor overhead, smooth gameplay, memory (etc) by using a simple graphic compared to any other graphic.

  • AlanoAlano Member, PRO Posts: 70

    Thanks Socks.

    Yeah, I realize my question is kinda nebulous. I just didn't know if spawning a bunch of circles (actors) took less process power than physically having 20 circles in the scene. Graphics: good know GS doesn't care. I often wondered about this. My assumption was that a simple color filled shape would be less taxing than a scanned in photo image with various shades. Good to know.

    Thanks again!
    Alan

  • SocksSocks London, UK.Member Posts: 12,822

    @Alano said:
    Thanks Socks.

    Yeah, I realize my question is kinda nebulous. I just didn't know if spawning a bunch of circles (actors) took less process power than physically having 20 circles in the scene. Graphics: good know GS doesn't care. I often wondered about this. My assumption was that a simple color filled shape would be less taxing than a scanned in photo image with various shades. Good to know.

    Thanks again!
    Alan

    20 spawned actors will place the same strain on the processor as 20 actors placed in the scene manually - which, depending on their rules, is not a lot of strain, I have projects with hundreds of actors.

    The way GS/iOS handles images is that a - for example - 512 x 512 pixel image takes up a certain amount of memory regardless of its content, so a flat red square (as an image) takes up the same amount of memory as a photo of David Hasselhoff.

    The only rule (well, actually more of a recommendation) is to keep your image sizes within the power of 2 rule.

Sign In or Register to comment.