Hot answers tagged

42

I may be wrong, but your question makes it seem like you are missing a lot of knowledge in order to successfully write an MMO server. I know this message will likely fall on deaf ears because I was in your position when I started programming. My answer: If I were you I would start smaller. If you want to learn to write an MMO server I would do the following....


37

You don't want to send player input to the server. What you probably want to do is send an abstracted representation of what the player wants to do to the server, and then run the logic on there. Likewise you don't necessarily want to send back everything the client needs to do. For example, you can send some kind of message saying "NPC X died", and the ...


34

Most MMOs (or projects using similar architecture) I've worked on or know of use the first method: the game servers work mainly with the RAM on the machines running the server processes, and only periodically serialize the relevant game data to a SQL database for archival (if one is used at all). The problems you note regarding power failure are valid, but ...


25

Most MMOs these days have anything important done server-side, for safety reasons. You can't off-load much to the client, which is why one of the first things axed are AI routines. I think most developers consider client-side to be hackable as a rule, not an exception. Scalify's Badumna ( http://www.scalify.com/badumna.php ) tries to off-load part of it on ...


23

You should prefer to keep your rendering code separate from your game logic, as they are separate concerns. If you separate your rendering code from your client/server code, you get a couple of advantages: Creating a dedicated server will be easier, as any code that renders will be in one place. You can separate your update phase from your render phase, ...


23

Two words: headless client. Basically it's an AI driven client that's had the all graphics bypassed so that you can run many multiples of copies on a machine, you can even run them on servers because you never initialize the graphics at all. Above all those clients is a supervisor that is responsible for starting, monitoring and stopping all the clients to ...


18

It depends on the nature of the content: Is it an asset that is loaded by the game, like a model or a texture? You want a version control system. Is it some form of data not loaded directly by the game, but used to build data directly loaded by the game, such as a localisation spreadsheet? You want a version control system. Is it a document outlining the ...


18

From an API design perspective, when deciding whether to make multiple separate communicating programs or just one, the question is: can each program function meaningfully without the others? The answer will vary based on your project and preferences. If they can't, it's not worth thinking about. Clearly they're so heavily linked that they're not really ...


15

For traffic load testing there are many tools, but you're going to need to test other things as well that will be specific to your game server because network traffic is only one part of the equation -- the processor utilization and constant database queries are two others that immediately come to mind as important factors that you'll want to measure (there ...


15

Independent of feasibility (yes, depending on scale) there are often better or easier ways. For instance, in your typical MMO, the server really only needs to know about the coarse navigation map used by AI and player pathfinding. Instead of storing the location of a tree, you can instead just cut a hole into the navmap at the location of the tree. Likewise ...


15

1000 player may or may not be a problem. It depends on how often you need to update the database. However there is a simple solution: put the database on its own server. I had a peek at how the database system works a game that people would call an MMO-Lite – which one I will not disclosure – yet I can tell it consistently has more than 1000 players, this ...


14

Well, you got answers but your real answer is at "try yourself". The things differ from game to game. I did couple of multiplayer games for some distributed network game design course. The most challenging was doing a realtime action game where many players involved and sending inputs like hell. When it comes to that point, everything becomes problem. As ...


14

The world being separated into chunks is indeed the first step you should take, with each chunk being handled separatedly. Static objects? Purely static in the sense that they never move, and never disappear? Then you could simply incorporate these objects into whatever data structure you're using for player navigation in the world (such as a grid, ...


14

Attack vector 1: The netcode As already pointed out by Mario, one important factor when designing the network protocol of a client/server application is to not blindly trust the client. You can't control the software which runs on the client machine. You can't even tell that it's your software and not something the user programmed themself. The same ...


12

Web browsers disable some Javascript features for security reasons. My bet is that you just hit Google Chrome forbidding XMLHttpRequest on local files by default (see this answer on SO for how to disable that, but beware: this is dangerous). See this page on the Chrome dev site for details. This is why you have to setup a local HTTP server to workaround ...


12

is it worthwhile to have a separate process that listens for connections and messages from clients and sends the data via local sockets or stdin to another process that runs the actual game server? To answer whether it is worthwhile, you had to first ask yourself, what is the problem you are trying to solve by adding a dedicated queuing service. If it ...


11

As others have said, the first step is separating logic that's shared from logic that's not. While it's great to draw that line wherever it's clear, your addendum illustrates that sometimes you don't have a clean line to split the code down. So, how do we solve cases where the client and server want to do semantically the same thing (play a sound), but take ...


10

As a former developer for MaNGOS and project founder for ScriptDev2 I would say your objective is not realistic. The basics to make the game happy are actually pretty complex. If you tried to do this without pulling code from an existing project you will be asking questions about specific op codes for months. World of Warcraft seems like a simple game but ...


10

I'm not sure what it is exactly that you want to achieve. But, there's one pattern that is used constantly in game servers, and may help you. Use message queues. To be more specific: when clients send messages to server, do not process them immediately. Rather, parse them and put into a queue for this specific client. Then, in some main loop (maybe even on ...


10

Configure your servers to capture and save crash dumps (if you run on Windows, MiniDumpWriteDump and SEH is a good place to start) so that you can diagnose hard crashes offline. You'll probably want to make sure your release builds generate and archive a PDB or other symbol- and debug-help related data internally as well as provide a mechanism to allow you ...


9

Almost all high performance servers, MMORPG or not, use thread pools and multiple queues. A sample design might look like this: On Windows, use IO Completion Ports to avoid requiring a thread per connection. When data is received, deserialize ("read") it into a new packet object. What I do is read the packet type (1 byte) and then use a dictionary/lookup ...


9

The short answer is that for a standard MMO, the AI calculations are always performed by the server. Some games will have the client try to predict the AI, so that NPCs will appear to react more quickly, but that's just an illusion; the real NPC is always controlled by the server.


9

I'm working on my first multiplayer game as well. It can be daunting just learning the problems specific to multiplayer, so I highly recommend that you get good at making single player ones first. First, see if any of the game/networking engines fit your needs. For an Android game especially, starting with a well-developed toolset is almost always a good ...


9

Speaking as somebody who's been paid to do this.. In a standard MMO server network configuration, you have three main pieces: A point server. This server has a public IP address, and contains nothing of value. When a client chooses to connect to the game, the first thing it does is query this server. This server provides the IP addresses (and ports, if ...


8

There's too many undefined or barely defined terms there. MMO is such a loaded term. Without knowing how much CPU processing a user needs, how much backend storage a user needs, etc... It's impossible to say. I mean just at a bare minimum assuming the hardware can support it, you would need 8 front end servers just to support 500,000 connections. (TCP ...


8

I think you are worried about the wrong things Milo. I see from your other questions you are planning on writing the game is C++. Even a not very well coded sever written in a scripting language would be able to handle 100's if not 1000's of requests with out apparent lag in a card game. These kinds of technical details are probably not going to be a ...


8

In my opinion there are a few types of mobile games. Single player / action / arcade puzzle - these doesn't really require a server side anyway and you can go a long way with openfeint or gamecenter to implement the social functions. Multiplayer / MMO / MMORPG - These require a strong backend with very quick response times and the BAAS solutions are really ...


8

After the user authenticated itself to the loginserver, give it a token (an unique, randomly-generated string too long to be guessed). The loginserver picks a gameserver. Send the token, the username and all other relevant data about the user from the loginserver to the server it picked. Send the token and the hostname of the gameserver to the client. Then ...


8

Whichever you do, it doesn't matter. If you rely on clientside calculation of anything you will get hacked. All the "anti-hacker" tooling has AFAIK been thoroughly penetrated, new versions often themselves being hacked in a matter of hours after release. Given that, browser games are a major PITA IMO (poor usability) though they do offer ease of installation....


8

Scrambling the transmitted score is probably worthwhile. To avoid cheat-engine type stuff, you can always scramble it in memory too. If you're storing seven variables, each of which, %10, is a digit, and you add a random number of 10s to each variable whenever a score changes, then it will be tricky to find a variable that matters. You could also get quite ...


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