Monday, September 17, 2012

Developers Log. Prototype Date 14 - JigLibX and XNA 4.0

*Edit* The following left me with a few xbox 360 exclusive errors that were not apparent when I was running on windows. After jumping through a few more hoops, I was still unable to get it to run correctly on the xbox, and switched to BEPU Physics. So these steps won't actually get JigLibX running on XNA 4.0 for the xbox.

Having looked through a few of the top 3D open source XNA physics engines such as Jitter, BEPU Physics, and JigLibX I felt that JigLibX was the best fit for what we needed. I particularly liked the component style of framework, it meshes well with XNA. There are several other implementation styles and core mechanics about it that I liked, so it was selected to be the physics engine for Ninja Royale's prototype.

The major issue with JigLibX is that it hasn't had an update since XNA 4.0 came out, so the version downloaded from the website wouldn't work with the project we have. Here is how I solved this problem:

Get the latest from JigLibX's SVN. You can find the SVN here. noone88 (The original author I believe, certainly the main contributor) ported the project to XNA 4.0.

The project I downloaded still didn't work. Visual Studio was having problems with converting the project, so I had to edit the file JigLibX Xbox 360.csproj using a text editor (open with -> notepad, for example.)

The first line to look for, found near the top, is this

<XnaFrameworkVersion>v2.0</XnaFrameworkVersion>

Simply change the v2.0 to v4.0 and voila!

Okay, so not voila just yet, but almost. Just find these two lines, found close to the bottom:

<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\v2.0\
   Microsoft.Xna.GameStudio.Common.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\v2.0\
   Microsoft.Xna.GameStudio.NestedContent.targets" />

You can either remove them, or comment them out (I chose to just comment them out). I was unable to find anything similar from my XNA 4.0 install, so I commented them out and everything seems to work just fine. [*Note, to comment them out, simply surround the lines with the opening tag "<!--" and the closing tag "-->" excluding the quotes, of course]


No comments:

Post a Comment