Performance issue on iPod 4th gen and iPhone 4
Im building a game that contains quite some actors (I believe 40 actors, some are bigger then the other) in the scene, and most of them are unlocked and constrained to another actors position. 24 of them use the change image behavior as well.
It runs great at 60 fps on my iPhone 5S and my iPad2, but if I test it on an ipod 4th gen or iphone 4 the performance is really bad.
The frame rate starts at 60, but when the actor starts running, it drops down to 42 fps, and even crashes after a while. The weird thing is that it doesn't crash completely, it still makes sounds when I touch the screen.
Images: 45 MB
Sounds: 25 MB
Game engine: 6.5 MB
Other: 19.5 MB
Total: 92.2 MB
I already optimized the game as much as possible, by recycling some actors, only spawn the bullets, turn of movable on as many actors as possible etc.
Do I constrain to many actors at the same time, or should I reduce the image sizes (the project is 5.8 MB)?
Some help would be appreciated:)! Thanks
Comments
Try to remove some of the actors that are using constrain and use 'tile' for texture images. That should fix some of the performance issues.
@crazycam99 I don't really get you answer, can you explain a bit more? The actors have to be individual images in this game.
I could change some contrains to change attribute instead, but I'm not sure if this is going to solve my problem.
@crazycam99 All the lights are constrained to a fixed position.
And you should also use the "otherwise" in rules
You should replace constrains with change attributes
Why use a constrain when it isn't moving relative to another actor?
Images: 45 MB Seems too big,
my new game "rollTurtle",Images Always approximately 10~20MB.
@crazycam99 yeah it seemed logical to me because it has to change the location every time the actors position is more then its self position. but I guess change attribute is more efficient.
@kirafu Is there a good way to reduce the memory usage, and still keep the sharpness in the pixel art?
As I said to reduce the images tile the graphics in the actor
@crazycam99 I will give it a try:)
@crazycam99 It worked thanks! there is still a tiny bit of lag left, I read something about tinypng or something a while back, do you know how this works?
@Approw Do NOT use any type of compressor like tinypng they will corrupt your image files and are not compatible with GameSalad
@Approw Instead of using the change image behavior, use change attribute: self.image
That should help a little.
Fortuna Infortuna Forti Una
@crazycam99 Okay thanks! I will keep that in mind. The only problem with tiling is that I only have to tile vertical, but the image is x2, so it looks stretched. I cant find anything about this issue in the forums.
@Lovejoy Thanks, I already found a tutorial!
I'm using tinypng, I had no problems so far,btw I just use it with no-transparent image.
Check out my games on the App Store!
Wordgraphy / Polycolor / 20 Seconds / Minimal Maze
@onelasttime Read this http://forums.gamesalad.com/discussion/67358/lets-talk-about-image-formats/p1
@crazycam99 @Lovejoy I fixed the problem with replicate, I'm happy to tell you that the total memory is reduced to a nice 42MB!! (I haven't even reduced the images sizes with tinypng). It runs very smooth right now, thanks for all the help guys! The game should be finished in 2 weeks or so, I will announce it on the forum when its time.
Cheers!
Cheers indeed!
Fortuna Infortuna Forti Una