Hot answers tagged

10

I have in mind a traditional MMORPG like World of Warcraft. Save after every command from each player and autonomous thing (e.g. NPC) Constant backup. The server could go down at any moment, and the state of the game is saved up to that moment (or as recent as possible, anyway). Impact to server performance; even if it's non-blocking (i.e. on another ...


9

Each pixel doesn't have to be its own node in your navigation mesh/graph. You should be able to subdivide areas by sections, and each section becomes a node in the graph for the A* algorithm. This leaves you with far fewer nodes and much faster searches, however you do have to calculate how to move through these nodes naturally with AI, as you won't just ...


8

Do I send a command to move right every frame? Sure. Why not? As long as the player is moving right, of course. If that's spamming the server too much, you could of course just send the command to move right and the command to stop moving right, but you're risking some troubling behavior if you miss the "stop moving" command. You could compromise between ...


7

Sure it is an overhead, but if your packets generally ain't much larger than the example you give it is not much overhead, pretty insignificant relative to general overhead of sending a package. Of course a denser format is a small performance improvement, and it should be considered. At the early development however I'd stick to something like JSON for ...


7

I take it all the variable name are broadcast as well. Isn't that a huge overhead? That's the case, and yes that's quite an overhead. Wouldn't it be better if I glued all data together using delimiters like this (...)? The disadvantage here would be that I have to split the string each time I receive it. But isn't that much better for latency? That ...


7

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 browser: Press F12 Click on "Debugger" Select check_win.js There is now a window with lots of programming code. Don't worry, you don't need to understand any of ...


7

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 map in areas, and each area has a list of objects that are currently there. Then, you can solve collisions within each area※. ※: Areas do not overlap. Yet, ...


6

Principles for reducing effects of lags are the same regardless of the transport protocol. Packet loss is a another topic - for many kinds of packets losing some is not critical because the next update is probably already on its way - here UPD has the advantage, but when you need to make sure a certain packet is delivered, you need custom acknowledgement ...


6

Nic explained this to me briefly yesterday. Check out the explanation on his blog. http://nic-gamedev.blogspot.com/2011/11/mmo-architecture-creating-ghosting.html


6

Rather than a mesh, you might just consider a hierarchical A* approach. A mesh's biggest advantage is in dealing with game worlds that aren't grid aligned, rather than in reducing complexity from a grid. With a hierarchical approach, you subdivide your world repeatedly (much like a quad tree), and generate connectivity information between the nodes. You ...


6

Yes. You definitely should. Use Let's Encrypt to get a free SSL certificate (or as many as you want or need). SSL is always good to have: without it, man-in-the-middle attacks will be launched, by the NSA if no-one else. Most multiplayer games (e.g. Minecraft) just use raw packets. There's little reason to encrypt packets after one is authenticated as only ...


5

There are several things you could do to reduce the visible effects of lagging. Just some ideas: Send the current acceleration, velocity and position values to the client, and let the client calculate the new velocities and positions until it receives a new data package. Avoid using frequently changing acceleration. You should consider defining states of ...


5

If you're willing to ease on the requirement that a client should be informed of other clients that are exactly 200 blocks away or closer, then here's an idea: split your map to squares of, say, 200 blocks each side. Then you can keep track of where the client is, and inform the client of all other clients in the adjacent squares. More detailed discussion ...


5

I believe setTimeout is good enough for your needs. I am, myself, facing a similar situation and I am going with setTimeout. This awesome article on BNG helped me better understand what a I have to do (or, at least, try): Real Time Multiplayer in HTML5. About the link: It talks mostly about the multiple game loops and networking them. It's pretty cool. ...


5

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 would happily do so. Literally anyone can change the code to always register a winning condition. If they make it send it back to the server, than it's even worse. ...


5

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 of powerful cheating tools just by pressing F12. Anti Cheat Tools (ACTs) work by infiltrating the players operating system and doing all kinds of low-level ...


4

Stop thinking in terms of frameworks and start thinking about what you want your game to do. Does slapping a sticker on the box (okay, website) that says "Runs on Node.js!" or "Built for Box2D!" help sell more copies? Nope. Most users won't know and won't care. You rattle off a lot of technologies, but it seems to me you're just excited to be building a ...


4

It's quite an advanced topic, and as word of warning I'm hesitant to indulge too much in to this because I only know some theory and haven't actually produced an MMO. In MMOs, optimization is perhaps the primary factor in decision making on the technical side. The more users you are able to host, the better. It's easy to accidentally use poorly scaling ...


4

You should check out this article about Real Time Multiplayer Games in HTML5 posted on the buildnewgames.com site by Sven Bergstrom, he talks about the same things and he is using Node.JS. I have something similar going myself. I am just now researching more about the client-side prediction and interpolation and the like myself before trying to tackle the ...


4

To continue from where we left off - the ideal solution is to do all the important work on the server. Since you haven't really said what your game is (Action RPGs can be along a wide spectrum) here are thoughts on how to hide the delays for the user without compromising security in a general way. It is worth it to investigate what working on games in the ...


4

Use a fixed time step to start. Fix Your Timestep The server/client need to estimate the RTT (round-trip time) of the connection to correct times. The server is receiving commands from the (very recent) past. Its simulation needs to account for that. It knows where the client was and wanted to move to, not where the client is and wants to move to. The ...


4

Socket.io will emit connected event for every connected socket. So in your case you will create loads of loops there. It is better to have list of sockets, and one loop separately. As you've said - your case is simple - so keep it simple, do not overcomplicate. var sockets = { }; server.on('connected', function(socket) { // runs for every connection ...


4

When you use two different physics engines, it will be almost impossible that they will always come to the exact same results. Large physics systems can behave quite chaotically (small changes in variables create drastically different outcomes). So considerable desynchronization will become inevitable. The most obvious solution would be to keep the physics ...


4

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 should be a "pre-attack" visual that can be smoothly transitioned into a full attack animation/effect or a canceled effect. More over, this pre-attack should ...


4

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 since the last save, and then put it back into the database. For example: The current timestamp is 2017-06-15 15:49:23. You want to know how many windmills player ...


3

Since it is a single player game, you can do it without any lag at all (assuming you send/receive asynchronous messages). coming to difficulty, its fairly simple implementation. All you do is cross check the action (like price, item available etc.,) which 99.99% will be valid. Now you decide what should happen when some thing fishy happens (like something ...


3

A little example for you, i hope it will be helpful. // Base game object var GObject = function () { // Entities storage this.entity = { hp: new GEntityHp() // ... }; // Storage for buffs, debuffs this.buffs = []; }; GObject.prototype.addBuff = function (buff) { buff.applyTo(this); this.buffs.push(buff); }; // ...


Only top voted, non community-wiki answers of a minimum length are eligible