Having over 700 actors on one scene?

ElfizmElfizm Member Posts: 489
edited October 2012 in Working with GS (Mac)
Hello

So my game may end up having over 700 actors on a scene and was wondering how big of an affect would this have on performance? In total there is about 16 different types of actors. So this is going to have an affect on the performance but would it be much?

Once completed I am going to wait for new engine but just wanted to make sure I wasn't wasting my time placing them all and then finding out it runs too slow.

Thanks

Comments

  • DanDaMan123DanDaMan123 Member Posts: 216
    700 sounds like too much
  • boredaholicboredaholic Member Posts: 47
    i had about 200 on my screen and my fps on my iphone 4 went from 60-5-1-crash
  • ElfizmElfizm Member Posts: 489
    Wow this is disappointing to hear :(

    @DanDaMan123

    700 does sound like a lot but because of the complexity of the game it was the best I could do, but currently trying to bring it down to 70 actors.

    @boredaholic

    So when you say 200, are these heavily coded or just small coded, would it make a difference?

    So overall I gotta restart the design and find away to get it below 100.
    Would the new engine be able to handle it a bit more, or should I be spending the next few months making it again from scratch but finding alternative??

    Thanks for the answers :)
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited October 2012

    How many Rules/Behaviours there are in a scene, as well as how many Rules?Behaviours are happening at any one time, is an important consideration but just as important, is the amount of RAM used with graphics. So if your graphics are all, on average, 32 pixels square, that'll be 1,024 images as the equivalent of one image 1024 pixels square; so your 700 images (if they are relatively) small SHOULD be OK, depending on the previous info about Rules and Behaviours.

    Another thing to consider - if the 700 actors appear in the one scene as you say but not all at the same time, is use Spawn; especially if they are "Waiting" outside of the play area until the camera moves to show them on-screen.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ElfizmElfizm Member Posts: 489
    @gyroscope

    So each actor has roughly 10 set of rules with one or two behaviors in each.

    They are about 54x54 in size each.

    They can possible be spawned but every actor is moving down at same point, depending on the response of the touch. However they have to be placed in exact order for game to work, think of a level that is longish, has many platforms, trees, coins, moving clouds, and other effects, it adds up.

    So with the above info would it be wise to test it or start working on a work around such as spawning

    Thanks :)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Yeah thats gonna be way to many. 700 actors with no rules or art would most likely kill the app to be honest
  • ElfizmElfizm Member Posts: 489
    @tenrdrmer

    Oh the truth hurts :)

    So what would be a suggested opinion on how many actors that could be used in one scene based on the fact that each actor has about 10 to 20 rules with two to three behaviors in each rule.

    700 is a lot but what about 300 actors?

    Thanks :)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    honestly when you get up around 100 you may start to have issues at least on the older devices. unfortunately every project is different and you will just have to give it a go and see how it works out.
  • boredaholicboredaholic Member Posts: 47
    My suggestion is have a semi mid scene load function. Kind of like have an invisible block that the main actor HAS to pass through and this will destroy previous actors and spawn the new ones. You could repeat this process throughout the scene. It would be tedious work but I'm sure it could work. Depending on the game you might be able to cut the amount of actors down well below a hundred, but again that depends on what all has to be going on during specific times. If this doesn't make sense just let me know I'll try to break it further down.
  • ElfizmElfizm Member Posts: 489
    @tenrdrmer

    So how do people with long platforms levels or endless runners make their game. Assuming they don't do the spawn random way, wouldn't they use a bit more than 100 actors placed on the scene? Just wondering.

    Well thanks for the advice will continue to make and see what happens while also finding an alternative.

    Thanks :)
  • boredaholicboredaholic Member Posts: 47
    Did you catch my last post?
  • ElfizmElfizm Member Posts: 489
    @boredaholic

    Thanks, I always thought spawning was bad, but then again so is having 700 actor.

    However my game scene does not move, the actors move down if they need to. Depending in what the player does depends on what actors move Down. This way it's random or different every game play.

    If I misunderstood can you explain further :)

    Thanks
  • boredaholicboredaholic Member Posts: 47
    I'm trying to think, it's late I'll look at some coding tomorrow and let you know, regardless good luck :)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    @Elfizm When people have massive levels or Endless Levels like that they normally employ a technique called recycling. as actors move out of the scene or are "destroyed" instead of actually destroying them they use a change attribute and just move them to a new position and even change their image and size if needed sometimes.

    Spawning is not bad for tiny actors or a few larger ones here and there but your probably gonna run into trouble if you go that route for the massive size you are looking at.

    I would recommend looking into a recycling process for you game. Tables can likely help you a out a bunch with that considering the amount of recycling you would have to do.

    Cheers
  • ElfizmElfizm Member Posts: 489
    @tenrdrmer

    Thank you for helping, so what I have been working on for the last few hours of my free time is that, by using a big master table, I have my actor have an unique number, so when it is 'destroyed' it it changes it's number to plus one and go to the position if that number in the table, it also has several other rules in place do that it can change it's image and behaviors because it's becoming a new actor in a sense.

    This is going to take me ages to finish this but so far I have done it so I now have six actors on place but they represent 20 actors if that makes sense.

    Does that make sense, if so would that work, because i will have 60 on screen but have it heavily coded.


    Any advice is that not what you were talking about

    Thanks
  • ElfizmElfizm Member Posts: 489
    Well a problem I found was that when the actor spawns from x and y values from table the whole game freezes till they get spawned which is very annoying. Do tables do that or is that just me doing something strange and out right wrong :)

    Thanks :)
  • PBEmpirePBEmpire Member Posts: 676
    just curious to know why do you need so many actors. yup 700 is hell lot of actors. iphone 4/4s may crash due to lack of cpu power and ram
  • ElfizmElfizm Member Posts: 489
    So I don't want to say what my game is about but here is an example as to why 700 might be needed @gsrockz123

    Think of a memory match game where there is a 8x8 grid. So 64 actors in the one scene. The idea is to match them all. Once finished the board does some cool effect (can't say what) then new actors appear. These are completely different from the older Ones, different image, different effects and different score, that's another 64 actors, now the idea was to have ten levels that get unlocked within a time period, but I can have each level on a different scene because if loading times and special effects.

    Hopefully that gives a bit more understanding :) any further advice would be great

    Elfizm
Sign In or Register to comment.