shmups and framerates.

Monkey Forums/Monkey Programming/shmups and framerates.

Paul - Taiphoz(Posted 2012) [#1]
Sup all. looking to chinwag with some one else whos made a shmup with monkey.

Target is Html5 and Flash but the final target will be xbox 360 and windows phone.

In Short :: Getting dropping frame rates when I start blasting with my guns, and drawing some particles.

Long Version :: Ok, so in my shmup. I am throwing around about 30 player bullets on screen at a time, each checking for distance between themselves and any available aliens, I am also creating two particles if any bullets collided with something and rendering them out with a reducing alpha.

With about 30-40 bullets, and about 50 particles plus 1 alien and 1 player I am getting a reduction in frame rates from 60 down to around 50, this is in Html5 and flash their both performing the same.

So I have a few questions really, and would love some thoughts of those who have worked with a shmup and these targets, as well as mobile.


1. I was wanting to run things at 60 frames per second but that's looking like it will need to drop to 30, do you guys think 30 frames per second is fine for a shmup or do you think I might be better getting that 60 frames.

2. I made a small assumption that Html5 and Flash in terms of performance are at the bottom of the pile, with mobile hardware able to cope with more than them, am I right or is the performance I see from html5 and flash representative of what I will see when I finally build my game for say, windows mobile or iphone.

Suggestions, always welcome.

Oh and browser I am using is Chrome in case it matters.


Paul - Taiphoz(Posted 2012) [#2]
wow - just tried it in firefox, upped the aliens from 1 to 10 which of course upped the number of bullets and particles and it was fine at 60, it dropped to 55 in the really hellish bullet swarms but..

I am surprised the results between chrome and firefox are so different. will still love to hear comments tho ..


slenkar(Posted 2012) [#3]
THats weird ie9 is supposed to be good for canvas games too


muddy_shoes(Posted 2012) [#4]
HTML5 performance is highly variable across different implementations. Chrome was consistently faster than any other browser last time I tested with box2d but that could have changed or your code might be hitting very different aspects. You might want to try switching on the GPU accelerated canvas in about:flags to see if that helps.

Flash is mostly faster than HTML5 at the moment for overall games performance. Both Flash and HTML5 on a good implementation on a modern laptop will probably be faster than the Android build on a low-spec phone. There is no definitive answer though as each platform/implementation has different strengths and weaknesses.


Paul - Taiphoz(Posted 2012) [#5]
How do you turn that on exactly ?

a case of trial and error then , test and see what happens, I was afraid of that. oh well.

But yeah will need to check that 3d thing on chrome, dont suppose you have a link or keyword I can search for on Google?


muddy_shoes(Posted 2012) [#6]
Just type "about:flags" in the address bar.


dave.h(Posted 2012) [#7]
i experimented with a kinda shootemup using 30fps in html5 and then put it on my android experia x10.I just wanted to see how many graphics i could get moving around at once.The link below is my result in flash but it ran great in html5 and android with no slowdown.If i remember correctly there can be 50 aliens + 2 mini bosses all capable of firing,aliens are animated,base ship + shield both animated,3 scrolling backgrounds and up to 50 bullets at a time on screen at once.Also explosions, power ups, and asteroids.I was pleased at how well monkey handled it and was even more pleased when it ran smoothly on android.


http://www.gamecentaur.com/space-invaders-.html


Soap(Posted 2012) [#8]
Which version of Chrome are you using? 17 is not released as stable, but people say it will be very soon. Install either the Beta or Dev channels to see how the game with the improvements made in 17 now:

http://www.chromium.org/getting-involved/dev-channel


Paul - Taiphoz(Posted 2012) [#9]
Turned on the 3D stuff and its still crap, firefox is still easily out performing it.

It could be that on the PC I am on, firefox is just more efficient at running my code , I dunno, either way, firefox is a lot faster than chrome for me at the moment.

its something I will be checking regularly from now on to see how things change.


Soap(Posted 2012) [#10]
Which version of Chrome are you using? I'm using 19.0.1036.7 dev-m


Paul - Taiphoz(Posted 2012) [#11]
17.######

gona go get the update now.


Paul - Taiphoz(Posted 2012) [#12]
actually about says its upto date. you got like a dev build or something ?


Foppy(Posted 2012) [#13]
Perhaps try to turn off the alpha effects (on the paticles etc.) and see if that helps.


Soap(Posted 2012) [#14]
Yes, dev... are you on stable or beta? Can you post something for us to test?


therevills(Posted 2012) [#15]
If you didn't know, SetColor is really really slow for HTML5...


Paul - Taiphoz(Posted 2012) [#16]
therv yeah m8 Iv read that a few times, which is why I am hard colouring the sprites so that I dont need to use it, means more images but at least I wont have the slowing issue.

Nothing for you to test at the moment, game is still in heavy development, I am getting closer to being able to open it up for beta test tho, at which point I will probably give 10 or so people accounts to access my site where the game will be hosted.

If your interested in helping me out with the beta just get in touch, either way when its ready I will be putting up a notice in here, and on the indiegames dev facebook group. and probably in the ludumdare irc channel.

till then.! :)