Menu

Developing network-based multiplayer games made easy
🖼️

Developing network-based multiplayer games made easy

DEV Community·Tio Fabi·6 months ago
#Q8ujrJLD
#python#gamedev#opensource#programming#game
Reading 0:00
15s threshold

Implementing network-based multiplayer games is a challenge. At the same time, game development has always been a popular choice among beginners.

For this reason I have developed a lightweight server and framework for turn-based multiplayer games . It was primarily designed for a programming course where students work on projects in small groups. However, the use of the server is not limited to educational scenarios.

Implementing clients is easy thanks to a user-friendly API.

Adding new games is accomplished by deriving from a base class and overriding its methods.

Here is a short demo of the API usage:

from game_server_api import GameServerAPI , IllegalMove

game = GameServerAPI ( server = ' 127.0.0.1 ' , port = 4711 , game = ' Yahtzee ' , session = ' mygame ' , players = 3 )

my_id = game . join () # start/join a session state = game .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.