Wow, some really insightful posts.
Thubie, when I bought C2 the '*' wasn't part of the information on the main page. There was a very strong push that HTMl5 games will run at native performance. This isn't true and i didn't expect to really run near native performance. Just good enough. I would like to see a poll on this also.
purplelava, wow. I totally understand where you coming from, [snip due to post being removed] I do agree with this sentiment however
"C2 effectivly makes 'casual' games, yet is only effective making desktop games. Where as desktop games offer robust games which mobile is a harder"
Personally I don't believe the term casual and hardcore.
I will also chime in. I'm still good on a kickstarter program to support Scirra or another to create exporter or an effective native running of games.
kondisius, I still agree.
Ok going on to my own thing. i decided to take up Ashley's un worded challenge that we need to be better game developers. ie it's logic, sprites, poor performance options. So i wrote this while working on meeting Ash's challenge and came up with some serious surprises.
After repeatedly hearing from Ashley that our logic and games were at fault. I decided to take up the challenge that a minimal no event logic game will have poor performance on my Tegra 2 android device.
I started by searching for an android demo program to determine capable FPS on my tablet. I found the app FPS2D. The simple result was that the FPS was 60fps with a deviant of up to 8fps. FPS2D had an empty black background with what looked to be apx 8x8 ball. This would be the standards of my C2 test for UIWebView.
So my demo was going to be a black background with an 8x8 bouncing green ball. The ball has the bullet behaviour and will be colliding with solid's that are just on the outside of the layout. This technically adds a little more overhead for collision. Here are my tests and I want to point out one of the results was outstanding. Also test results resizing was not clean due to browser. So some tests were not "fitting" screen right". I also err on the lower side of the deviant results(so if fps was 12-15, 12 would be the reported value)
*due to the header bar and resolution often the the view-port would be rendered off screen. This could be the the cause of many slowdowns.
*Pixel rounding on
*clear background with a single layer, black colour
*as a note interger scale would product a very small view of the game which is probably why speeds were goo(follow up commentary on this at the end)
*test capx https://dl.dropbox.com/u/14087254/ballbouncetest.capx this was often modified to suit the test resolutions. so it's not a straight go to use for multi res. But I'm sharing to show the simplicity of it. So that there is no question on our design logic.
*since most developers want to pack there game. using browsers is not ideal solution. however they were tested to have an idea how there canvas2d runs.
*2 Apple devices were added.
Here we begin--------------------------------
*fps format(no scale, crop, scale, letterbox, letterbox integer)
FF with WebGL by far had the worst results right across the board. Don't waste your time right now.
integer: There are dips as low as 30 fps, but this steadies out
720p (28,24,25,27,64) these were surprising results
crop: was all over the place and never steady enough to report.
integer: starts slow but quickly reaches 60+
Better than FF WebGl, but overall not a better browser to use.
Chrome overall had steady results
I feel these are the key browsers as any embedded app will be
based on these
Android Stock jellybean(canvas2d)
480p (55,35,40,46,59) acceptable across the board. with rare dips
integer: That came from no where
integer: rendering is not smooth. it was flickering and steady
iPad2 Safari(IOS 6x, canvas2d)
as expected this performed solid right across the board. However this is running A5 Chip which is better than the Tegra2 and more comparable to Tegra 3(which is the current development chip). this offers a lot of good promise for Tegra 3 devices which I don't have at this time.
1080p (54,60,60,60,60) This is the first time it's dropping below a solid 60
iPod Touch 4g (IOS 5.1, Canvas2d)
This by far has the most strangest results. I also started testing at 720p when I thought about adding it to the test list for comparisons. Due to the strange results this by far has the most commentary.
720p (45,50,84,84,90) the results are steady and usable
off: the ball was doing a lot of jumping. very far from smooth
crop: can't see much of the viewport at all, but the ball was a lot smoother
scale: 85fps with but with common dips to 75
letterbox integer: WTF????????? this actually dips as low as 95fps. however the animation was never as smooth as the ipad2. I think the iPod Touch was just blazing out the canvas renders, but logic took longer creating this less smooth effect.
After spending hours doing these tests I feel this explains a lot of the communication problems between Ashley and the vocal native part community. UIWebView does seem capable, but only under certain conditions. These conditions however strict and makes it a lot more work.
OFF: The results of this are across the board. I suspect the dips in performance has more to do with rendering the canvas offscreen. A canvas size that does not exceed the the window will probably have good performance.
CROP: not worth using
SCALE: Is not worth using. yet it's the primary suggested path to mobile and easiest to implement cross platform. But this get's the worst set of performance :(
Letterbox: Not worth using
Letterbox integer: This is by far the best average and reliable performance across all resolutions.
Not always the best, but never the worst. The problem is that none of my tests ever had this scale fit the screen. often it produced significantly smaller screen sizes. ideally it would be best to create games based on this scale and find a way to get games to fit.(addendum below)
WebGL universally had poor performance. This is where Ashley is 100% correct. WebGL would not solve the speed issues for simple rendering. Advance rendering may end up with different results.
Letterbox Integer testing follow up
I spent some extra time just playing with this scale option on my tegra 2, iPod T4g, iPad2 at 720p. resolution had impact, but not as much as expected.
Android: 80 bouncing balls produces 25-35 fps
iPad2: 80 bouncing balls produces 50+ fps
iPod: 80 bouncing balls produces 50+ fps
Android+CocoonJS: 80 bouncing balls produces 50fps
This produced overall very promising results and for me acceptable for my more minimal games. 80 bouncing balls is far jump from just 1 ball from all the tests previously done. Also the results are fantastic in comparison.
However with all that goodness there seems to be a big BUT. After the promising results I decided to test out my Ouya game to the new options.
Draoust with letterbox integer
I required to do some tinkering with what I had in the game. I was able to manage to go from 20fps to 32fps in the stock browser. Which is about a 30% improvement in performance.
It looks like the end performance results to all of these testing is that there is some kind of critical problem with scaling with Android UIWebView. Performance is best on a 1:1 scaling ratio. Also make sure that the canvas does not extend past the available screen size.
Draoust with CocoonJS
Main menu runs at a solid 60fps. However there isn't much happening
Gameplay runs at a steady 50 fps with common dips as low as 45.
These results are super acceptable for my Ouya game. it's just to bad CocoonJS crashes on the Ouya. But hey come March maybe Ludie will have one to test and fix to run :)
About 80 bouncing balls
While 80 bouncing balls is a fine for common performance of I think simpler games with out lot's of effects. It by no means will compare to a native app. However it's fine for me.
When designing your game. Get your best FPS with just a simple bouncing ball. Then work up form there. Test constantly on your mobile device. If there is a sudden drop then check the recent changes you made.
I still support native exporter or an official Scirra C2 Wrapper that's community driven extensions, but for now I think I can settle where C2 is. I look forward to getting my Ouya and testing Draoust on the Tegra 3 that has similar to the A5. And maybe Ashley can check on the scaling and see if there is anything that could be done to get "SCALE" to work better. On that scaling note. I'm not sure how C2 handles scaling, but I recall reading a post last month on straktrace. The indivudual found that using CSS3 transforms on a canvas2d produced far better performance results when scaling. This might be some angle to look at :)
Grats to Apple for creating an incredible performance rendering even on the A4 chip :)