Questions tagged [node.js]
Node.js is a framework for making server-side Javascript applications, which is becoming more and more popular for game development. It endorses asynchronous I/O and implements CommonJS standards.
137 questions
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('...
12
votes
3
answers
7k
views
Realtime multi-player game design principles for Node.js
I've been reading the Valve article on multi-player networking which has been adapted from Yahn Bernier's 2001 paper called Latency Compensating Methods in Client/Server In-game Protocol Design and ...
10
votes
3
answers
4k
views
How often to save player's state in persistent online games?
In online games, people prefer to log on and off whenever they want. Usually, their game achievements are seamlessly saved, on the server. That is not that difficult to achieve, but I am wondering how ...
9
votes
3
answers
13k
views
How can I generate a 2d navigation mesh in a dynamic environment at runtime?
So I've grasped how to use A* for path-finding, and I am able to use it on a grid. However, my game world is huge and I have many enemies moving toward the player, which is a moving target, so a grid ...
9
votes
2
answers
9k
views
Physics Loop in a NodeJS/Socket.IO Environment
I'm developing a 2D HTML5 Canvas Game, and I am trying to think of the most efficient way to implement a Physics Loop on the server-end of things, running NodeJS and Socket.IO.
The only method I've ...
9
votes
2
answers
2k
views
Collisions between players in multiplayer racing game
I'm creating a simple racing game (spaceships, no gravity) using p2.js, phaser and node.js.
What I have done:
Client receives world state from server:
extrapolate other players based on latest ...
8
votes
2
answers
4k
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....
8
votes
1
answer
3k
views
Automatch / queueing players
I'm using Node.js and Redis. I'm trying to come up with a reliable way to automatch players. There is a matching server and then multiple game servers set up.
The following is what I need to have ...
7
votes
3
answers
5k
views
Tips for communication between JS browser game and node.js server? [closed]
I am tinkering around with some simple Canvas based cave flyer game and I would like to make it multiplayer eventually. The plan is to use Node.js on the server side.
The data sent over would ...
7
votes
2
answers
6k
views
Common mistakes when developing a game with Socket.io and Node.js
I am not a game developer by trade but am working on a card game (that is real time, not turn based). I was wondering what the common mistakes are that people make when new to this sort of ...
7
votes
2
answers
3k
views
Get timing correct with client side prediction
I believe I've got my head round CSP after reading Gabriel Gambetta's blog, Valve article and buildnewgames.com but having an issue understanding the time execution of everything.
So if a player ...
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 ...
6
votes
1
answer
3k
views
How can I run a Phaser engine game without a window?
I'm currently creating a multiplayer game using the HTML5 framework Phaser.
It's a game where zombies spawn on the map and players have to shoot them to kill them. The zombies target players that are ...
5
votes
5
answers
3k
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 ...
5
votes
2
answers
7k
views
How can I better implement A star algorithm with a very large set of nodes?
I'm making a game with nodejs in which many enemies must converge on the player as the player moves around a relatively open space (right now it is an open field with few obstacles, but eventually ...
5
votes
2
answers
1k
views
synchronizing client-server actions
What's the usual way to handle events that are checked both on server and the client, like attacking? There's a cooldown timer to an attack of which the client is aware (so to prevent spamming server ...
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 ...
4
votes
1
answer
1k
views
How to synchronise the acceleration, velocity and position of the monsters on the server with the players?
I'm building an MMO using Node.js, and there are monsters roaming around. I can make them move around on the server using vector variables acceleration, velocity and position.
acceleration = ...
4
votes
2
answers
195
views
Implementing multiplayer aspect of a simple HTML5 game
I've been thinking about this a lot. I am trying to implement a simple multiplayer game but I have difficulty figuring out how to "share the scene". For example, there are non-player entities like ...
3
votes
3
answers
2k
views
OOP implementation of BUFFS and Stats. Suggestion
I am developing an MMORPG server using NodeJS.
I am not sure how to implement Buffs, i mean, equipped objects or used skills have effects on the Player() which has many Stats(), some of them have a ...
3
votes
2
answers
3k
views
Unity websockets client disconnects after server emits with data
I am using some unity "socket-io" plugin i found on the asset store.
(its essentially just a scoket.io wrapper for websocket-sharp) everything works absolutely fine, i can catch clients connecting or ...
3
votes
2
answers
2k
views
Can I use Node.js on consoles?
I was wondering if Node.js was suitable for making games and apart from threads and engines, a big problem is can I port my game to Xbox or PS3/PS4?
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, ...
3
votes
1
answer
118
views
Compiling Unity to WebGL gives a Node ESM module error
I'm trying to build my multiplayer game to WebGL in Unity (using Mirror). However, when I press "build", it gives me the following three errors:
...
3
votes
2
answers
1k
views
Node.js MMO - process and/or map division
I am in the phase of designing a mmo browser based game (certainly not massive, but all connected players are in the same universe), and I am struggling with finding a good solution to the problem of ...
3
votes
0
answers
176
views
Backend architecture for multiplayer browser text game with a short gameloop
This is my first foray into game-dev and I only have webapp experience professionally. I'm creating a browser game in nodejs/react. It is mostly text-based, so no intensive graphics (think chess.com ...
3
votes
0
answers
150
views
Optimising my Node.js/Js/Socket shooter game
So here I made a little shooter game just to play around with and on my pc it runs fine but for people with worse internet/less powerful computers (e.g at school/few friends of mine) it is quite laggy ...
3
votes
5
answers
650
views
Turning a simple HTML5/JS single-player game into a multi-player one
CONTEXT:
I am currently developing the front-end/ client of a simple browser game using HTML5 Canvas/JavaScript. In the future, I would like to add a multi-player dimension to it, most likely using ...
2
votes
3
answers
487
views
General directions on developing a server side control system for JS/Canvas Action RPG
Well, yesterday I asked on anti-cheat JS, and confirmed what I kind of already knew that it's just not possible.
Now I wanna measure roughly how hard it is to implement a server side checking that is ...
2
votes
1
answer
1k
views
cron jobs for MMO browser game
I have to implement cron jobs in to my MMO browser game.
Its like in Travian game - you build something, and wait few minutes or hours..
But the problem is, that cron job shedulers made to be sheduled ...
2
votes
1
answer
755
views
unity, socketio, nodejs. amount of messages sent is multiplied by amount of NPcs that have ever spawned
I am building a 2d top down multiplayer mmo. very lightweight.
a note on architecture
I am using Unity as an engine, I have a backend Nodejs/socket.io websockets server. and a main Master client ...
2
votes
2
answers
1k
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 ...
2
votes
2
answers
449
views
Architecture for mixing synchronous and asynchronous program flow to maximize faux real-time yet logical gameplay?
What I am attempting to make is a faux real-time game engine in node.js (taking advantage of the non-blocking I/O). When I say 'faux real-time' what I mean is I want players to interact with the world ...
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?
2
votes
1
answer
758
views
Collision not working in phaser node multiplayer
I'm writing a tank trouble clone just for fun using phaser and node, so this is my tank instantiation
...
2
votes
1
answer
141
views
Best practice/way for client to speak with server
I'm making a multiplayer game in HTML5 Canvas and Node using Express and Socket.io. It's a platformer style game and so far the players are able to see each other and move around on the screen. It ...
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.
...
2
votes
3
answers
159
views
How to handle "game missions/flights" across the world map
Sorry if my title is a little vague, I wasn't entirely certain how to word this specific question.
I'm developing a small little MMORTS game, and in this game is the world map which consists of ...
2
votes
0
answers
74
views
Pixel Check With Node.js [closed]
I'm trying to check if a pixel of a certain color at (x,y) has moved within a boundary of [(x1,y1),(x2,y2)] and also update its new position to console. I'm doing this as a desktop application so no ...
2
votes
1
answer
249
views
How to handle shoot instructions, in a multiplayer TD
I'm currently working on a Multiplayer Tower Defense game, using ImpactJS & Node. I seek some clarification about how to handle projectiles from towers, let me explain.
So the server is running ...
2
votes
1
answer
2k
views
Shortcut for NodeJS server [closed]
I am tired of typing "cd c:\socket\nodejs"
"node testserver.js"
Into the command promt..
How do I create a shortcut or bat for it?
1
vote
2
answers
359
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 ...
1
vote
2
answers
218
views
Can various browsers be assumed to maintain predictible state accurately in multiplayer online gaming?
With many games it is said that server will assume that clients keep track of the world accurately. Assuming this is true, for a browser based multiplier space invaders game you would only tell the ...
1
vote
1
answer
860
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 ...
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 ...
1
vote
1
answer
681
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 ...
1
vote
1
answer
997
views
HTML5 game pauses when you go to another tab
I'm making a simple game and I use requestAnimationFrame. Now the problem is that when I change to another tab the game pauses and when I return the game continues.
...
1
vote
1
answer
2k
views
How to update the monsters in my MMO server using Node.js and Socket.IO
Currently I am creating an MMO using Node.js and Socket.IO.
The node server needs to handle connections for players, and also use a loop to update all monsters positions in my game and let them ...
1
vote
1
answer
1k
views
Synchronizing players and game objects in a server/client multiplyer game
OK guys,
I have some experience with 2D game development (single player only), so that's fine no questions here.
The problem is with multiplayer games. I already read lots of other questions and ...
1
vote
1
answer
668
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 ...