Questions tagged [websocket]

A bi-directional WebSocket protocol makes possible more interaction between a browser and a web site, facilitating creation of real-time games.

Filter by
Sorted by
Tagged with
30 votes
10 answers
16k views

Browser-based MMOs (WebGL, WebSocket) [closed]

Do you think it is technically possible to write a fully-fledged 3D MMO client with Browser JavaScript - WebGL for graphics, and WebSocket for Networking? Do you think future MMOs (and games ...
Alon Gubkin's user avatar
13 votes
1 answer
15k views

Multiplayer HTML5, Node.js, Socket.IO [closed]

I trying create simple Multi-player with HTML5 Canvas, JavaScript(too using John Resig simple Inheritance library) and Node.js with Socket.IO. My client code: var canvas = document.getElementById('...
rhavd's user avatar
  • 131
12 votes
3 answers
4k views

How often to update a Game Client about the World?

Using socket.io, I have a communication similar to that of other MMORPGs, a steady connection with messages. In my design so far, the client sends the player's position and animation frame with every ...
Lanbo's user avatar
  • 1,007
10 votes
2 answers
7k views

Online multiplayer game basics [closed]

I'm currently working on a c# online multiplayer game in real-time. The aim is to have client/server based connection using the UDP protocol. So far I've used UDP for players' movements and TCP for ...
Lowip's user avatar
  • 211
8 votes
2 answers
3k views

Should I use secure WebSockets for a game?

Is SSL necessary for a web game? I'm using Node.js with socket.io. Without it, when using unsecured networks someone on the LAN could change commands being sent to the server and "take over" a player....
Ronen Ness's user avatar
6 votes
2 answers
4k views

In Socket.IO, should I use JSON for communication between server and client?

I'm building an MMO with Socket.IO and Node.js. It works quite fast (though I don't have 1000 players yet) but my feeling is that it's not very optimized. JSON is super cool and easy to use within ...
Nick's user avatar
  • 1,605
5 votes
5 answers
2k views

How to keep track of players nearby other players in an MMO

I'm confused how to handle the players in my MMO server (using Socket.IO but I think this should apply to any MMO). Suppose there are 2 players in my server that are far away from eachother. I will ...
Nick's user avatar
  • 1,605
5 votes
1 answer
10k views

How can I use websockets in a Unity WebGL project?

There are plenty of good Websocket APIs for C#, but I run into trouble when targeting Unity WebGL due to this restriction described in the Unity documentation: No direct socket access Due to ...
Jonas Re's user avatar
5 votes
3 answers
443 views

Calculate resources real-time. Sockets or not?

I'm currenly developing a game in Javascript. It's a Single Page Application so every change should be pulled from the server without page refresh. I'm currently wondering how I should handle the '...
Jordy's user avatar
  • 161
5 votes
1 answer
1k views

How to do monster AI movement and attacks server side?

I have my web based rpg game already created. Inventory management, equipment system, character stats, skill tree, and etc. It's almost complete. For the game world, I am creating a top-down rpg ...
Nick Newman's user avatar
5 votes
2 answers
2k views

Collision detection in pong style multiplayer network game

I've recently implemented an authoritative server (node.js with socket.io) for a multiplayer pong game. I've looked at client side prediction and fixing timesteps and starting to grasp the notion of ...
dolyth's user avatar
  • 445
4 votes
4 answers
4k views

Turn based game - HTTP or WebSocket? [closed]

My game will be a turn based game which will need a server gateway in order to send requests. What would be better for the server: using REST HTTP GET for making the requests? Or using WebSocket which ...
Rushino's user avatar
  • 385
4 votes
1 answer
327 views

What is the best method to serve a real time game on websockets?

The game consists of a world with just one force, gravity. All the players can do is jump and set their velocities with arrow keys. Physical AABBs and sphere's are used for collision. What is the ...
MaiaVictor's user avatar
  • 1,180
4 votes
0 answers
855 views

What's the "right way" to open a websocket connection inside WebGL?

The official Unity documentation says that, to run websockets in the WebGL player, you should use this plugin on the Asset Store. Unfortunately, following that link leads to a notice that this asset ...
Mason Wheeler's user avatar
3 votes
3 answers
21k views

Websockets Server for Unity3d

Is there any way to implement websocket server, which I can run inside Unity3d standalone linux instance? I gonna connect to it directly from webpage (pure javascript, not Unity3d WebGL). I've tried ...
Epsiloncool's user avatar
3 votes
2 answers
1k views

Are sockets required when developing a browser based MMOG?

I'm in the very early phases of developing a browser based MMOG, kinda like this game but not as cartoonish and with more features. I'm an experienced web developer, yet not once have I ever used ...
Robert's user avatar
  • 604
3 votes
3 answers
872 views

Required Security Precautions for Flash / AS3 Multiplayer Game

I have created a couple of games in Flash/AS3 and am playing with programming a flash-based multiplayer (possibly mmo?) game where the application will communicate with a server over a socket ...
Richard Parnaby-King's user avatar
3 votes
2 answers
10k views

How to build a turn-based multiplayer "real time" server

I want to build a TCG for mobile devices that is multiplayer over the web (not local wifi or bluetooth). As a player plays cards I want the second player to see what is being played in "real time" (...
jmosesman's user avatar
  • 143
3 votes
1 answer
532 views

Websocket Scalability w/ Player Skills

About 8 months ago, I asked this question, and received a lot of valuable information from the community. I have switched to nodejs, since then, and am finishing ...
NiCk Newman's user avatar
3 votes
1 answer
5k views

Latency benchmarks for WebSocket games?

I'm trying to find some actual latency benchmarks for using WebSockets in HTML5 games. If I were to go down this route, I'd probably end up using (as you might expect) Node.js and Socket.IO. However, ...
robinhoode's user avatar
2 votes
1 answer
2k views

How to develop a real-time game server for html5 web app?

I'm contemplating a graduate project proposal of developing a rather complex HTML5 game that requires real-time server communication. The premise of the actual game play is simple: 10 players battle ...
Neverlax's user avatar
  • 121
2 votes
4 answers
2k views

What would be best practice of client comunication in a multiplayer game

Assume that we have a multiplayer game and the users are moving their characters (might be a circle) on the game area. At every game loop some changes can be happened. Should clients send their ...
Whispered's user avatar
  • 205
2 votes
1 answer
623 views

Handle game flow in turn-based game on server or client side?

Im building a turn-based game using websockets and nodejs. At the end of each turn I want to show some scores before starting the next turn. Should that be controlled by the server using a timer? Or ...
vermin's user avatar
  • 23
2 votes
2 answers
946 views

Input and output of a server side game using web sockets

I am having a look at redeveloping an old flash based top-down zombie shooter game I made in highschool so that it supports multiplayer using socket.io. My ...
Marty's user avatar
  • 49
2 votes
3 answers
751 views

Limit access to socket end point

I'm developing a multiplayer canvas game based on socket.io and box2d physics engine. Is there a way to limit connections to my socket endpoint and only allow connections from a specific domain? <...
André Ferraz's user avatar
2 votes
1 answer
405 views

Should frame update and network packet sending synchronous or asynchronous?

I am making a game server that has 60 Update-Per-Second (assume I can most of the time achieve it). In the current model, my main loop does the following tasks in sequence: Update game logic (...
Luke Vo's user avatar
  • 465
2 votes
1 answer
564 views

Particle systems on multiplayer games

I'm working on a 2D javascript/Three.js multiplayer game, using web sockets and an authoritative server currently written in Python. The combat mechanic will be similar to Geometry Wars however i'm ...
Nathan's user avatar
  • 153
2 votes
1 answer
3k views

Multiplayer game with Cocos2d-Javascript and Node.js

It is possible to make a multiplayer browser based game using cocos2d-javascript + node.js? If so, is there any tutorial about that?
felipebueno's user avatar
2 votes
3 answers
755 views

How to securely submit a score?

We have an app with several mini-games in it and in each a highscore can be achieved. The score gets submitted by requesting an endpoint and passing the score as a json in the body. How can we be sure ...
dabo248's user avatar
  • 121
2 votes
1 answer
1k views

Building a simple bomberman game with Node.js and Socket.io [closed]

I'm building this game mostly because I want to experiment with Node.js and Socket.io, and the game is more like a proof of concept. To start with, I have a 2D grid system as the game map. ...
Arch1tect's user avatar
  • 297
2 votes
1 answer
3k views

Browser UDP Relay with TCP Websocket

I'm wondering if this is possible and what obstacles I might face. I have a game that's browser based, and since I can't send UDP packets from a browser, Can I use a plugin that the browser connects ...
Taurian's user avatar
  • 121
2 votes
0 answers
632 views

Persistent realtime game authentication (JWT, Passport)

Context I am building a MMO game in HTML5 with canvas. I use NodeJS on server & JS from scratch on client. I also use socket.io to manage realtime. The game is persistent & each player keep ...
ElJackiste's user avatar
1 vote
2 answers
299 views

Determing winning on the server side or client side?

I am using JavaScript + Node.js+Websockets to develop a multiplayer card game. In my single game version the Win determining calculation is done on the client side (of course) with a function. It ...
Frostless's user avatar
  • 113
1 vote
1 answer
777 views

2D Websocket WebGL game

Inspired by BrowserQuest, I want to try my hand at making my own kind of game like this but I don't really know anything about game development other than the basics, like how the game loop works. ...
Jazcash's user avatar
  • 113
1 vote
1 answer
791 views

Tracking player location in realtime 2d mmo

I have read all of the answers here about tracking player locations, but still have some questions. I don't seem to understand how to do this efficiently, and feel that the internet could greatly ...
JosephG's user avatar
  • 357
1 vote
1 answer
3k views

Is it sensible to run a Socket.IO setImmediate loop for each connected player?

Instead of a game loop, I want something different: My game does not have much action going on; just moving users over a tile map with correct timers in between. Since I am using Socket.IO, I want to ...
Oliver Schöning's user avatar
1 vote
1 answer
898 views

HTML5 realtime MMO games, should I do server side physics update or client side?

I am using socket.io and HTML 5 canvas to build a MMO game as a practice. I finished the client side first and currently I am working on server side. Apparently the position/physics update is on ...
newguy's user avatar
  • 255
1 vote
1 answer
490 views

How can I protect against a cheater changing variables on the client?

I built a multiplayer fighting game with impactjs, socket.io and nodejs and faced with "change variables hack" (I want to call it like this). All my current logic with jump, running, shoot ...
李白 puer's user avatar
1 vote
2 answers
635 views

Should I compress WebSocket payload data in a game where latency matters?

I have started work on a new game project where users are in an open environment and fight each other in a fast-paced shoot-out. I know that compressing all of the WebSocket's payload data using zlib ...
Jacob Gunther's user avatar
1 vote
1 answer
1k views

iOS 9.3.5 WebSocket connection always closes with code 1006

I'm working on an app that uses a LabVIEW implemented server on the backend that is proxied via apache. It works great on desktops and android devices but on iPhone and iPad the websocket connection ...
UnlikelyNomad's user avatar
1 vote
1 answer
714 views

Photon Unity Network with Socket IO Ambiguities

When trying to use Socket.IO along with PUN I get multiple errors similar to the one below: ...
Vishal Mohan's user avatar
1 vote
2 answers
1k views

HTML canvas, Node WebSocket and multiplayer game like slither.io. How to send visual data over websockets?

Where to start creating a multiplayer game like slither.io, agar.io, etc. I need only learn how to draw live positions and other data of all players into one fullscreen HTML5 canvas with update ...
Dave's user avatar
  • 113
1 vote
1 answer
571 views

What's the most efficient way to send a users keypresses to the server?

So I've been coding a little project in JS recently, using node.js and socket.io to create a server, and HTML5 canvas to draw the client side. The user receives info from the server every 20ms, and ...
Cameron C's user avatar
1 vote
1 answer
62 views

LibGDX websockets GWT html app cant find source to WebSocket class

I'm using this library to connect to websocket server: https://github.com/czyzby/gdx-lml/tree/master/websocket It's working on android/desktop applications, but when compiling to html gwt app with ...
Часть Пустоты's user avatar
1 vote
1 answer
106 views

Server moving slower than client

I am implementing a pretty straightforward client/server multiplayer architecture with Socket.IO and am having an issue where my client framerate seems to be faster than the servers. I have both ...
zpr's user avatar
  • 111
1 vote
1 answer
509 views

Do I need real socket connections to create AI Bot players in a multiplayer web game?

I have built a realtime multiplayer web game using WebSocket protocol. In my game I create about 100 AI bot players to simulate playing the game with the real players. Every time a bot is dead the ...
newguy's user avatar
  • 255
1 vote
1 answer
1k views

how to handle server tick update for multiple rooms? (Nodejs)

I'm making a multiplayer game using socketio + nodejs. Currently I use setInterval on my server and requestAnimation on my client render. Now I want to create multiple game instances for each room and ...
user111794's user avatar
1 vote
1 answer
2k views

Binary Serialization and Protocol

i found this page Protocols. I'm currently working on a game similar to agario and i find that page is helpful for my game. They using WebSocket for sending game messages which is mine too. But i'm ...
billyzaelani's user avatar
1 vote
1 answer
805 views

Game data structure in node.js

I am building a simple turn-based game in node.js using sockets.io. My web experience with node.js has typically involved saving everything to a relational database. I set this up for my game. I am ...
user5505266's user avatar
1 vote
1 answer
1k views

Best client/server architecture for a mobile management game?

For the past year I have worked on a small company that develops a traditional browser based strategy game, of the likes of Travian or Ogame, but using a more interactive approach like Tribal Wars 2. ...
Manuel Morais's user avatar