Sign in to follow this  
Buizerd

[WIP] Ninja.io - multiplayer shooter - Box2D

Recommended Posts

Ninja.io is a fast paced, 2D multiplayer shooter inspired by games like Soldat, Unreal Tournament and N-game. Currently implemented game modes include Capture the Flag and Deathmatch.
It uses the Box2D physics engine to enable convincing rigid body simulation.
 
Players can make various moves including backflips, rolls, proning, running, flying and crouching.
 
The game is still under active development and I'm willing to devote a great deal of time to finishing this project.
I've made a test server available and you can join it by following these steps:
 - Go to ninja.io
 - Play as Guest
 - Enter any username and make sure it ends with _dev
 - Join CTF or Deathmatch.
 - Select primary and/or secondary weapon
 
Press H to display table of controls.
 
Decrease the size of the browser window in case it runs slow. I've noticed that some laptops and older systems have trouble maintaining adequate fps.
 
It is currently not possible to register a username, but I've been making progress on an account and highscore system.
 
The game server is currently located in Europe. I plan on running additional servers on other continents and for the site to serve as a gateway to the nearest game server when players join in order to minimize latency.
 
Any thoughts, feedback or suggestions would be much appreciated!
 
Thanks.
 

splash.jpg

splash2.jpg

splash3.jpg

splash4.jpg

splash5.jpg

splash6.jpg

Share this post


Link to post
Share on other sites

Physic simulation is calculated only by host or by all clients as well?

If by all clients/players, then how you deal with non-deterministic math between different browsers (firefox and chrome still can produce different results using Math.cos/sin etc. and box2d using it as well)

Share this post


Link to post
Share on other sites
On 2-10-2017 at 8:11 PM, totor said:

please add zqsd / updownrightleft or better : personal key settings, for non qwerty-er

I'm planning to add configurable controls and various keyboard presets.

 

On 3-10-2017 at 3:05 PM, hashi said:

Physic simulation is calculated only by host or by all clients as well?

If by all clients/players, then how you deal with non-deterministic math between different browsers (firefox and chrome still can produce different results using Math.cos/sin etc. and box2d using it as well)

Physics are updated by both server and client at 60 hz. Positions, rotations and forces calculated by the server are leading and they are synced with client at 30hz.
Yes, the math is non-deterministic. I also reduce floating point precision to 3 bytes before sending across the network to save bandwidth. This will inevitably desync the client and server a little, but since they are synced at 30hz this is generally barely noticeable.

One remaining problem is the case where a client player will stop running a fraction short of a steep cliff/edge, while the server considers the player to be past the tipping point, so on the server he falls off, while on the client he remains standing. During the following server updates, the player will then feel like he's being 'pulled' off the cliff, since the server is still leading. This can lead to some rubberbanding and jittery movement in some cases. Another situation where minor glitches might occur is when very fast moving objects like bullets strike a small object like a hand grenade. So the client might consider it a hit, causing a ricochet off the grenade, while the server considers it a miss. The nade will then briefly appear to tumble before being corrected by the server updates. Bullets might occasionally end up being 'eaten' by the target without doing damage, even though the client might register a hit.

To say that I greatly underestimated the difficulty of synchronizing a multiplayer physics game like this would be an understatement :lol:
Needless to say there's still plenty of room for improvement here.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.