Here is my experience on Windows Phone 8.0 and 8.1 when targeting HTML5 and issues I’ve been running in to:
If I provide ANY audio, the game fails to finish loading. Otherwise, it completes an runs.
Touch input doesn’t fully work. I tried IE on Windows Phone 8.1 on a lower-end device and they did work just fine. On a separate, faster device, I tried Windows Phone 8.0. Button presses were not being detected and every time you tap the screen, the entire game content area highlighted briefly. I upgraded this same device to 8.1, and the highlight has stopped, but clicks are still not detected. Mouse X and Y do report correctly if you drag your finger around/ tap. This is weird to me as both of these devices are the same manufacturer and line of phones.
Frame rate is poor if much is going on in game. As a test (on all browser/device combos), I displayed 250 sprite sheet animations simultaneously. PC/Mac browsers can handle this at steady 60 fps. Android and iOS browsers fall down to 25-30 fps. IE on Windows Phone drops to 1-5 fps.
I would also like to see improved support for Windows phone (many clients want to include these devices nowadays). If anything I’ve mentioned is better fit for another thread, let me know. Also I can provide more details/answer questions to help.
The audio issue could be a matter of providing the format it expects, or it could be a SoundJS bug (like we’re talking about on the other thread).
I believe there were some touch event coordinate fixes in recent dev builds, on browsers that dispatch mouse events, its not an issue, but some devices or systems report only touch events, this fix has not gone out in a release yet, but could be worth trying: https://github.com/openfl/lime/commit/f2d8b91306d86ccbc3b6ef96bd8ecb87e576fdcb
Some browsers suffer from overdraw, it’s possible that using “-Ddom” for DOM mode would help, as it means you can use a static background image (for example) and have it remain in a DIV instead of being blitted each frame. Any BitmapData operations will still blit to a single canvas, so .draw or in the case of sprite sheets, Graphics calls also blit to a single canvas, so that might still perform as expected.
With Windows Phone 8.0, I expect that C++ support could be done, now, but each time I reached out to Microsoft employees with certain questions I had, I never got anywhere. I’m also unsure of the time commitment for getting it all working and supporting it, but if Microsoft or anyone else were interested in helping make it a reality (assuming we would use ANGLE to use OpenGL rendering over DirectX, I think) then that might be a much better target long-term than only HTML5, though we might as well improve any low-hanging fruit with the HTML5 support regardless
Thanks. I will try that updated code and see if it makes any difference. UPDATE: I updated the hx file you posted, and it didn’t make any difference to IE mobile : ( UPDATE 2: See below post re: mouse events. UPDATE 3: Fixing this to the correct event type (MouseEvent) has enabled audio playback. Two birds, one stone!
I also forgot to mention in my post that I cannot get IE to play any audio via openfl HTML5 target (if I runtime load instead of preload, which never advances). I need to do some more testing, but audio will play on PC/Mac/Android/iOS in any browser with me only providing OGG and MP3 formats. The browsers can all play M4A files on their own without plug-ins or the like, but just not through openfl/soundjs it seems. Again, I notice M4A is not considered in some source code (that I think was in soundjs), so I will try modifying that and see if I can get that format simply working. I’ll also check out soundjs threads to see if anyone has mentioned this there and report back.
And I forgot to mention, for the touch support, I am using TOUCH_BEGIN and TOUCH_END to toggle a down/up state on a button and trigger the callback. I also tried swapping in “pointerbegin” and “pointerend” event strings to no avail (supposedly IE supports these). UPDATE: I changed the Touch events to Mouse events and it is working now on my windows device. Sigh, I guess yet another conditional for IE. Wonder if we can eventually support Pointer events to mitigate these issues (http://www.w3.org/TR/2014/WD-pointerevents-20141113/).
If you can get at the event chain, that may help a bit. Here’s along the lines of what I had to do for IE mobile detection when I register my events:
#if js
var userAgent = js.Browser.navigator.userAgent;
var mobilePlatforms = ~/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i;
//check if platform is IE mobile
if( userAgent.indexOf( "IEMobile" ) > -1 )
//use mouse events...
//check if platform is mobile
else if( mobilePlatforms.match( userAgent ) )
//use touch events...
//non-mobile
else
//use mouse events...
#end
So in your case, for a quick fix, if IE mobile then detect MouseEvent and dispatch a TouchEvent in it’s place.
It may be worthwhile/better to incorporate Pointer Events, since it seems like that’s going to be the new web standard, which would mitigate these checks. For now, maybe we can safely deal with events through a PointerEvent type (listen for touch/mouse and dispatch Pointer in-place of) until PointerEvent is fully supported across browsers, then we can switch to use it normally. What do you think?
UPDATE
One of the updates to openfl (I suspect) seemed to resolve the mouse event problem where it wouldn’t trigger on mobile. I still think it’s a good idea to go with Pointer Events, but for now Mouse Event works again as intended on mobile touch screen browsers.
We should catch mouse events and dispatch a touch event in addition to it, already. I wonder why this is not working, yeah, but I think we need to handle pointer events where appropriate
Long-term, I think that native support of Windows Phone and the Windows Store are ideal, I’ve had serious problems trying to get it to work, and the Microsoft evangelists I spoke to said they would find someone to help, but never did. I understand, though, it’s hard to find the right person sometimes
Hi Joshua,
Maybe this will sound crazy , but do you try to reach Satya Nadella ? He try to make a dramatic changes in Microsoft with shift of some product to be using on other platforms such as Android and iOS ( MS Office at example) . I think if you write to him a letter with clear explanation what you try to achieve and how this will help to Windows ecosystem ( the benefit will be enormous , more games and application in windows store, more developers ) he will response. You can’t lose it if you try. This is him email which I found in internet : satyan [at] microsoft.com
Have you contacted MS Open Technologies? They contributed (and maintain) a Windows Phone back end to another popular open source game engine for all the reasons @LarryB mentions above. This is the one I’ve started working with now because I have to target WP8, but I’d really much rather write Haxe than C++
Also, are you aware of the Kha engine? It’s also Haxe, open source and can target a lot of platforms including WP8 and even PSM. Perhaps lessons could be learned from its code?
I’m also intrigued by the console targets that have been mentioned. If XB1 is on the list, as it seems to be, then doesn’t that imply a DirectX compatible back end is coming?
In order to have Windows Phone support, as above, HTML5 is already available. However, native code performs much better on a phone. Microsoft just announced Win32 support for Windows 10 (which will run on the phone), however, I believe this uses a VM, so not sure if it will perform as well.
Here are the steps we need to go for straight WinRT support:
Build Lime for Windows RT (lime rebuild windows -Dwinrt or something like it)
I think most of our libraries should be WinRT compatible, we don’t really know until we really start trying to build. The big one is SDL, which I believe has Windows Phone support now (though we may need to update to a newer dev release of SDL2 in order to run stable). If all goes well, all of the above works, and then we need tool support to build/run/test properly for either Windows desktop or Windows phone using the Windows “universal” binary format
Yes, our HTML5 target uses Webgl by default, which should improve performance. Lime has also been made to work with ANGLE, and we have initial support for C#, all of which may lead us closers to a Windows Universal app
Are you looking for phone, or Windows Store support?