I have a project where it rotates 2 spindles 360 degrees both at different speeds over time. I have noticed that it runs well on simulator but when I test it on a device it is significantly slower. The timing taken to make the first 3 full rotations on the simulator and the device are:
On Simulator: 7.0, 7.2, 7.2
On Device: 19.3, 19.5, 19.7
Essentially the project works but I'd like to find out why there is such a big difference between device and simulator and I thought CGContextRotateCTM might be the source.
Sounds right.
Don't forget, when you run the simulator, you are actually compiling native code to run on your native x86 hardware. Assuming your Mac runs faster than the 800MHz ARM chip in the iPhone - no surprise it will run faster in the simulator.
If you need deterministic timing in your application, your going to need more work to achieve that. This is where people use things like the UIView animation timing, NSTimer calls, or cocos2d inter-frame timers to give deterministic time to their animation calls.
If you don't - when the next gen device comes out with a faster CPU - your app will again be messed up.
Remember when they used to have "Turbo" buttons on PCs to deal with this?! :-O
Related
After upgrading to Xcode 7 with Swift 2, my Sprite Kit project is very laggy on the simulator.
It previously would get 60 fps, and now it maxes out at 15 fps. (If I remove all textures, it goes up to 60, but even adding a single screen-sized texture drops it all the way down to 15 again.)
I've tried running in release mode as well as debug, and it makes no difference.
It's still smooth on the device.
Has anybody else had this issue? Any fixes? It just makes it hard to test.
The simulator will almost always have lag due to the fact that your computer is emulating the device (so yes I have had your issue). It is not really a problem with your App (unless you changed something massive in your App during the upgrade). I cannot speak to why the frame rate dropped on the sim from the upgrade (probably something not optimized yet, plus more features in iOS 9 slowing down the sim), but as long as it is good on the device, you should be good.
If you elaborate on what your setup is (what device(s) you have, and computer hardware), and what you are releasing to, I can provide more accurate information.
Another thing that may help is restarting the computer, that always seems to help when Xcode gets funny.
I recently created an app in flash cs6 to be used on my iPhone 4.
The app doesnt need to work through the app store its just a tech demo but when i put the app on my device all the animations become really slow/choppy.
My iPhones up to date and im using air3.2 (i did try updating to air 3.7 but then my application just became a white screen)
I have also tried cacheing all the movie clips as bitmaps bit it doesnt seem to make a difference.
(the app works fine inside the flash simulator)
please help?!
There could be a few reasons why this is happening,as I am taking a punt here as you havent gave much information on what your doing.
but your frame rate may have effect.. how are you creating your tweens?timeline animation or tween scripts.I found tween scripting works better as its distance over time opposed to distance over frames.
Also depending on your animation, images sizes, event listeners etc..
You need to take inconsideration your device itself and the resources it has available, free memory or actual storage available.
The reason it will work freely on your PC would be due to the fact of less limitations, your pc has more to computes and resources to throw at your application .
Add this line to your code to check your memory:
import flash.filesystem.File;
this.addEventListener(Event.ENTER_FRAME,performMemTest);
function performMemTest(e:Event):void {
trace(System.totalMemory);
}
I have read anywhere around 14MB++you may experience problems.
I'm working on an iPhone game using OpenGL ES. I recently updated my iPhone 3G to iOS4, and ever since the update, when I've been play-testing my app I've been getting very high latency on my accelerometer and touch events -- my phone will often respond a second later than it should, which makes the game unplayable. This doesn't occur all the time -- about half the time the game works perfectly. I've set up the accelerometer following Apple's guidelines; one of my view controllers calls [UIAccelerometer sharedAccelerometer] in its init method and implements the appropriate delegate method which just grabs the x-component of the UIAccceleration object, and I have another view connected to a view controller that detects touches using touchesBegan:withEvent: and the other touch event handlers.
I emphasize that this worked fine when I was running 3.1.3. I'm totally stymied. Has anyone run into this problem before? Is this a known bug with the 3G and iOS4? Should I update to CMMotionManager?
I think it's been widely reported that 3G and iOS4 don't play nicely... very sluggish lack of responsiveness over all. You would be wise to do iOS4 testing on an iPhone4 or 3GS.
Touch events shouldn't lag. What you might be experiencing is some form of render lag (not sure how deep the render pipeline, but in many PC games it's noticeable at not-so-low framerates), which feels like input lag.
Apart from that, I dunno. CMMotionManager produces much nicer data, but only works on iPhone 4 IIRC.
I would like to have a program that build a program that uses the accelerometer to count the number of time an iphone spins (either on a table top or when tossed in the air ) any suggestions?
The iPhone 4 may be able to do this, as it has gyroscopes that are not affected by acceleration, but when you spin a device with an accelerometer the accelerometer will just report that it seems like there's a large acceleration pointing on a vector from the center of rotation straight out.
You throw your iPhone in the air?
Just a heads up if you're planning on putting this on the App Store - Apple rejected/removed an app that measured the speed an iPhone fell at while being dropped. The reason they gave was because it would encourage users to do things with their iPhone that would potentially damage it. Your app would likely befall the same fate.
I'm using the cocos2d framework for various of my applications, and have run into the following problem. I have set up a few sequences of actions and CallFuncNDs, the actions have durations set up and when I run it in the iPhone simulator, it works just like I expect it to: transitions take the amount of time I set them to and they go in the correct order.
When I test it on my provisioned iPhone, it all plays out in less than one second. Correct order, timing is proportional between actions, but it's all compressed into one second.
Any one have any idea why the cocos2d animations would behave differently on a device? My code is all set up similar to the cocos2d effect demos, with the difference that I am animating a ParticleSystem and not a Sprite - though the problem still shows up with Sprites.
I have experienced similar difficulties where testing the code in the simulator, it runs flawlessly. But when moved over to the device, the timing appears to be off. I've attributed this difference to the Simulator's use of the desktop CPU and Memory, where as the device is utilizing it's physical hardware and the timing is off because of how Cocos2d processes things (frame by frame, in a 'game loop'). When you start doing a couple things, the frame rate drops and Cocos miscues ... especially when you have schedules that run extremely close to each other, or schedules that cancel themself and reschedule with different timings (in increments as low as 0.1 and below is where I've run into this the most).