Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Hot answers tagged

36 votes
Accepted

Mechanics to keep mobs and environment alive without using tons of memory?

First of all, are you sure you really need that? Have you calculated the memory footprint? A small back-of-the-envelope calculation: A single mob and its state should fit into 100 byte of data. Let'...
user avatar
  • 111k
17 votes
Accepted

Should a socket server and game server be separate processes?

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 ...
user avatar
  • 13.3k
16 votes

How does mmorpg store data?

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 ...
user avatar
  • 18.1k
15 votes
Accepted

Storing coordinates of every object in server side in MMOs

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 ...
user avatar
14 votes

Why do I need a local server for HTML5 game development?

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 (...
user avatar
14 votes

Mechanics to keep mobs and environment alive without using tons of memory?

One way you could solve this problem is not actually storing state on disk, but just setting up your generation code to use a seed for the random number generator, so it generates the same thing for a ...
user avatar
  • 249
13 votes
Accepted

How to keep server-client clocks in-sync for precision networked games like Quake 3?

After searching around, it seems that synchronizing the clocks of 2 or more computers is not a trivial task. A protocol like NTP does a good job but is supposedly slow and too complex to be practical ...
user avatar
  • 449
11 votes
Accepted

How to avoid duplication using client-server model

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 ...
user avatar
11 votes

Should a socket server and game server be separate processes?

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? ...
user avatar
  • 319
10 votes

Websockets Server for Unity3d

System.Net.WebSockets seems to be completely built-in to .Net and freely available in Unity. Here's a full Websockets client for Unity for example: ...
user avatar
  • 150
8 votes
Accepted

How to make hard to hack leaderboards

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, ...
user avatar
8 votes

How do I keep a PHP server running forever?

One way to do this is not to change the actual values in the database in realtime. When the player logs on, you see how long it's been, and how much stuff he should have if he were earning during the ...
user avatar
  • 6,399
8 votes

How does mmorpg store data?

Both approaches are used with MMORPGs. Keeping everything in memory and periodically check pointing it to disk seems to be the most popular option, at least for older games. It has the advantage of ...
user avatar
7 votes

Storing coordinates of every object in server side in MMOs

Yes - it is feasible. MMOs often split the game world into multiple areas, as this makes the job easier, but you can still do it with 1 massive area - you just need to use a good spatial partitioning ...
user avatar
7 votes
Accepted

Client side prediction physics

Client-side prediction depends very heavily on a deterministic physics model that exactly replicates the way the game object behaves on both the client and the server. Even small floating point errors,...
user avatar
6 votes
Accepted

Why will my server not execute a command sent by the client in Unity 5.1?

As per the documentation, [Command] and [ClientRpc] should be in a NetworkBehaviour, not in ...
user avatar
6 votes
Accepted

How to develop both a client and headless server together in Unity

Myself, I'd recommend keeping the server and client authored in a single Unity project. This minimizes the chance for mistakes where you change something in either the server or client and miss ...
user avatar
  • 113k
5 votes
Accepted

Why I need a backend for a mobile social game?

There are several reasons why to use a backend. Without backend, you can't really have states in your game. That means players start all over when they refresh the web page. The facebook API stuff ...
user avatar
  • 2,102
5 votes
Accepted

MMO Client / Server Architecture (NoSQL)

It isn't necessarily as clean cut as you expressed but in overly simplified terms and generalized notions, you are on track. The thing to remember is that the client expresses it's intent to ...
user avatar
  • 1,987
5 votes

Should a socket server and game server be separate processes?

I agree with ratchet freak. As long as you have a single gameserver, it's not worth the trouble. However, this architecture might prove useful when you need to scale up horizontally. When one ...
user avatar
  • 111k
5 votes

How to make hard to hack leaderboards

If what you get is just a score number, you can not verify how it was achieved. To make it more secure you need to obtain a full replay and verify that the game was fair (no cheats used, no score ...
user avatar
  • 10k
5 votes
Accepted

How to design a server for a multiplayer game?

Depending on what language you are using, the answer can vary. However, if you know any Java, or can at least get the gist of it, here's some old code I wrote to handle something like this. https://...
user avatar
5 votes

How should I implement a timer in a strategy game?

I'm inclined to assign this task to the server for security and integrity reasons, but i'm not sure on the way i can accomplish that. Yes, definitely; never trust clients. Clients sometimes "predict" ...
user avatar
  • 3,624
5 votes

Calculate resources real-time. Sockets or not?

Introduction There are pros and cons to each method of synchronization you gave that depend on a couple of factors. First, is your game singleplayer or multiplayer, second, how real-time is your game?...
user avatar
  • 163
5 votes
Accepted

Inputs in realtime multiplayer game

It sounds like your problem arises from processing players' input eagerly, the moment it comes in. In this situation, it's harder to keep track of the context of the input and its timing/frequency ...
user avatar
  • 113k
5 votes
Accepted

How to connect to a server without hard coded passwords?

Don’t. You cannot secure your password indefinitely. What you can do is restrict access remotely. I don’t know anything about trello, but if it allows multiple logins with multiple permissions, you ...
user avatar
  • 5,179

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