All Questions
Tagged with javascript node.js
49 questions
0
votes
1
answer
91
views
Improve performance of server updating game state
I have a Node.js game that sends update packets to players every 30ms.
The code I currently use works this way:
Get the entities within each player's vision.
Create a temporary object that stores ...
1
vote
1
answer
596
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
0
answers
684
views
How to make an update loop in a Node.js game server
I'm making a multiplayer game with a Node.js server, and I'm searching for how to write the game loop.
I'm currently using a setinterval every 15ms, but someone ...
0
votes
2
answers
284
views
How to efficiently do one-to-many collision checks?
Scenario: 4 players, each can have from 1 to 100 pawns.
I want to be able to efficiently check if Player 1's pawns collides with Player 2, 3, and 4.
Currently I have an AABB check, done first on ...
0
votes
0
answers
32
views
Hashing images like CDs for Monster Rancher style randomizations
I have been kicking around an idea for creating a web based game where they can upload images in order to create random monsters/items. This I thought was most similar to how monster rancher ...
0
votes
1
answer
194
views
How to check whether the user completed their missions?
I am working on a coding/gaming application.
I am currently stuck in the daily missions part.
So, the user receives some missions each day, such as solving a problem, following another user, or ...
1
vote
1
answer
358
views
How can I implement a Boardgame.io project using Webpack?
I am following the boardgame.io tutorial, but I do not want to use either of the two implementation options covered in the tutorial (React and Parcel).
The tutorial requires a framework or bundling ...
1
vote
1
answer
347
views
2D Grid-based Pathfinding with Elevation
I'm creating an isometric game which currently uses A* Pathfinding on a basic grid representation of the map.
Having elevations and allowing the Players to traverse up-and-down is an integral part of ...
0
votes
1
answer
953
views
Why are not the images loaded in Phaser?
I am starting to use phaser to create games and I found a problem that I can not find for more tests that I did.
I can not show the images I am uploading. You only see a small square in the center, (I ...
0
votes
1
answer
514
views
Canvas HTML5 Top View -> Isometric
We are working in a simple MP strategy game using Node, Express and Sockets! I'm wondering if there's an easy approach to a transformation to make a Top View game into a 3D Isometric, without adding a ...
1
vote
1
answer
867
views
HTML5 game pases when you go to another tab
I'm making a simple game and I use requestAnimationFrame. Now the problem is that each I change to another tab the game pauses and when I return the game continues.
...
0
votes
3
answers
3k
views
How to optimize collisions
I'm building a 2D MORPG using JavaScript, Node JS and socket.io
To prevent cheating, I have to run all collisions for all players on my server.
I'm currently doing fairly simple square collisions ...
0
votes
1
answer
2k
views
How to prevent (most) cheating (server-side) in my JavaScript, Node JS, socket.io MORPG?
I'm working on a fairly simple JavaScript + Node JS + socket.io (M)MORPG where multiple people play in the same world.
This is actually working, but cheating is insanely easy at the moment.
My goal ...
0
votes
1
answer
66
views
How can I refer to a recipe defined in one function from elsewhere in my code?
I want to access the variable recipes defined in this code below.
Unfortunately I have to define my recipes inside ...
3
votes
5
answers
568
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 ...
0
votes
1
answer
517
views
Implement resolution scaling HTML5 canvas
I'm building an hmtl5 real time game using socket.IO and node.js. If you've heard of the classic game "pong", I'm going for that. When you consider the gameplay for this game, it becomes apparent that ...
0
votes
1
answer
100
views
Compare two x and y if they are in a valid range
Today my mind is a little foggy, the right thing was for me to do it the other day, but I will not, I will continue today. XD I need some help to think and find a way that works without bugs.
What I'...
0
votes
1
answer
312
views
How to find and send data about on-screen players to a client in a real-time multiplayer game?
I'm surprised I couldn't find much information on this.
I am making a top-down browser game in which the players see a small section around their player (see the image). Since the player doesn't need ...
2
votes
1
answer
729
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
938
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 ...
1
vote
0
answers
425
views
Node.js in LibGDX project [closed]
I'm developing a game with LibGDX, and right now I'm trying the multiplayer part. I have managed to connect several players through Node.js and socketIO but when I try to make the lobby I am doubting ...
3
votes
0
answers
135
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 ...
1
vote
1
answer
894
views
Throw ball - distance and force
I have a question, I need a formula to calculate the distance and a force based on the speed that drags the finger up on the phone. And is there any way I can get a look? And also shows the trajectory ...
0
votes
1
answer
80
views
How to solve this card game turn requestes clashing issue
So I am developing a poker card game using JS +node.js + socket.io.
It is turn-based game. There will be a host and 4 other players.The flow is the players need to make a yes/no choice, then the host ...
1
vote
0
answers
382
views
How to create communication with node.js server to client browser about monsters(object)
First hello and sorry for my English, and now about my problem.
I create node.js server that communicates with the browser-client for player position, life, def, ...
1
vote
2
answers
304
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 ...
0
votes
1
answer
127
views
why are my client and server physics not syncing up? node.js and html5
My server looks like this -
...
0
votes
1
answer
107
views
SailsJS + Rotational direction coordinates calculation issue
I'm creating a small game to learn how NodeJS & Sails work (and by extension Waterline, Socket.io, Express, and all their components).
I'm using websockets to make the server calculate the ...
0
votes
1
answer
2k
views
Structure game database to store player info and items
Recently I started developing my tiny html5 multiplayer game made in Node.js, Express.js, MongoDB(Mongoose), Socket.io and using Phaser.js.
I am quite new to these frameworks and especially new to ...
2
votes
0
answers
67
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 ...
0
votes
1
answer
121
views
Is it bad practice to for the server to request data for a client from another client?
I'm making a collaborative whiteboard app so that when someone is drawing and uses a rectangle for example, a rectangle packet is sent to the server with parameters like ...
-3
votes
1
answer
320
views
handling wars in multiplayer browser game [closed]
I'm building a browser game about countries, cities, the user control his city, building it upgrading it, can fight other cities in the same country, elections and war between countries, peace, trade ...
1
vote
1
answer
1k
views
How to use Cocos2dJS to connect to a Socket.IO server?
How can I connect to a nodejs socket.io server from a cocos2djs game? I've google all the way to no avail. I tried this but it ...
0
votes
0
answers
149
views
Fix latency when sending state
I have a multiplayer game done with Phaser, which runs in the browser and on a node.js server.
The server is authoritative, every 50ms or so it sends the game state object to all clients. The clients ...
0
votes
1
answer
601
views
Developing a general use multiplayer API [closed]
I'm tasked with the development of a general use multiplayer API in JavaScript, with a Node.js back-end. The goal of the API is to provide a service to JavaScript mobile game developers so they can ...
0
votes
3
answers
2k
views
timezone independant Date.now() for node.js game
I have a game I'm working on using node.js and socket.io. The issue I'm having, is I'm trying to have it so that players execute whatever actions they inputed about 50ms in the future, giving everyone ...
0
votes
1
answer
590
views
Node.js/V8 as a Platform for High End Local PC Game Development? [closed]
As a Web/UI dev rapidly expanding into more wide-open generalist territory, the more I learn about how its done in other languages, the more I love JS for architectural and basic messaging/event-...
0
votes
1
answer
269
views
Tips on building a real time multi player web platform + framework and/or tookit [closed]
I'm trying to develop a multi player game web app which basically should be able to achieve the following goals:
Provide a game engine + framework/toolkit to let third party corporation integrate ...
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 ...
0
votes
1
answer
2k
views
Am I doing this node.js game loop wrong?
I have 2 arrays of JSON objects, actions and game objects.
At any time a user can make a request from the client which can add an action to the actions array.
I have a ...
0
votes
2
answers
88
views
In an asynchronous server environment where player input and timed events modify data is using an in-memory array problematic?
So let's say I have a server running on node.js, and there is an array of player objects...
At an interval, all of these player objects are looped and processed for events and changes that are based ...
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 ...
2
votes
1
answer
230
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
3
answers
428
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 ...
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 ...
-3
votes
1
answer
2k
views
Extremely simple online multiplayer game [closed]
I am considering creating a simple multiplayer game, which focuses on physics and can accommodate up to 30 players per session. Very simple graphics, but smart physics (pushing, weight and gravity, ...
0
votes
3
answers
1k
views
How do I make a message based communication system between objects?
Just as I was told here, I need to make some kind of communication between objects in my game. Mainly, for achievements. How do I do this? My idea was to make every object have an array attached to ...
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?
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 ...