Oh yeah @Givo that’s just what I was thinking for like a lobby. The only drawback is clients all running logic (the strongest or eldest client could weight its opinion more heavily though)
Its hackable i guess without a master server maybe, the seed which is strong though… I digress
Most clients should be strong enough to run the simulation i think edit: I take that back simulation is hard fought
If you guys are into web IDE’s checkout codesandbox.io, it does frontend stuff entirely in you browser (npm, webpack - all the fun running client side). Also has good github integration IIRC.
You can also search for projects with BJS as dependency: CodeSandbox
I’ve used codesandbox.io when I was making a 2d game with phaser.js.
The only drawback is that you can only sign in with github, and as it turns out, my school blocked github because kids were iframing games that they were playing, like shell shockers.
Givo isn’t my real name. It took me ~3 years to come up with it, through name shortenings and pronunciations. My real name is in my profile; Will.
You meant 411 as in 411.com, right? ![]()
I have built a couple of multiplayer games on babylonjs and nodejs. I could provide you guys with information if needed. I have used socket.io though so it’s not UDP. Hit me up if you need any information 
I have ran some multiplayer games earlier - in PIXI js, but that doesnt matter. Network layer doesnt care about what is on client layer.
I used plain websockets and never encountered any problem or serious issue. I have implemented motion prediction myself (to compensate for latency somehow) on my client and it worked well (I mean well for my specific game purposes).
I dont like “overusage” of third party libraries for problems that I can solve with my code easily and completely under my controll (but I am just that kind of a person, someone might see it otherwise).
I have implemented prediction, reconciliation, compensation and inter/extrapolation many times as well. But for my current project, I’m using NengiJS, and so far really liking it.
There are templates, videos, the manual and a discord providing help. So if anyone is looking to make a multiplayer game, I’ll strongly suggest taking a look at that.
Yes! @timetocodevupdated his site! I’ve been working with colyseus until nengi came out (with like a demo kind of thing)
I modified the colyseus boilerplate to makevan fps style freecam demo and it works ok but nengi is the thing I’ve been waiting for. 
What’s the performance? I see in their github that they claim they can handle 100+ users, is that for node instance? How much do we gain in terms of performance if we code the whole networking ourselves? I think these are important questions to answer before choosing NengiJS or any other networking framework, at least if it is intended to be developed professionally.
Hiya, I make nengi.js. The performance depends on a bajillion factors but for a reference point a lot of us have made our first multiplayer prototypes by sending json over a websocket connection as entities change…and nengi is orders of mangitude faster than that (10-1000x, varies). Is someone likely to make something faster on their own? It is certainly possible.
If willing to go the route of making everything binary, using delta compression, and culling network data then yeah I would say someone could make a game-specific networking layer that would out-perform nengi. Those are the big tricks, tho there is a lot of minituae like determinism and time dilation between server and client and all sorts of fun stuff. Also there’s no secret sauce to the speed, I’ve disclosed what the perf tricks all are.
The hard stuff that people seem to want in 3D games imo is clientside prediction, and all of the related side effects that crop up. There is a nengi api for it, but as I’m learning as I interact with more people… the challenges aren’t really related to the api. There’s a big conceptual gap that needs crossed (CSP is very unlike our physical world), and then after that getting other physics/collision libs to play along is difficult or potentially impossible if they’re not deterministic.
Can someone hit 100 ccu on a single nengi game instance running as a node process? Depends on the game and hardware. 3D first person shooters probably sit in a range of more like 10-50 players (and due to the game design and the rendering constraints of io games, one would prolly aim to have that closer to 10 than 50). An MMORPG might do 100-400.
We use web sockets that interact with a central server for our multiplayer action RPG (using JSON but easily swappable for BSON should the need arise, and delta compression). The overhead for the server is not that bad. We currently use a container-based, small-ish VPS for testing and we need 100 concurrent users to max it out currently (on multiple game instances). This number could be even higher if our server-side collision detection were optimized yet (this part needs 10 times more CPU than anything else).
Collision detection is something you need to have the server do anyway in order to be protected against cheaters. Using predictive algorithms on the client is possible and in many cases desirable especially if the geometry and interactions are simple. Prediction can and will lead to desyncs sometimes, which can be extremely annoying for the player, and more so than a slight latency.
In our case we do no collision checking on the client because our terrain is a complex mesh and not just a heightmap, meaning that you need AABB or OBB broadphase testing to have any efficiency, so we decided to just keep it on the server, which means more latency but also more freedom to do stuff like recoil when a fighter blocks with a shield etc, which is hard to get right with a predictive model. This also allows us to have a “thin” client that only sends the keyboard state and mouse movements to the server. The client never sends any coordinates, which makes it impossible to do speedhacks, wallhacks etc.
All of those design choices apply to our project only, an RPG with a maximum of 10 concurrent players per game instance. For MMOs or FPSs, you need prediction capabilities and you can’t go with an arbitrary world mesh or anything like that. nengi.js seems ideal for those applications.
I agree that server prediction is ideal, and if a user inputs, well, an input and moves to a position the server can compare it to it’s position and call it clean or not within .5 units. Most cheaters use an extension like tampermonkey for chrome or greasemonkey for firefox to run scripts that help them cheat. checking for those extensions would be an easy way to detect cheaters.
Pinging the creators @PolygonalSun @bghgary @PatrickRyan @syntheticmagus @Drigax
You can find the full source here:
Thanks! I made a fork. I will try to add a client prediction and I want to see how to make a not small game project with multiplayer.
There is fun project by MrDoob which allows to doodle together : https://multiuser-sketchpad.glitch.me/
This is the Server Side source code Glitch :・゚✧
Back end is express js is WebSocket Sessions
Front end you can se from HTML
Hope it give you some ideas
