Forum Multiplayer [Contribution] 2D Physics library that totally works

Discussion and help relating to the PlayerIO Multiplayer API.

[Contribution] 2D Physics library that totally works

Postby qugengames » October 22nd, 2018, 1:49 am

TLTR: 2D Physics engine that works in both PlayerIO servers and any game engine client, pure C# code without static variables, unsafe code, or dependency on third party libraries, will post the link once GitHub works again, but I want to see who is interested in this.

Hi, my name is Oscar and I'm an indie developer, I'm the creator of Nukes of Bastion (For those interested http://www.nukes-of-bastion.com/) for Android and PC a few months back.

First of all thank you to PlayerIO for letting the world use your infrastructure and multiplayer solution free for up to 500 players, that's great for indie developers, and sure lets you grow your capabilities once you grow with your game and incomes, it was a top feature that made my mind on choosing work with you.

Over the last few months I was looking for a 2D Physics library over the web that would work with PlayerIO.
As you may already know, in order to put C# code into PlayerIO it must not use unsafe code , use static variables, or have any kind of reference to other .DLL external libraries, which many Physics libraries will heavily use.

Not only that, but the general advise from the community and PlayerIO staff is to use client side Physics, which IMHO this is a rather non-commercial advise, but I don't want this to be the main point of discussion and rather focus on the contribution background.

I couldn't follow that advise because I wanted to simulate Physics on both the client and the server, but the server being authoritative so synchronization and prediction could be used to smooth gameplay and prevent cheating at the same time, of course, such topics are another discussion, and even for that, I have created a neat library solution that lets you code in a single file for it to be used at both client and server solutions making it easier to code a multiplayer game.

After hundred of painful hours trying to adapt different open source 2D Physics engines to work with PlayerIO, the outcomes would be libraries working on PlayerIO with wrong results, or libraries simply too dependent on unsafe code or third party libraries to be feasible to use.

Then, I found Jitter Physics 2D port https://github.com/mattleibow/jitterphysics/, it didn't use unsafe code and was not dependent in third party libraries for mathematics but rather use it's own C# code for what it required,

I spent several hours removing static variables and adapting code, and finally got it working.

If you are interested on using this 2D Physics library that works at both the server and client leave your comments, once GitHub works back again I will upload the code, my goal would be to start a contribution synergy as JitterPhysics developers have stopped working on this port, there is no documentation available and it would be great for PlayerIO community interested developers to have access to this port and contribute.

EDIT: Here you can find the source and collaborate: https://github.com/OscarITMX/PlayerIO-jitterphysics

Thanks
Last edited by qugengames on November 17th, 2018, 10:36 pm, edited 1 time in total.
qugengames
 
Posts: 36
Joined: April 24th, 2018, 11:19 pm

Re: [Contribution] 2D Physics library that totally works

Postby ReSY » November 14th, 2018, 8:00 pm

Hello! It is interesting for me! Thanks for your work!
ReSY
 
Posts: 2
Joined: June 20th, 2013, 7:29 am

Re: [Contribution] 2D Physics library that totally works

Postby qugengames » November 17th, 2018, 5:19 am

ReSY wrote:Hello! It is interesting for me! Thanks for your work!


Hey there, good to see someone interested, I have made some great progress,

I'll upload the code soon
qugengames
 
Posts: 36
Joined: April 24th, 2018, 11:19 pm

Re: [Contribution] 2D Physics library that totally works

Postby qugengames » November 17th, 2018, 10:37 pm

ReSY wrote:Hello! It is interesting for me! Thanks for your work!


I just uploaded the code:
https://github.com/OscarITMX/PlayerIO-jitterphysics
qugengames
 
Posts: 36
Joined: April 24th, 2018, 11:19 pm

Re: [Contribution] 2D Physics library that totally works

Postby ReSY » November 18th, 2018, 8:20 am

qugengames wrote:
ReSY wrote:Hello! It is interesting for me! Thanks for your work!


I just uploaded the code:
https://github.com/OscarITMX/PlayerIO-jitterphysics


Nice! I'll try to help. I see documentation in progress, I think also need a basic example,how to integrate this library and detect collisions.
ReSY
 
Posts: 2
Joined: June 20th, 2013, 7:29 am

Re: [Contribution] 2D Physics library that totally works

Postby qugengames » April 10th, 2019, 6:53 pm

ReSY wrote:
qugengames wrote:
ReSY wrote:Hello! It is interesting for me! Thanks for your work!


I just uploaded the code:
https://github.com/OscarITMX/PlayerIO-jitterphysics


Nice! I'll try to help. I see documentation in progress, I think also need a basic example,how to integrate this library and detect collisions.


Hi there,
I've got a lot of progress modifying fixing and adapting the library to work with PlayerIO
Once I have a chance I will try to post the update to the GitHUB repository

Regards
qugengames
 
Posts: 36
Joined: April 24th, 2018, 11:19 pm

Re: [Contribution] 2D Physics library that totally works

Postby fmg » October 4th, 2019, 10:34 am

qugengames wrote:
Hi there,
I've got a lot of progress modifying fixing and adapting the library to work with PlayerIO
Once I have a chance I will try to post the update to the GitHUB repository

Regards


Hey, this seems like a very cool project, thanks for working on it. I'm also using Unity and would love to see any updates for this library that you might have.
fmg
 
Posts: 6
Joined: May 14th, 2013, 7:42 am

Re: [Contribution] 2D Physics library that totally works

Postby qugengames » October 10th, 2019, 8:37 pm

fmg wrote:
qugengames wrote:
Hi there,
I've got a lot of progress modifying fixing and adapting the library to work with PlayerIO
Once I have a chance I will try to post the update to the GitHUB repository

Regards


Hey, this seems like a very cool project, thanks for working on it. I'm also using Unity and would love to see any updates for this library that you might have.


Hi there

If you are serious about using the physics library, join the Discord server and I'll walk you through it:
https://discord.gg/gJ9Yq29

I was able to port Box2D to work with PlayerIO
qugengames
 
Posts: 36
Joined: April 24th, 2018, 11:19 pm

Re: [Contribution] 2D Physics library that totally works

Postby fmg » October 21st, 2019, 1:49 pm

I actually got your Jitter port/fork working without much trouble, but I was wondering if you have updates to it that haven't been pushed to github. I have it working with box colliders, but it looks like the code for polygon colliders hasn't been ported?

Have you stopped work on Jitter and switched to Box2d?
fmg
 
Posts: 6
Joined: May 14th, 2013, 7:42 am

Re: [Contribution] 2D Physics library that totally works

Postby qugengames » October 21st, 2019, 6:29 pm

fmg wrote:I actually got your Jitter port/fork working without much trouble, but I was wondering if you have updates to it that haven't been pushed to github. I have it working with box colliders, but it looks like the code for polygon colliders hasn't been ported?

Have you stopped work on Jitter and switched to Box2d?


Yes I switched to Box2D, I found some tunneling bugs with the Jitter port I couldn't fix.

Get on the Discord and we can talk
qugengames
 
Posts: 36
Joined: April 24th, 2018, 11:19 pm


Return to Multiplayer



cron