F
F
Friend2017-06-05 23:55:44
Python
Friend, 2017-06-05 23:55:44

What is the best way to implement a game server for a 2d game in Python?

What is the best way to organize a game server in python. The game is designed for 1000 players, maybe less than the maximum which can be 5000 players and that is unlikely. The player's field of vision is 576 cells.
How can the server wait for the player's actions?
Maybe there are examples?
What libraries are worth learning and using?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
chupasaurus, 2017-06-06
@chupasaurus

Complete the picture of the appearance of the playing field at least, 576 for the responders is equally equal to 765.
The server must keep a complete picture of the world, clients should only send commands to the server (which the server must check for compliance with the rules and the current state), receive the world changes required by the mechanics (i.e. objects with coordinates in the field of view) and draw what was received from the server.
Waiting is usually implemented in small steps for real-time games (from 20 times per second to how much you can squeeze out of iron); for turn-based - a timer for the move is set and at this time commands are received up to the "End of the move", the command for the end of the move does not have time to come to the end of the timer - the move ends automatically.
pygame- if 2D, the documentation covers in general everything that is needed for mastering; 3D games in Python are bad music, there is Unreal Engine 3.5/4 to choose from (the documentation there is really not everything you need, but the same client-server interaction is painted as it should, the entry threshold is high, there are even more opportunities), Unity3D (good documentation, it is relatively easy to get used to the basic level, but not such a mastodon after all) and from fifty smaller engines.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question