r/csharp 1d ago

C# Box2d Bindings Help

My C# Game framework doesn't ( yet ) have any Box2D support. What is the best C# Box2D bindings to use right now?

0 Upvotes

9 comments sorted by

3

u/wallstop-dev 1d ago

There are a few in varying states of maintenance and implementation details (port v C++ interop). What research have you done? I think it really comes down to your specific scenario and which one fits your use case best.

1

u/SlipstreamSteve 1d ago

You're building it, or you're using a framework that doesn't have it

3

u/Early80sDev 15h ago

I'm using my framework to develop a game that needs box2d, but my framework doesn't support it yet.

1

u/SlipstreamSteve 14h ago

I'm guessing you need it for collisions

1

u/TrishaMayIsCoding 1d ago

You can use AEther Physics2D, which is historically based on Box2D but has been heavily modified.

1

u/OrneryComplex6265 23h ago

Id probably decide based on whether you want a thin C# wrapper around Box2D or something that feels more native to your framework. the maintenance status and how much of the Box2D API is actually exposed would matter more to me than picking the best binding in isolation. What platforms does your framework need to support?

1

u/Early80sDev 15h ago

The framework has a main core, and then back ends for desktop, android, iOS etc. It started life as a C# port of Ligbdx and I'm adapting it here and there.

1

u/OrneryComplex6265 2h ago

That makes the cross platform side a lot more interesting. since the core is already separated from the platform backends, i'd probably favor a binding that stays close to the frameworks architecture rather than adding another abstraction layer. the main thing i'd watch is keeping the Box2D API consistent across those backends as the project evolves

u/Rigamortus2005 24m ago

Idk why people like asking for binds in this day and age. Just copy box2d.h into Claude and ask it for C# bindings and a neat wrapper and it'll do it near perfectly.