Hello I have a problem, when I run my game without wmode set to direct everything gets really laggy. I am using fixed frame rate if that changes anything. I am just wondering if I am going to be able to get my game sponsored if it needs wmode to be set to direct? Is there any way to make it run smooth without wmode set to direct? What I think is weird is that the game runs att 40 FPS both with and without the wmode thing but it looks jaggy without it. If you need any code from the game to help me just say so. Thank you very much for any help!
Game lag without wmode = "direct"
That is odd; as far as I know wmode=direct only effects Stage3D rendering which FlashPunk doesn’t use.
Are you using Google Chrome? There is a known issue with Google Chrome and flash games; see this link: http://www.reviversoft.com/blog/2013/03/fix-adobe-flash-problems-in-google-chrome/
This is a well known issue amongst flash gamers and anybody who plays games regularly is likely to have fixed it already.
If you’re NOT using Google Chrome, then I’m not sure what’s causing the issue… though it could be that it’s running at 40 fps instead of 60, thus causing some Vsync issues. Try setting your game’s framerate to 60 (or a straight divisor of it - 30 is the only realistic alternative though 15 would technically be one too, as would 10) - perhaps wmode=direct changes Flash’s Vsyncing behaviour?
I am using Firefox… If I set the framerate to 60 the movment will happen faster, but the frame rate will be somewhere between 40 and 60 according to the console(No matter if I set wmode or not, although it semms smoother with wmoode). Is it that my code is super ineffecient or is it my computer? I am guessing that it is my code. Any other ideas?
The debug console itself is a pretty bad indication of framerate - unfortunately having the debug console on seems to actually cause a pretty significant hit to the framerate, most notably it often drops the framerate to 40fps (I’ve seen this in many games).
Try disabling the debug console and outputting your framerate using some other method (an Entity with a Text graphic, for example).
Another thing to make sure of is that you’re making a release compile as opposed to a debug one, and using a release flash player instead of a debug projector (if you’re testing in the browser then you’re likely using a release flash player plugin).
I used an entity to display the framerate, it is still 40 FPS. It seems to be running with a higher frame rate without wmode, alomst 60 without it and with it the FPS just stays at 40… If i create a empty project with just a main and a world without anythin in it it is stil the same thing! Maybe I must update FP or something… I am out of ideas
This seems like very strange behaviour. Maybe set up a couple of web pages (one with wmode=direct and one without) so I can test on my end? I have various things I can test on (even some really REALLY weak computers) for you.
I tried it out on my old computer and there the empty one runs at 60 FPS but the game runs at about 30 - 40 FPS. I also tried to restart my computer but still the same sthing empty at 40 FPS and the game at about 40 too. Maybe I should try reinstalling flashdevelop or something, I am totally lost. Or if you would like to look at my code and see if it has something to do with that.