Hot answers tagged

36

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's give it a whole kByte, in case you are doing something extraordinary. When a cell has 1000 such entities, it requires a MByte. If your world is 100x100 cells, ...


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

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 given area every time the area is generated, deterministically. Then you just keep the 1000 or so most recently visited areas in memory. When areas are ...


7

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 being fairly simple to implement and scaling fairly well, but making it reliable is completely up the to the developer. SQL databases provide ACID properties ...


4

If a monster is in the forest, but there's nobody there to see it, does it really exist? If a monster is in an area with no players, just ignore it. Nobody will attack it, and it won't attack anyone. So just pretend its not there. In fact, don't even bother initialising it. Its data probably exist in a file, hidden away from the CPU and memory. Whenever the ...


4

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: using System; using System.Text; using System.Threading; using System.Net.WebSockets; using UnityEngine; public class Comms: MonoBehaviour { Uri u = new Uri("ws://blah blah.us-west-1.compute.amazonaws.com:...


4

Save it to the hard drive instead. Saving large quantities of data in a non-volatile fashion is literally why hard drives were invented. If a player isn't interacting with it anymore, you won't need to rapidly access it, so why keep it in the RAM? Just save it to the your server's hard drive in a text file or something.


3

You don't necessarily need to run such games server-sided. When the user exits the app, you save the game-state with the current time and date. When the player restarts the app, you reload the savegame, check the time and date of the device to see how much real-world time expired and simulate that time. You could also do this server-sided if you want to. ...


3

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 with respect to other players and your own primary/authoritative update time step. Instead, try thinking of your game as though it were turn-based, just with very ...


2

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 could create a user with more restrictive permissions and include those credentials in the game. Another alternative, if this is not supported, is to make a ...


1

Option A: For a project that we worked on, we had utilized grouping. It was one creature (with a model of many creatures), but had many hitboxes. When a hitbox HP became 0, it would divide the creature and create a second or third model. Option B: Utilize low-poly models. We had to use this a long time ago for massive battles with multiple mobs. Option C: ...


1

This is what I know about Servers. I have my own Server, but never cared about single Application hosting. There also could be other possibilities. It is not important that it's C++. It is important, for which operating system you compile it. There are good chances, that your server code could be platform independent. (Did you use any Windows libraries?) ...


1

You can create a client websocket in browser-based JavaScript like this. Note the protocol wss:// before the URL of the server. wss is to ws like https is to http - it's websocket via TLS. var socket = new WebSocket("wss://example.com/yourgameserver"); socket.onerror = errorHandler; socket.onopen = openHandler; socket.onmessage = messageHandler; function ...


1

Some of what you ask will fall on opinion based. And know that asking for what technology to use and where to start are off-topic here. However... 1) for a mobile game, I have seen in some post that UDP TCP/Socket are not available in 3g? is this true ? Not true. Note that we are probably talking of running on a mobile operating system that will ...


1

Client-side generation It seems to be the easiest way for you, because Generate them is easy from the game itself. It's usually synchronized by using the same random seed generated by the server. It reduces the load on your server, because it does not have to execute a (probably) expensive generation algorithm and transfer a (probably) large volume of ...


1

If you want to ensure that your players have the most up-to-date map possible, I'd start by including a version-header within each of your map files. This doesn't necessarily need to be a header per-say, it just needs to be some marker or value stored within the file that affects nothing about it in terms of game-play, but can store a value with the version ...


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