Does the size of an actors affect FPS?

RHRH Member Posts: 1,079
edited November -1 in Working with GS (Mac)
I've been using GS for a while although I want to wait until after my exams to finish my game(s) and spend the money on Apple Dev and GS licences.

I was wondering to what extent the size of your actors affects FPS? Is it possible just to change the camera size when converting a game from iPad to iPhone or would that put a huge dent in the FPS when running on an iPhone? It would mean that my scenes would be identical although a lot larger than they would be if i started from scratch on the iPhone size. There would be a few things I would have to change still like controls but overall it would save me a LOT of time.

I know that iPad can run games a lot faster than the iPhone so obviously I would have to take stuff out anyway.

Thanks for any help

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    I don't think the size of the actor itself that matters, more the size of your graphics.

    Best practice is to have graphics as close to the final actor size as poss. There's no need, for example, to have a 1024x1024 graphic for an actor that'll be 32x32 in size.

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

  • design219design219 Member Posts: 2,273
    I've not tested this, but I'm sure that transparency of you png's affects fps. If you have an actor with a shadow, every pixel in that shadow area has to do a math interaction with the pixel below it to display the correct pixel value to the screen.

    To what extent it affects fps would be interesting to find out.

    *edit*

    What I was getting to is, I think the larger area of transparency you have in an actor, the more the processor would have to work. A 100x100 px graphic where half of it was transparent would use more processor than a 100x100 px graphic with just 10% of it was transparent. I assume.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Like QS says, the size of the image absolutely affects FPS...

    When you make an image, there are two 'sizes' to consider:

    The first one is the file size. When you compress your image and save it out as a .png, you can check the file size of the image by using "Get Info".

    Currently, in the US, AT&T imposes a 20MB file size limit on downloadable apps over their 3G network. This is where it becomes important to make the file size of each image as small as possible.
    Each image adds to the total file size of your game.

    HOWEVER, there is the second 'size' you need to consider - the RAM usage. This one is way more important in my opinion. This 'size' affects performance.

    You will sometimes hear people complain: "Why is my game running slow?!!! My game is only 7MB!!!"

    That is generally because they are not considering the RAM footprint of the image.

    Let's say you make a 1024x1024 graphic in Photoshop.

    To keep it simple, let's say it is just one color, just a gray box.

    So you have made a one-color 1024x1024 gray box. When you save it out as a .png, you can compress it down to 1.1K!! That's amazing! One kilobyte?! Such a huge graphic is so small!

    That is just the file size, though.
    When you bring the image into GameSalad you have to deal with the RAM footprint.

    Each image in GS uses 24 bits per pixel. You might be familiar with the PNG-24 file format. This allows transparency in each pixel.

    To find out how much RAM that image uses is simple arithmetic:

    Each pixel uses 24 bits (which is 3 bytes - 8 bits in a byte)
    So you just need to multiply the number of pixels in an image by 3 to get the total bytes used in memory.

    A 1024x1024 image has 1,048,576 pixels. Multiply that by 3 to get 3,145,728 bytes, or a little over 3MB.

    So a 1024x1024 image uses 3MB of RAM.

    A 480x320 image uses 460K of RAM

    You only have a little bit of RAM to work with... At 40MB or so, your game will crash an older device. Plus you have to allow room for the engine. And audio...

    I am not certain how much transparent images affect performance, but they use the same amount of RAM. A 1024x1024 100% transparent image will still use 3MB of RAM.

    In the olden days, transparency and blending effects (like additive) definitely affected performance. I assume it is still the case, I'm not sure how the iPhone handles it though.
  • RHRH Member Posts: 1,079
    Thanks for the replies!

    Cheers for the info and explanation. I was just trying to look for a quicker way out when converting my games from/to iPad/iPhone as I had never really experimented with changing the camera size. I guess for the larger games my seemingly sneaky plan won't work :(

    Thanks
Sign In or Register to comment.