How to setup socket.io server for FPS game

hi. i am trying to setup a multiplayer server for my shooter game. all the tutorials for this talk about other game engines or using physical bullets. i use raycasting for shooting. how would i make a server so that it will detect if a player raycast shoots another player, and will take away health from them and kill them? link to my game:(battle royale scene) https://playcanvas.com/editor/scene/1330224

Hi @quantum,

First of all have you check this getting started with multiplayer on PlayCanvas tutorial?

https://developer.playcanvas.com/en/tutorials/real-time-multiplayer/

Regarding checking raycasts on the server, there isn’t an easy way around that. You will have to code your server to execute your PlayCanvas instance in parallel with the players, or at least a part of it (e.g. colliders only, no need to render graphics).

so each time a player claims he shot another player, you can quickly execute that raycast on the server to verify that claim.

This blog contains a number of very well written articles on how to implement and most importantly how to synchronize all that:

ok how would i do that? i have the network scripts from the tutorial implemented already.

That’s a complex topic, not sure where to guide you.

I would start with experimenting in running part of a PlayCanvas scene in a node.js instance.

ok thanks