original post needs reformatting, its hard to read.
Printable View
original post needs reformatting, its hard to read.
I'm not sure if this was mentioned but if you set the game's display mode to Direct X9 and V-sync on, the performance of the games improve alot. I was getting 14-30 fps before I changed the setting, not I'm getting 50 fps. it even goes higher at times. Only thing is the framerate limiter doesn't limit the framerate.
I'm not sure it will help everyone but just thought I'd add it.
leightonw87 - If you want to limit the frame rate to something other than 60fps, turn V-Sync OFF
I feel there should be some info about this in this thread :) http://community.clickteam.com/showthread.php?t=72381
I spent many hours trying to optimize from png to smaller sized jpg images only to realize it does not help
Is it possible to make a scrolling game with (or even without) parallax backgrounds that runs well on iOS? I've been testing with xCode and it's playing agonizingly slowly. I've tried chopping up the graphics into smaller chunks, checked global color reduction, and am not using alpha channels or transitions.
I'm curious, when looking at the debugger, how many MB should we aim to stay under for good performance? I have an early test level running with a lot of features missing at 30MB, and plan on adding a lot more.
ipod touch 4g has 256mb of ram, take away about 100 for runtime to give a rough estimate of spare space so you should have plenty to work with. I think the ram readings on the pc rumtime will differ to the iOS export results, there is a way to check ram useage in xcode when running an app but not sure where about in the settings it is.
100 mb for the runtime! This is a lot.
To be sure on how much your game uses memory, use the Product / Profile option in XCode, then choose Memory allocations.
You should look at the column "Live allocations" which represent the memory currently used by the game.
Ahh, thanks a lot. I'd like to get as much out of it as possible! :)
I've had a bit of an idea, if changing the framerate at runtime works on iOS that is, I could create an example which detects the device with the iOS Get Device extension and adjusts the framerate, then changes the game speed to match. There's an example which gets the current framerate and creates a 'delta' value to move things faster when the framerate drops etc. but that's unusable on certain elements, in particular the Advanced Platform Movement Object, and it can be a tad jittery. My method could lock the framerate to 30 on older devices and double the speed of the movements etc., worth a look, but I think it'd require disabling VSync...
Still not having luck here, can I post my .mfa and see if someone can track down what is causing the slowdown? According to the xcode memory reading its somewhere at 130 MB, which is way too high.
One thing I wonder about pictures, is there any easy way you can make sure you dont use a dublicate image that take up double file space? For example say import a png taking up 500kb. Then i create a clone of that and change 1 pixel of the new clone, now it will use 2 png:s of 500kb each right just for this one changed pixel?
I'd been using 50fps due to it keeping things working like I'm used to since my days of click and create. But I will now suggest that everyone adapt to 60. For Clash Force i used 50fps and did ok, but it was a simpler game, smaller levels, less objects, etc. in polyroll I have some large stages and I was getting some slowdown. 300+ active objects. . . So I tried vsync. Smooth as silk. No slowdown. It doesn't run faster simply because it's a higer framerate, it actually eliminates slowdown and runs without missing a frame. I'm guessing this is due to the fact that ios devices run at 60hz, so it doesn't have to do any processing to match the framerate.
I'll have to go back and make a few changes (leave a little more time for disappearing blocks to vanish, etc.) but overall this is the solution.
I'm going to check now and see if it fixes my layers slowdown issues.
Not related to ram or image size and space but any events not running all the time, disable their group constantly! when I rebuilt the engine for my game this is one of the things I really worked into the new events and I am really getting some good performance out of a regular 4g touch compared to before, such as if it's not visible on the screen disable it, if it's dead disable it, if it's something which moves you only enable the event group when touching it.
I know this kind of stuff should be standard but when making a game for these little devices all the power you can save really shows.
Wow, so glad I read this....going from 50fps to 60fps made a huge difference in my game :D
About FPS, I also prefer 60 fps but for Flash it can sometimes be good to go down to 30 fps to get a more stable framerate if your game is performance heavy. I worked around this by developing in 60 fps but having all events that are dependent on fps to be multiplied by a value that is either 1 or 2. So if I build the game in 60fps I set the value to 1 and if I build it in 30fps I set this value to 2.
I read about turn off "visible at start" if you object it's not in use.....but if the object it's turned "create at start" to off it's neccessary to turn "visible at start" to off too?
paobrasil, I doubt it would make a difference since you aren't creating all objects at once, but only when needed.
One thing that may sound strange but that I have wondered about is if there is any difference in setting a "animation" with one frame to loop at the speed of 100 or 0? Its only one frame so nothing is changing, but maybe its still better to set it to 0 so it loops less times?
Outcast - Not sure if this is still the case, but I seem to remember it's better/faster to not loop the animation if you can and use a speed of 100 so it gets to the end of the one-frame animation quicker - seemed counter intuitive at the time! Remember some animations will revert to Stopped if the Active isn't moving or Walking/Running if it is - so only suitable for single frame Stopped animations.
OK, I have my app, but it's running at 20 FPS... I've tried all these optimization techniques, but still it runs slowly.
I can provide any and all information, but I need to optimize this QUICKLY, so I ask kindly for your help!
Never mind, sort of fixed it!
Best optimized way to detect if an enemy is near. Which is better?
1. Use the expression editor and have an always event that looks at the enemies x,y and compare to player x,y plus say 50pixels = enemy near
2. Create a 8x8 pixel invisible dummy object, scale it 10x and have it follow player x,y. When enemy overlaps dummy = enemy near
In general in am curious as to if events where coordinates, transparency, scale, angle etc. are constantly being monitored is bad for performance?
For instance, instead of using a predefined movement say Bouncing Ball, I choose static and move the object (current pos -1) again, which is better?
I use "enemy is getting closer than (negative value) to Windows's edge"
Does using many layers (10+) take up more memory than using only a few?
I have around 50+ layers in this and it runs very well in Exe. In flash it is another story but I don't think that has anything to do with the layer count so layer number seem not to affect performance that much. http://www.youtube.com/watch?v=UyjwOSUydeo
is there a way to tell mmf2 when to load and unload specific graphics of the game?
so that at the start, the game doesn't have to load the entire library...
on the item go to the runtime tab (red play icon) and disable the create at start box, this keeps it out of memory at frame start up.
Then on the same tab enable the load on call option, this makes the item load into memory the moment you try to create it from the event editor.
I believe that is right...
Not sure you might have to wait until a frame transaction before the memory is reset.
Calling the item the way I said can sometimes change how events work, for some reason it works fine for zombies in my game but another enemy which jumps on you when you walk under it will just sit there, could just be my event setup.
oops double post
Hey guys, I've been reading through this topic, and it's helped me out quite a lot. Although I'm still running into some small issues.
The game runs pretty well at a stand-still (no scrolling or small, non-scrolling frames), but once it does start scrolling it bogs down.
Perhaps I'm right at the brink of acceptable memory usage for my 3rd gen iPod.
I'm not using layers, extensive animations, or large actives. I do have 840 lines of events and I use a bit of Alterable Values and such, but do you think they would really be choking the system that much?
It's nothing like a 360 movement sonic engine or something, just a GB-themed game with simple animations, 8-bit music, and 8-bit sound effects. I don't use WAVs, but Oggs instead.
Here's a screenshot of what I'm working with, the resolution is only 160x120.
https://dl.dropbox.com/u/1567369/Scr...s/fluggb31.png
I'm not sure where I'm going wrong. I've already reduced the frame's runtime memory from 20mb to 15mb. The overall Xcode project is 122mb, and the Memory Allocation test said I was using 83.86mb. (which sounds problematic for a 3rd Gen)
Granted, I only changed one frame so far from the original PC version...maybe it'll run a bit better once I edit the rest of the frames?
Try converting the music to mp3s. Oggs I believe is automatically converted to wav and is therefore useless for ios development.