Box2D Forums

It is currently Tue May 21, 2013 1:28 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 88 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9
Author Message
 Post subject: Re: C# port of Box2D.
PostPosted: Thu Jun 25, 2009 4:27 pm 
Offline

Joined: Mon Jun 15, 2009 4:34 pm
Posts: 69
Thanks Ihar,

We are currently 90% done with the porting of Box2D revision 218 to C#. All the code is ported, but there are a few errors (pointers that have not been ported, C++ specific code and the like). We already have dinedal (a few posts up) joined the project but we would like more eyes to make it as good a port as possible.

If anyone wants to join in, feel free to contact me using private message on the boards.


Top
 Profile  
 
 Post subject: Re: C# port of Box2D.
PostPosted: Thu Jul 02, 2009 11:06 pm 
Offline

Joined: Thu Jun 04, 2009 6:21 am
Posts: 6
I just spent some time optimising Box2DX for the Xbox 360. Previously I found it almost unusable on the xbox with anything more than 25 objects. However after applying the tricks below I started to get some very good performance.

* I Removed almost all heap allocation in box2dx. This meant using memory pools, converting structs to classes, and moving array allocations out of methods (arrays are always allocated on the heap in c#). The garbage collector on the xbox sucks, and Box2dx causes huge amounts of GC latency.
* In performance critical areas such as the contact solver and the joint solvers that I am using, I replaced vector overloaded operators with Add(ref v1, ref v2, out result) style methods. This gave a pretty huge speed boost, C# overloaded operators are terrible on the xbox as they are never inlined and require tons of argument copying.
* Made the islands solve in different threads. Not sure about this one, wasn't hard to do, but only gives a performance boost under certain circumstances which I haven't really tested yet.

I had a go at using fixed point arithmetic class like the box2d DS version, but the overloaded operator overhead hugely overshadowed any performance gain. I guess if someone has more patience than me they can try using methods instead of operators for the maths.

Even if you decide that the memory and overloaded operators are to much work, I do have one request in the next version of box2dx:

Please do not delete the memory de-allocations, instead just comment them out, this makes it much easier when adding memory pools to work out when an object is ready to be destroyed.


Top
 Profile  
 
 Post subject: Re: C# port of Box2D.
PostPosted: Sun Nov 01, 2009 9:33 am 
Offline

Joined: Mon Jun 15, 2009 4:34 pm
Posts: 69
@Convolous: Your additions sounds great and I would be more than happy to include them in Farseer Physics Engine. Box2DX should stay as close to Box2D as possible in my opinion, but the call is really up to Ihar3d.

@All: I need some help with the port at the moment. Box2D is about to be released and it would be great if we could have a C# port out soon after. The status of the port right now is that it works like a charm, but it have a few bugs. The bugs are port related and should be easy to fix.

The guys on the team currently working on Box2DX have been non-responsive for a period of time because of other stuff. That is the life of an open-source project, so I'm looking for someone to work with me to get the port up and running. If you are interested, I would be more than happy to hear from you.


Top
 Profile  
 
 Post subject: Re: C# port of Box2D.
PostPosted: Thu Nov 05, 2009 11:14 am 
Offline

Joined: Thu Feb 28, 2008 5:20 am
Posts: 24
Quote:
The guys on the team currently working on Box2DX have been non-responsive for a period of time because of other stuff. That is the life of an open-source project, so I'm looking for someone to work with me to get the port up and running. If you are interested, I would be more than happy to hear from you.


Don't be so pessimistic please :) I have some time now. Let's contact via skype.


Top
 Profile  
 
 Post subject: Re: C# port of Box2D.
PostPosted: Thu Nov 05, 2009 11:23 am 
Offline

Joined: Thu Feb 28, 2008 5:20 am
Posts: 24
2 Convolous. This is very interesting, should be nice work here. Please contact me on ihar3d@gmail.com if you wish to be participated in Box2DX project.


Top
 Profile  
 
 Post subject: Re: C# port of Box2D.
PostPosted: Fri Feb 19, 2010 6:03 am 
Offline

Joined: Thu Feb 28, 2008 5:20 am
Posts: 24
Hello All!

As you can see Box2DX was not updated long time, this took place by different reasons. Now I found developer who wish to help reanimate Box2DX.

There are Box2D.XNA and Farseer, based on Box2D. They both are pretty good, in actual state and working fine :)

Reason to start Box2DX project was to create C# port which will be maximum closest to original Box2D, and without using XNA.

So I just want to investigate is there necessity in this port, to decide to continue developing or not.

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: C# port of Box2D.
PostPosted: Fri Jun 25, 2010 5:59 am 
Offline

Joined: Fri Jun 25, 2010 5:49 am
Posts: 1
At this point it would be easiest to take Box2D.XNA and replace XNA's math types. You could resurect Box2DX in an afternoon.


Top
 Profile  
 
 Post subject: Re: C# port of Box2D.
PostPosted: Sun Jan 29, 2012 10:03 pm 
Offline

Joined: Thu Aug 13, 2009 9:46 am
Posts: 3
It doesn't matter if it will be usefull for somebody or if there are some better ports of it or some more efficient solution etc., but I am porting JBox2D to C# here:
https://github.com/gerich-home/box2dnet
There is no XNA or no native invokes, it's just a pure port of JBox2D.
It's my old dream to port smth to C#, so I am doing it.
Feel free to join me if you want to participate in it)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 88 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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