WP Emulators Don't Work With My Unity Build

I’ve been working on getting my game ported over to Windows Phone 8 and I’m having a tough time with the build in an emulator. Unfortunately I don’t have a Windows Phone to test on so I have to rely on the emulators. I’m using VS2013 Ultimate on Windows 8.1.

No matter which emulator I choose, the build and deployment work, but the app bugs out on the emulator itself; it begins flickering back and forth from my game’s starting scene to another scene it has access to from a GUIButton (credits).

The most interesting part about it is that this works fine as a Windows Store build (8 and 8.1), as well as via Unity Remote on iPhone and iPad. The start scene works fine and it responds to tap or mouse click events.

I can’t tell if this is a WP emulator issue or an issue with my code and I’m hoping someone can help given that I have no access to a WP and I’m trying to enter this game for a DVLUP deadline.

The code is very vanilla. My intent is to provide 2 GUIButtons on the starting scene, each linking to either starting the game or viewing the credits for the game. The credits scene is loaded and then checks to see if someone clicked Return, at which point the start scene returns. This script, called Menu, is added to both the start and credit scenes.

void OnGUI()
    {
        GUI.skin.font = f;
        GUI.backgroundColor = Color.clear;
        GUI.skin.button.fontSize = 40;

        if (Application.loadedLevelName == "Start")
        {
            if (GUI.Button(
                new Rect(Screen.width / 2 - 250, Screen.height / 2 - 100, 300, 100),
                "Tap To Start"))
            {
                Application.LoadLevel("Main");
            }

            if (GUI.Button(
               new Rect(Screen.width / 2, Screen.height / 2 - 100, 300, 100),
               "About"))
            {
                Application.LoadLevel("Credits");
            }
        }
        else if (Application.loadedLevelName == "Credits")
        {
         
            if (GUI.Button(
             new Rect(Screen.width / 2 - 150, Screen.height / 2 + 150, 300, 100),
             "Return to Start"))
            {

                Application.LoadLevel("Start");
            }
        }
    }

Hi,

I’ve seen this issue before - sometimes Windows Phone 8.1 emulators bug out like that. Since WP 8.0 emulators don’t ship with VS 2013, could you try downloading them separately from here: http://www.microsoft.com/en-us/download/details.aspx?id=41559 and check whether the issue still occurs?

Thanks, I’m downloading them now and giving them a shot. I thought the same emulators were installed when I updated the Phone SDK, and the emulator names look like I may already have them but I’m trying anyway.

This didn’t work.

I tried loading up the new 8.0 Emulator 720p and the smaller WVGA one and it does the exact same thing. There are no build or compiler warnings, just a note about an unsupported shader. And each takes quite some time to boot and install the Unity app.

WARNING: Shader
Unsupported: ‘Parallax Specular’ - Pass ‘FORWARD’ shader state not supported

Do you have a screenshot of what’s going on?

Here’s a 1 minute video that demonstrates what’s happening. In my case:
http://screencast.com/t/noxHI7wIsQx

Built from Unity Free 4.5.2f1
Windows 8.1 Pro
VS 2013 Ultimate as Administrator
Emulator 8 Update 3 WVGA (but occurs on all the older and updated Emulators)

Works normally as Windows 8 and 8.1 store app, as well as on iPhone and iPad (will test Android also) via Unity Remote on OSX 10.9.4. The project opened in Windows is the same project used in OSX for Unity Remote testing.

You’ll notice that the output window shows there’s a constant unloading of the scene “to reduce memory usage”. I didn’t see anything that looked out of the ordinary from a code standpoint and my assets are minimal on these 2 particular scenes it keeps flickering back and forth to.

Oh, I misunderstood you. I thought you were having graphical artifacts, like this:

http://assets.overclock.net.s3.amazonaws.com/8/8a/8a91afe5_vbattach13495.png

Anyway, this is a known bug - the problem is that input on Windows Phone emulator is broken on Unity 4.5.2f1 (physical devices are not affected):

Fortunately, this was fixed in our 4.5.2p1 patch release, which can be located here:

A word of caution: download only patch releases which contain the fix you need - they aren’t thoroughly tested by our QA so by downloading newer builds you’re risking to run into a yet unknown issue.

1 Like

Will do, although I’m working on a cheap Lumia which will hopefully help me circumvent the emulators. Thanks a bunch for your help.

I actually can push to the 512 MB emulator with a project built from 4.5.2 (without the patch). It does throw an error with communication from the emulator but it still works and debugs just fine.

One thing to note… I’m running Visual Studio 2013 Update 3… maybe it’s because I have Ultimate but I have both WP8 and WP8.1 emulators. It could also be because I have VS2012 with the Windows Phone 8 SDK installed as well.

If you want, I have a physical phone (HTC 8X running Windows Phone 8.1) that I can deploy to and test on for you.

Thanks for the offer - I ended up picking up a Nokia 520 for cheap.

Is it normal for the debug builds to perform poorly? I get that I’m working with a low-end model, but my audio does a LOT of stuttering.

Debug builds usually perform much worse. They also use more memory, which makes GC pressure higher and in result it pauses the app more frequently - hence the audio stutters. The problem should disappear once you switch to master configuration. That shouldn’t matter too much though, as they are meant for debugging, not smooth playback :).

Not surprising. There are a couple of things going on. In debug mode it is compiled without a lot of the release optimizations you’ll get, on top of which the debugger being attached will affect performance quite significantly.

Yep - I know this, but it was bad enough that I thought I needed to check something else.

Thanks all for the feedback and help.