Does it work with XNA 4.0 for Windows Phone 7?

Sep 8, 2010 at 2:42 AM

Has anyone tried this on the Windows Phone 7 emulator?  Does it have any 'unsafe' code in it that would prevent it from running on the phone like JigLibX does?

Thanks,

Tim

Coordinator
Oct 2, 2010 at 7:27 PM

The good news is that there's no unsafe code, so it should theoretically work. The bad news is that I haven't ported anything to XNA 4 yet, so I haven't tried this in practice. I think the biggest pain point in porting the thing forward will be the pipeline, as it seems they made some changes to the way models/meshes are handled. At least, that's what I recall from my first attempt to port during the beta.

Oct 3, 2010 at 3:03 AM
Edited Oct 3, 2010 at 3:04 AM

Glad to hear no unsafe code.  I'll be interested in how it does on a Windows Phone 7.  I'm porting over my flight sim, RC-AirSim, which used JigLibX on the Xbox for a break-apart crash effect.   Right now I don't have a crash physics solution for the phone.

Oct 18, 2010 at 8:52 AM

It does work on the Windows Phone Emulator. If the FPS shown in the emulator are anywhere near the real thing the performance is quite good!

I had to do some changes (some of them very hacky) for the sake of testing it out: 

- The most important changes are indeed in the Pipeline Class Library (but nothing extensive).

- The other changes consist in changing the way the the Rendering and Effects are now handled in XNA4.0 (changes only inside the "Holodeck" project) (these are also small changes).

- For XBOX and WP7, the TaskManager and threading management: it has some missing methods and classes. This was the real pain. My knowledge in this area is next to none so I didn't find a proper fix. I had to do some awful hacks, like always returning threadIndex = 0;

   * There doesn't seems to be LocalDataStoreSlot.

   * Other Threads methods are missing like Thread.SetData and .GetData.

   * Collection.RemoveAll(Func<>) is also missing (easily replaceable).

For the missing Methods and Classes (whatever they may be) I just wrapped around them #if/#elif/etc preprocessor directives.

I do not know if any problems/side effects may appear down the road ...

If you haven't sorted it out yet, I would be more than glad to help port it (well, not the task manager :p). The changes are not that big (at least the hacky way) and this seems to be quite a good library that would benefit a LOT of people. 

 

 

Coordinator
Oct 21, 2010 at 7:11 PM

That's great info, thanks. I'll probably do one more release under 3.1 after fixing a few problems and then move over to 4.0. Sounds like the only big thing that's missing on windows phone is the multi-threading capability, but I imagine threading wouldn't really help on that platform anyway. So your suggestion of using preprocessor directives to remove the threading stuff is probably the way to go.

Nov 19, 2010 at 4:14 AM
nedry wrote:

That's great info, thanks. I'll probably do one more release under 3.1 after fixing a few problems and then move over to 4.0. Sounds like the only big thing that's missing on windows phone is the multi-threading capability, but I imagine threading wouldn't really help on that platform anyway. So your suggestion of using preprocessor directives to remove the threading stuff is probably the way to go.

Any updates on the XNA 4.0 and Windows Phone 7 front?

Coordinator
Nov 22, 2010 at 10:07 AM
Edited Nov 22, 2010 at 10:25 AM

I've got everything ported to XNA4 and I think I've got all the issues worked out for Windows. But I'm having a hell of a time with the windows phone tools. When launching in the emulator, the sample application closes immediately with no error message. In an attempt to discover the underlying cause, I tried launching in debug mode, only to get the following:

"Unable to start debugging. An error occurred that usually indicates a corrupt installation (code 0x80040154). If the problem persists, repair your Visual Studio installation via 'Add or Remove Programs' in Control Panel."

Trying to repair the hundreds (thousands! millions!) of various components that are installed with Visual Studio Express+XNA+Phone+Silverlight+etc yields no change, and google hasn't been very fruitful. Error code 0x80040154 indicates an unregistered COM component, but no clue is given as to which COM component is causing the problem.

Not sure what to try next... I'll play with it some more tomorrow.

Coordinator
Nov 22, 2010 at 9:59 PM
Edited Nov 22, 2010 at 10:03 PM

Hmm. Double checked that my CPU meets the virtualization requirements using their tool. GPU checks out too with DX10 support. Not really willing to reinstall all of my dev stuff; it takes far too long (that's not a solution in my opinion anyway).

Gotta say, not too impressed with the windows phone development experience so far.

Time for some good old-fashioned printf-style debugging!

Nov 22, 2010 at 10:54 PM

Not a single application/sample runs in your PC? A default blank new Windows Phone Game project?

If thats the case what an annoyance. And indeed might be some incompatibility with your hardware perhaps?

Coordinator
Nov 22, 2010 at 11:42 PM

The templates for new windows phone projects don't seem to be registered properly (I just cloned my existing sample). So I'll try completely uninstalling and reinstalling everything related to development...Sigh.

The icing on the cake was the "Unknown Error" when attempting to uninstall the Phone SDK.

Coordinator
Nov 23, 2010 at 1:43 AM

After reinstalling everything, debugging seems to work now.

Now just gotta figure out why nothing renders. At least this one is probably my fault.

Coordinator
Nov 23, 2010 at 3:32 AM

Good news! Everything seems to be working on windows phone now. It's slooooow, but that could just be the emulator. I'm not sure how it will compare to a real device.

I still need to test this latest version on the 360. Soon as I find an ethernet cable long enough...

I'll try to put out the new bits before Thanksgiving.

Nov 23, 2010 at 4:11 AM
nedry wrote:

Good news! Everything seems to be working on windows phone now. It's slooooow, but that could just be the emulator. I'm not sure how it will compare to a real device.

I still need to test this latest version on the 360. Soon as I find an ethernet cable long enough...

I'll try to put out the new bits before Thanksgiving.

Great!  Looking forward to checking it out on my Samsung Focus!

Coordinator
Nov 23, 2010 at 8:48 PM

New release for 4.0 is out.

Nov 24, 2010 at 3:36 AM
nedry wrote:

New release for 4.0 is out.

I tried it on the emulator and my device.  Couldn't interact with the scene because swiping a finger just rotated the camera.  Doesn't look like there is touch input for selecting objects or creating new ones yet? Maybe I'm missing something?

Here's some perf findings:

Scene 3 runs at about 7-9 fps on the emulator.  On my Samsung Focus scene 3 runs at about the same 9 fps.

Scene 2 runs at about 8 fps on emulator and device. 

Coordinator
Nov 24, 2010 at 8:34 PM

The controls are pretty limited on windows phone, it's sort of a hybrid between the xbox and PC controls. Finger swipe to change look direction, WASD to move the camera, space to shoot a block, and of course numbers to change scenes. Since it's just a sample I didn't get too fancy with pinch support or whatever; I figure people can set up their test scenarios in code.

I'm not too surprised at the performance. With most of the scenes, I'd expect the perf to be terrible. I'm surprised scene 3 even runs at above 2fps, to be honest.

It's likely that mobile platforms are just going to be limited to a much smaller set of objects. It also might help to reduce the number of solver iterations (at the expense of accuracy).

I'm thinking about taking a stab at GJK collision detection, which could improve performance by allowing more caching for narrow phase tests. Can't really say if this will have much of an impact, though.