@Fox9 well , i didn’t know anything about DebugView but it looks like it is a seperate Project.
I found the project now. And trying to make it work on WP8. I will post it here as soon as i got it work. ( Doesn’t look like hard, just like orj monogame -> wp8 process. )
I added a reference to your .dll but I get an error message in this line:
DebugViewXNA physicsDebug;
The type ‘FarseerPhysics.DebugViewBase’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘FarseerWindowsPhoneMono, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’.
It’s not working. I get an error message in the line base.Initialize().
protected override void Initialize()
{
base.Initialize();
}
An exception of type ‘System.IO.FileNotFoundException’ occurred in MonoGame.Framework.DLL but was not handled in user code
Additional information: Could not load file or assembly ‘WindowsPhoneFarseerDebug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.
Your project works for me if I debug on a device, but it’s not working if I debug on an emulator. If I choose an emulator, then I get many error messages.
How can I build the Farseer DebugView .dll myself?
It worked, but I have some additional questions.
I build the Farseer DebugView .dll like this:
I selected “Release” from top and build the WPCL DebugView project.
But I build the other Farseer .dll like this:
I selected “Debug” from top and build the WPCL project.
Are my build settings correct like this? Should I build both .dlls with “Release” selected?
In addition, what can I do so that the .dlls work with Windows Phone Emulators and Devices? Should I build two more dlls with other build settings? For the moment, my own dlls just work with Emulators but not with a device. If I debug on a device, I get this error message:
There was a mismatch between the processor architecture of the project being built “ARM” and the processor architecture, “x86”, of the implementation file “C:.…\Desktop\WinPhone8Farseer\Farseer Physics Engine 3.5\FarseerForWindowsPhone\Bin\x86\Debug\SharpDX.WP8.dll” for “C:.…\Desktop\WinPhone8Farseer\Farseer Physics Engine 3.5\FarseerForWindowsPhone\Bin\x86\Debug\SharpDX.WP8.winmd”. This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and implementation file, or choose a winmd file with an implementation file that has a processor architecture which matches the targeted processor architecture of your project.
**Did you referance .dll’s other than WindowsPhoneFarseer and WindowsPhoneFarseerDebug ? You don’t need the referance other files built in folders. If you did, remove them and try like that. **
If it doesn’t work, then you continue to read this post.
It looks like , when you try to build .dll’s for Windows Phone, it builds for ARM architecture. But when you try to build it for emulator, it builds for x86 architecture. So the old dll’s that you build for x86 or ARM is not working.
You can this this methods
Right click the Solution of your Windows Phone game Solution on Visual Studio ( Not Project, The Solution ) and Click properties.
Click, “Configuration Propertied” from the left panel.
You will see your projects name on the right panel. Click the platform tab of your Project and change platform to x86 for Emulator. Click “Apply” after. ( optional : change Configuration to Release )
If you want to target your build, change back to that to “ARM”.
If this isn’t work for you. Try this steps.
Build WindowsPhoneFarseer for both ARM and x86. You can name that ARM one WindowsPhoneFarseerARM and visa versa.
Build WindowsPhoneFarseerDebug for ARM and x86, using the dll’s you build for ARM and x86, you can name them like WindowsPhoneFarseerDebugARM and x86. it’s your choise.
Use ARM ones for building for device and x86 ones for building for Emulator.
Hope that’s Works for you. But same dll’s Works for me.
@craftworkgames do you have your updated source on GitHub or Codeplex somewhere.
Should have a little time to play with it this week, might even create a little NuGet as well
It’s not working. I build WindowsPhoneFarseer and WindowsPhoneFarseerDebug for ARM and referenced both .dlls to my MonoGame Windows Phone 8 project. In addition, I went to “Configuration Properties” and clicked on the platform tab of my project and changed the platform to ARM.
But I always get these error messages if I want to run the project on my device.
public GamePage()
{
InitializeComponent();
_game = XamlGame.Create(“”, this);
// Sample code to localize the ApplicationBar
//BuildLocalizedApplicationBar();
}
The best overloaded method match for ‘MonoGame.Framework.WindowsPhone.XamlGame<GameName1.Game1>.Create(string, System.Windows.Controls.DrawingSurfaceBackgroundGrid)’ has some invalid arguments
Argument 2: cannot convert from ‘GameName1.GamePage’ to ‘System.Windows.Controls.DrawingSurfaceBackgroundGrid’
I haven’t really created a NuGet package before, but it’s something I’m interested in so once you’ve made the changes create a pull request so I can take a look. Thanks
I have some difficulties with Farseer if I want to support different screen resolutions. If the resolution of the device is less than 720p, then the sprites and their corresponding Farseer bodies need to be scaled down. If I run my project with the 720p emulator, then everything looks fine. But if I choose an emulator with a lower resolution(for example WVGA emulator), then everything looks weird.
In this picture, I use the 720p emulator: http://s1.directupload.net/images/140520/gnpwvjsw.jpg
In this picture, I use the WVGA emulator: http://s14.directupload.net/images/140520/hxhicnph.jpg
If I use the WVGA emulator, then the Farseer collision shapes are drawn on another position than their corresponding sprites. I’m not sure why this happens. Does somebody know why Farseer isn’t working with different screen resolutions?
My uploaded my project here: http://www.file-upload.net/download-8938491/farseerinmonogame.rar.html
I don’t know exactly what is wrong but my guess is that the transformation matrix returned from camera.GetMatrix() and Matrix.CreateOrthographicOffCenter need to be in sync somehow.
I’ve published a NuGet package for my FarseerPhysics.Portable library. If you already use NuGet it should be relatively painless to get Farseer working in any MonoGame project.
The DebugView is only two files (DebugViewXNA.cs and PrimitiveBatch.cs). You can simply add them to your project directly. You can find them in the Farseer source code on code project here: https://farseerphysics.codeplex.com/SourceControl/latest#DebugViews/DebugView XNA/DebugViewXNA.cs
(note: there is a space in the above URL that breaks the link, not sure how to prevent that).
The reason I didn’t add them to the PCL is because they use code that can’t go in a PCL. Although it’s technically possible to use the “bait and switch” method there’s really not a lot of benefit, because then we would still have to maintain a version for each platform.