Box2D Forums

It is currently Tue May 21, 2013 1:44 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Nov 13, 2009 6:33 pm 
Offline

Joined: Thu Jul 24, 2008 8:43 am
Posts: 15
I would like to announce the completion of a new Box2D port to C# called "Box2D.XNA".

The port is synced with revision r228 against the 'new/active' core engine (branches/refactor_2.0.2/Box2D/Box2D).

Reasons for doing a fresh port:
1) most C# games are for XNA Game Studio so we wanted to use the native XNA math where possible (mostly Vector2/Color).
2) performance of the other ports was frankly unusable on the XBox360. Box2D.XNA is specifically designed for the xbox 360. We've minimized allocations, inlined hot paths, etc. It's much faster than a naive line-for-line port already, but we're still looking at some improvements (like multicore support).
3) Complete test framework. We have all the core tests running/passing on both windows & xbox360. They run against XNA GS, so you dont need other dependencies like OpenGL & they work without modification on the xbox360.
4) Timely porting of revisions. We plan to keep this port in sync with the latest revision (goal is < 1 week turn around).
5) We want to make this port more "C#ish". Right now it's very close to the C++ version. In stucture this will continue, but we plan on using .NET naming conventions & Properties instead of Get*() methods, for example.

We would like to work with erincatto and/or whoever else maintains Box2D to get Box2D.XNA inside the Box2D SourceForge Repository. If we can't make this happen shortly I'll come back and post a link to a Zip for those that want an early look.

-Brandon Furtwangler & Nathan Furtwangler


Top
 Profile  
 
PostPosted: Sat Nov 14, 2009 3:24 am 
Offline

Joined: Mon Jan 07, 2008 10:51 am
Posts: 1911
Box2D is now on Google, not Source Forge. You will find the latest version there.

I don't see why you want the port in the same repository either. Shouldn't you start your own project for it, seeing as it will have different devs, different bugs?

And none of the reasons given are reasons to do a "fresh" port. Why not start from a working port, and change it to what you want.

Other than that, i applaud this. I'm slowly doing the same for the AS3 port - a line for line port just isn't worth it.


Top
 Profile  
 
PostPosted: Sat Nov 14, 2009 10:17 am 
Offline

Joined: Thu Jul 24, 2008 8:43 am
Posts: 15
I've been in contact with Erin & he will be adding Box2D.XNA to the Google repository shortly. I didn't realize it had been moved, so we'll have to update to the most recent changes. I want it in the same repository because I hate it when ports are scattered everywhere. I would rather our users come to these forums & get the code from the same spot.

The reason we did a 'fresh' port rather than modifying an existing port was because it was easier. In the past we used Box2DX and spent a lot of time making it run fast (for the record, we sent ihar3d a patch...), but it wasn't kept up to date with the latest changes and it was just easier to start fresh than try to figure out how to bring it up to the latest rev.

Once you get over a year behind, you would basically have to go line by line to update it, so starting fresh makes sense. It only took a few days to do (although tedious), so I think it worked out the way we planned. I'm also much more familar with the code now :)

-Brandon


Top
 Profile  
 
PostPosted: Sat Nov 14, 2009 10:28 am 
Offline

Joined: Thu Jul 24, 2008 8:43 am
Posts: 15
It looks like Erin already checked it in!

You can find Box2D.XNA here:
http://code.google.com/p/box2d/source/b ... 2D.XNA.zip

In the future we'll put the revision that its in sync with in the name of the zip.

BorisTheBrave has a good point about tracking bugs, and it doesn't sound like Erin is granting SVN access to the google repository, so we are now considering putting it in its own SVN project. We would still like to keep it in the box2d repository, but it will likely be 'source drops' like the one above (ie zip form).


Top
 Profile  
 
PostPosted: Sat Nov 14, 2009 11:49 am 
Offline

Joined: Mon Jan 07, 2008 10:51 am
Posts: 1911
Still not seeing the point in those zipped releases. For official "blessing", it's be more worthwhile to ask to a link from the C++ project page or web page to your own one - it's most likely users searching for your port come that way.


Top
 Profile  
 
PostPosted: Sun Nov 15, 2009 4:01 pm 
Offline

Joined: Mon Sep 17, 2007 4:30 am
Posts: 40
Location: appleton, wi
Can you explain more specifically what is tied to XNA? Is it just the math objects? Vectors and color? I'm wondering how difficult it'd be to duplicate to just duplicate the XNA classes for another platform, say Silverlight. That's how the Farseer Physics engine was ported from XNA to Silverlight?

Not requesting you do this, just want an idea how tied your are to XNA.

-Jeff Weber


Top
 Profile  
 
PostPosted: Sun Nov 15, 2009 10:20 pm 
Offline

Joined: Thu Jul 24, 2008 8:43 am
Posts: 15
Jeff, it would be very easy to port the physics engine itself. Only the simple Vector & Color opertations would need to be replaced.

To port the TestBed, it would be a bit more work, but not too hard. Render.cs and Game.cs would need to be re-written with silverlight constructs.

If you're pretty familar with both silverlight & xna, then I would say the whole thing could be done in a day.

-Brandon


Top
 Profile  
 
PostPosted: Sat Dec 12, 2009 4:24 pm 
Offline

Joined: Tue Jun 09, 2009 7:22 pm
Posts: 11
Brandon - There is some kind of problem with the Xbox version of your port. No matter what I do the Debug class is giving me crazy errors about not being implemented. Please take a look and let me know whats up.


Top
 Profile  
 
PostPosted: Sun Dec 13, 2009 7:18 am 
Offline

Joined: Mon Jun 15, 2009 4:34 pm
Posts: 69
@BrandonFurtwangler:

First off, great work on porting over the code to C#. I'm very interested in what you guys have done, especially the changes to make it perform better.

Jeff, Matt (both replied in this thread) and me are all related to the Farseer Physics Engine project. Matt and me together with some other guys, have been working on getting Box2DX to the latest release of Box2D in C# and then change the code to work with C# architecture better. The latest release of the Box2DX project is actually inside the Farseer Physics source control. That is also why you see an ond release in the Box2DX source control.

Maintaining a physics engine (especially a close port) is hard work and I think we can help each out out on that point. I guess you are as interested in a high quality, flexible and high performance physics engine as we are, so I think we should talk about how to approach those goals with a combined work effort. I'm sending you a PM in just a few minutes with contact details.


Top
 Profile  
 
PostPosted: Sun Dec 13, 2009 1:14 pm 
Offline

Joined: Thu Jul 24, 2008 8:43 am
Posts: 15
Matt, I'm not sure what issue you're seeing, but I'll post a new version (synced with r31) very soon (my svn server down atm). I've been running this on the xbox as my primary platform, so it should run fine. I may have messed something up when making the previous zip.

genbox, I'm glad to hear that you guys are actively maintaining box2dx. I was beginning to think that project had died. We should sync up on skype and work out how we can collaborate.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group