G
G
GmDvlpr2020-02-28 18:02:49
Game development
GmDvlpr, 2020-02-28 18:02:49

How many items can a server store in a game?

The game is written in c#
Let's say an online sandbox game has an inventory that has a certain number of slots where you can put items that can stack, for example, the maximum in the stack will be the type of the byte variable, i.e. 255 pieces of a specific item (let this item be called a stick). And now, that's the question, how many maximum can these sticks be if there are over 100k players online every day and each will have 255 sticks in their inventory, and you can still throw them on the ground and they will not be removed, but will lie until they won't be taken.
Can the server crash because players have too many sticks? Is there a maximum the server can handle? Or does he not care how many sticks there can be, even though their number will be with 50 zeros?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Victor Bomberow, 2020-02-28
@GmDvlpr

First, get familiar with the C# memory model, how the garbage collector works, what heaps are, how they are filled and emptied, how to work with IDisposable, using, and wrapping unmanaged resources.
Because in fact there is a choice: to make a server on .Net or on LLVM. In principle, the LLVM garbage collector has its own, and it is fashionable to come up with a lot of interesting things.
Secondly, you need to understand the architecture of the OS. The thing is, the server can't "crash" due to some abstraction, it can start taking too much memory, and depending on the kernel settings and the environment of your Linux in which the server process is running, different things can happen that are limited only with your wishes.
But it is also worth mentioning that, depending on the chosen strategy for processing connections
(and regarding game engines, it just comes down to the name of the libraries used)
1 server instance can hold 100k connections, but your game room can be served by many nodes, not necessarily one. Moreover, you may not have one nosql database, but a whole cluster.
In other words, you should familiarize yourself with the concepts of ACID, clustering, and microservice architecture. In conclusion, you can read about Kubernetes.
As you work through these topics, you will be able to refine your question to specific technical requirements and be able to answer it yourself.
PS: Regarding the maximum connections to abstract horses in a vacuum, it is considered that one demon holding 10k connections is the highload limit. In specific figures, it usually comes down to the share of processor time for the interval of acceptable server response delay on a specific platform, including specific hardware and a specific network card + access tests from points all over the planet.

D
Dr. Bacon, 2020-02-28
@bacon

The server is big and smart, he doesn't care

F
freeExec, 2020-02-28
@freeExec

Which server has enough money, so many items.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question