10
votes
How to optimize collisions
Query only nearby objects
As you already know, you need to check only nearby objects. This means that you need a way to retrieve a list of nearby objects to check.
To do that, you need to divide the ...
7
votes
Determing winning on the server side or client side?
Hello visitors of Jindsay's Card Game Forum. Here is your friend xXx_GameH4x0rPhilipp_xXx with another cheat for you. Do you want to win every game? Here is a simple hack which works with every web ...
5
votes
How to prevent (most) cheating (server-side) in my JavaScript, Node JS, socket.io MORPG?
There is just one way to prevent cheating: Handle all your game mechanics on the server.
Anthing else is snake-oil.
That applies even more to web-based games where every player can access all kinds ...
5
votes
Determing winning on the server side or client side?
Doing basically anything on client-side apat from the inputs is a bad idea. And believe me, if the programmers could collect inputs on the server side, so the client couldn't fake them, then they ...
4
votes
Accepted
cron jobs for MMO browser game
Do lazy evaluation of player build progression.
Whenever you need to retrieve the state of a player from your database for any reason, check how old that state is, progress the time which elapsed ...
4
votes
Accepted
Unity websockets client disconnects after server emits with data
Finally, after many hours of debugging, found an error. This library expects data from server to be a JSON object, and not string (that's a bit weird because this library allows to send both string ...
3
votes
How to optimize collisions
My game is working fine for now, but there's no real way to test with 50 players until people actually start playing.
There is. Just write a bot client for stress-testing your gameserver. While it is ...
3
votes
synchronizing client-server actions
The short of it is that your game design and art both need to be built around the realities of networked play.
When the user clicks, they should not immediately attack. Instead, the animation/effects ...
3
votes
Accepted
How can I protect against a cheater changing variables on the client?
This won't prevent all cheating but at least will make it harder for the average cheat engine/ change variable hack. Follow the simple advise: Don't trust the client.
Now what does that mean? Usually ...
2
votes
unity, socketio, nodejs. amount of messages sent is multiplied by amount of NPcs that have ever spawned
Figured out the problem:
it was a remnant from a previous build in which I was trying to store all enemy data in variables and was not closing the registration of enemies properly:
changed
...
2
votes
Collisions between players in multiplayer racing game
Do physics only on server. Here is an example workflow:
Client presses "steer left".
Client sends "steer left" request to server
Server receives the data.
Server steers instance of client on server ...
2
votes
Multiplayer Game - Node.js syncing other players' position
Approach 1) is traditionally used in RTS types of games where timing is very important. However, this approach has the downside of increasing by a lot the chances of clients cheating. Since the client ...
2
votes
Accepted
How to create additional rooms for new play sessions in a 2-player online game on Node.js?
I would suggest not using Socket.IO's rooms mechanism. It is not very flexible and isn't very appropriate for a robust server architecture.
Here's a quick scribble of how you could structure your ...
2
votes
Implementing multiplayer aspect of a simple HTML5 game
I remember struggling with the same thing actually and here it is. I figured it out not long time ago. I will use the rotating triangle as an example.
The server is the one that needs to figure out ...
2
votes
Why are not the images loaded in Phaser?
I tested your Phaser Javascript code and it works fine. So I'm thinking it's a problem with how you've set up your server. Look up Express.js, its an NPM module that makes it really easy to set up ...
2
votes
Unity websockets client disconnects after server emits with data
I don't have enough reputation to comment yet but I wanted to thank Nick for the above answer. I was facing the same issue but my Unity client was disconnecting when the server sent events that it ...
2
votes
Accepted
Authoritative game server and database storage
Sending the data to the client before you are sure that it was successfully stored in the database, you run the risk that the client will display information to the user that the server ultimately ...
1
vote
websockets authentication security
WSS means Websocket over TLS. So when you force the use of WSS instead of WS, you already solved most problems. Just make sure that
The server certificate is valid and signed by a root CA
The client ...
1
vote
How to optimize collisions
There are different ways to deal with collision, but we should always prioritize efficiency. A brute force algorithm such as the one you’ve implemented runs n^2 times, or at O(n^2), which is expensive ...
1
vote
Turning a simple HTML5/JS single-player game into a multi-player one
Turning a game developed for singleplayer into a multiplayer game when it was not designed for that from the start can be extremely difficult, both regarding software architecture and regarding game ...
1
vote
How can I refer to a recipe defined in one function from elsewhere in my code?
When you define a variable with var, it exists only in the local scope: in this case, inside the anonymous function(currentGame).
If you want the variable to have ...
1
vote
Accepted
Can a block-chain with embedded shared content stop cheating?
Centralized Game
If are going to control the servers of the game. You do not need a decentralized solution such as block-chain. In fact, you will not even need cryptography (beyond what is necessary ...
1
vote
how to handle server tick update for multiple rooms? (Nodejs)
You should remember that nodejs are single-thread.
So if you start few setInterval timers with about 15hz - some of times timers may and will start skipping ticks (as setIntercal can do it when loop ...
1
vote
Accepted
Implementing Turn based Combat Using Node js
This is just an exercise in modeling the objects you want to represent your game.
At the very least, you need a concept of the battling entities (players and creatures) and individual battles.
The ...
1
vote
Multiplayer Game - Node.js syncing other players' position
1 - Client send input.
2 - Server calculate and broadcast: destination, direction, velocity and timing function (if you need acceleration or jump curve).
3 - Unit start moving (on server and on ...
1
vote
Accepted
Implement resolution scaling HTML5 canvas
You have an authoritative server. That server has no screen, so it doesn't make sense to use pixel-measurements in your game mechanics code. So you should make up a coordinate system which works for ...
1
vote
Accepted
Compare two x and y if they are in a valid range
You need the "absolute" method: abs(). This will return a value that is always greater than or equal to zero. This way, you only have to check once for each axis:
<...
1
vote
Accepted
Collision not working in phaser node multiplayer
Make sure you're sending the velocity of your physics bodies from the server too. Position alone won't cut it, because it's not the only thing that impacts how the game objects move.
The most secure ...
1
vote
Throw ball - distance and force
This can be done by measuring the distance between the touch and release point. Along with measuring the time difference from when the touch started until the release happened.
Then simply take the ...
1
vote
why are my client and server physics not syncing up? node.js and html5
In addition to @Nat's answer, you should find a way of calculating when the server got the info from client and using that info to predict the new position. Or even better using extrapolation.
There'...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
node.js × 135javascript × 49
websocket × 35
multiplayer × 28
html5 × 17
client-server × 15
unity × 12
server × 12
networking × 11
browser-based-games × 11
mmo × 8
collision-detection × 7
game-loop × 6
html-canvas × 6
databases × 6
synchronization × 6
architecture × 5
socket × 5
performance × 4
phaser × 4
c# × 3
path-finding × 3
three.js × 3
realtime × 3
gamemaker × 3