Building Objects Using Multiple Images And Game Performance Question

Discussion in 'Level Design' started by steverha, Apr 22, 2017.

  1. steverha

    steverha Boxer

    Joined:
    Oct 8, 2015
    Messages:
    49
    Likes Received:
    16
    Hey guys,

    So, I've been contemplating how to go about making it easier to design levels for my game and just have a quick question in case anyone knows the answer. The game is a platformer game consisting of say, 5 worlds, each world with it's own theme. So, I have two options, I can have the platforms/ground set up as individual objects consisting of a tile piece for that platform. For example, for one platform I have a corner object and a middle object, which when combined forms the platform. It goes, corner piece object, middle piece object, then corner piece object again just scaled the opposite direction(I'm sure you guys already know how tile sets work, I just wanted to clarify in case someone didn't).

    So, in the scene I could have a platform consisting of the corner, middle, and then corner piece again, connected using connection mode, which I can then copy and paste into various scenes. The only problem with this is I would have to go back through hundreds of platforms and delete the connections to avoid lag, and working with connected objects in buildbox can sometimes get messy when working on large projects.

    The other option I'm considering is building the platform object using multiple images of the different tile pieces for that object. For example, Platform 1 is an object comprised of the corner, middle, and corner tile piece images. I would then create individual platforms which vary in length and size. So platform 1 would be an object that is 3 images total(corner middle, corner tile pieces), platform 2 is an object consisting of 4 images total(corner, middle, middle, corner tile pieces), platform 3 is an an object of 10 images, etc, etc. By creating the platforms varying in length as individual objects, I would avoid using an excessive amount of connectors and would just click and drag whatever length platforms I needed for each level from the objects panel of buildbox. Each platform that is the same theme would be comprised of the same images in order to reduce atlas size.

    Now, my question is has anyone tried designing a game using objects comprised of multiple images? Theoretically, I'm looking at hundreds of objects comprised of multiple images, so I'm a little concerned over whether or not this would affect the game performance. If anyone knows the answer to this I would really appreciate your insight, I really don't want to spend days building level objects only to find out that it makes the game lag.
     
  2. SuperVudu

    SuperVudu Boxer

    Joined:
    Jan 7, 2017
    Messages:
    37
    Likes Received:
    17
    Okay, so I don't have any experience building a big platformer game, but I think I get the gist of what you're saying and I think I can point you in the direction of someone who does have some experience with this. I think someone who could give you sound advice on this is Simon Crack - DeadCool

    http://www.appgremlin.com/build-iphone-apps.html
     
    steverha likes this.
  3. steverha

    steverha Boxer

    Joined:
    Oct 8, 2015
    Messages:
    49
    Likes Received:
    16
    Thanks man, I'll definitely hit him up! I appreciate it!
     
    SuperVudu likes this.
  4. Andy

    Andy Miniboss Boxer

    Joined:
    Sep 24, 2015
    Messages:
    2,152
    Likes Received:
    1,546
    When you pass several hundred objects (heading towards 500+) in a single scene it's more likely to cause performance issues... there are ways to mitigate this but it all depends on what you are doing and how you are doing it.
     
    SuperVudu likes this.
  5. VectologyGames

    VectologyGames Serious Boxer

    Joined:
    Oct 5, 2015
    Messages:
    529
    Likes Received:
    473
    @Andy what would you say is a reasonable amount of images per scene?
     
    steverha likes this.
  6. SuperVudu

    SuperVudu Boxer

    Joined:
    Jan 7, 2017
    Messages:
    37
    Likes Received:
    17
    One thing that could be helpful for this is Convert To Clones
    This is also mentioned in the article I sent you a link to. Just in case you missed it.

    [​IMG]
     
    steverha likes this.
  7. Andy

    Andy Miniboss Boxer

    Joined:
    Sep 24, 2015
    Messages:
    2,152
    Likes Received:
    1,546
    Really hard to say, once you get up to around 200-300 objects in your scenes you should at least start to think about what you are doing and your optimization strategy, even if you haven't seen any signs of performance degradation. Better to address early than late.
     
  8. VectologyGames

    VectologyGames Serious Boxer

    Joined:
    Oct 5, 2015
    Messages:
    529
    Likes Received:
    473
    Great! 150-175 then!
     
  9. steverha

    steverha Boxer

    Joined:
    Oct 8, 2015
    Messages:
    49
    Likes Received:
    16
    @
    Hey guys,
    I appreciate your responses. I understand what you said regarding the number of objects effecting the performance of the game, and that cloning at the end of games greatly improves the performance of the game. My question is, does having objects composed of multiple images, as opposed to an image composed of one image, have a greater impact on the performance of the game? If I have a scene with 100 different smaller objects that are all pieces of a platform or platforms(each with a relatively small collision shape), each piece adding to form the entire platform/platforms; or if i have a scene with 20 larger objects consisting of multiple images in each object(which have a larger collision shapes of course, but require less objects in the scene), which of the two would effect the performance of the game the most? To explain further just to try to get my point across, lets say I have 100 small objects which make up the platform/platforms. Then, lets say I have 20 larger objects, with 5 images in each object(with a the a larger collision shape consisting of 5 of the smaller objects in the 100 platform scene). So think of it as being the same exact layout in each scenario, scenario 1 one consisting of 100 small objects of single images, scenario 2 consisting of 20 larger objects with 5 images in each object, therefore the platform size and length would be the exact same, in the same exact positions, the only difference is the number of objects used, and the number of images used in each object. In scenario 1, there's more objects with smaller collision shapes/size, but in scenario 2, there's less objects with larger collision shapes/sizes, but each object contains 5 images instead of one. Which do you think would be better regarding how it effects the performance of the game? I'm sorry if I over explained simple things to experienced Buildbox users, I just wanted to clarify my point.
     
  10. Andy

    Andy Miniboss Boxer

    Joined:
    Sep 24, 2015
    Messages:
    2,152
    Likes Received:
    1,546
    That's a bit hard to tell exactly what you are saying... but let me say this.

    Example... your scenes (levels) are made of 100 bricks, and you are using a single brick object. This means you have 100 objects in your scene. This is generally bad practice.

    So I would have 3 or more brick objects. With one, two and four bricks in each, maybe even more if my level design allows for it. Make these multi-brick objects with a new image each, don't build them with the single brick image object. This way I can build the level; with maybe 30 objects total, less if possible.

    Just to be clear, in the above example you image atlas will have 3 images. One with a single brick, one depicting two bricks and one depicting four bricks.

    If you build an object that contains 4 other objects (even the same 4 objects) it counts as 5 objects each time you use it. The 4 objects + itself.

    Hope this all makes sense, and it maybe what you were saying, but just trying to clarify.
     
    steverha likes this.
  11. steverha

    steverha Boxer

    Joined:
    Oct 8, 2015
    Messages:
    49
    Likes Received:
    16
    Thanks for your response, my bad if my point wasn't made above, I responded after a long sleepless night

    I get what you're saying though, that definitely helps me out. Now, you said if you build an object that contains four objects, it counts as five objects total. So does that mean images are considered objects as well when building objects? I ask because of the two options when importing a jpg image into the object building screen you can import it as an image or as an object.

    Now, with regards to what you said about the atlas, you have the three brick images: single, double, triple bricks. Let's say the single brick object is 50x50 pixels, the double is 100x100, triple is 150x150. So we have those 3 objects. But, what if we made those 3 objects out of one single 50x50 brick image? That way you only have one image in your atlas and can reuse the same image throughout objects. For example, the double brick object is just two of the same 50X50 single brick images placed next to each other in the object builder, as opposed to having the one 100x100 double brick image in the object. Would this avoid the need for having multiple images in your atlas? Instead of needing the 3 brick images mentioned above, you could have one single 50x50 brick image which is used to build the 3 different brick objects.
     
  12. Andy

    Andy Miniboss Boxer

    Joined:
    Sep 24, 2015
    Messages:
    2,152
    Likes Received:
    1,546
    For an object that is going to be duplicated many times, I would use a separate discrete image for the double brick, etc. Using multiple images would be less overhead than using multiple objects for sure, but still heavier than a single image.

    So the true answer depends on the usage. In this case, I would value the number of objects more than atlas space. There might be some cases where I would value atlas space more, but I could only see a few. If I can reduce objects by 50% I sure don't mind a few additional atlas images.
     
    steverha and Astro Games like this.
  13. steverha

    steverha Boxer

    Joined:
    Oct 8, 2015
    Messages:
    49
    Likes Received:
    16
    Ahhh, alright. Perfect, thanks for answering my question man! I may give both options a try in the future just to see the difference between the two. It's something I've been pondering for a while now, but if I do try it I'll be sure to share the results of it. I really appreciate it man!
     

Share This Page