Multiplayer Third-Person Shooter [WIP]

Progress Video

Firstly, thank you so much to the Babylon Team for providing the Babylon.js engine, which has made development so intuitive and has allowed me to focus mostly on the game logic. For anyone looking to dive into creating 3D experiences on the web and choosing among engines, Babylon.js is the clear winner.

Also, thank you so much to the Babylon community for answering questions and providing examples, which made this progress possible.

Disclaimer: None of the 3D models are my work. The character model is from Mixamo and the weapon models are from Krunker.io.

About the progress video:
Custom netcode with

  • Client-side prediction (allows responsive gameplay on the client side)
  • Entity interpolation (allows smooth movement of other players on the client side)
  • Lag compensation (allows the server to rewind the game state to what each client sees, allowing players to shoot directly at each other and deal damage despite lag)

made possible thanks to these awesome references:
Gabriel Gambetta’s netcode tutorials
Valve netcode tutorial
nengi documentation by @timetocode

7 Likes

Lovely!!

1 Like

@gbz hey! Nice project :smiley: are you experiencing prediction errors? The movement looks pretty rubberband-ish (I started an rpg with nengi, however could not overcome the prediction) - if you find a way around this do please share the information. :smiley:

1 Like

Hey @Ateria! The rubberband-ish movement in the video is probably due to frame-rate drops due to my recording software (OBS Studio) eating a lot of frame-rate. Without OBS Studio running, the game seems to run smooth. There are occasional prediction errors in position/rotation, especially with time and lag spikes. Usually, the position/rotation error is under 1e-6 Babylon units.

I haven’t developed with nengi before, though I’ve played zombieswithguns.io made with nengi, and the gameplay is really smooth.

If you posted a question about your experience with prediction errors, we could help out!