Simple Multiplayer Game Engine – Snake v2.0 – Introduction

close-up photography of human's hand tattoo

I back with a different post. We will continue to work on the game development projects that we had started. The two game projects that I shared with you (Tetris v1.0Tetris v2.0, Snake v1.0provide single player support and I was planning to continue with a simple multiplayer support for those games. It is time! I intend to show you how we can implement simple multiplayer game features such as player/lobby management, messaging, simple synchronization and associated game mechanics using modern C++. In fact, I had already started to implement those using POCO library (check out Vcpkg Tool). To be honest, I had not used POCO library before but reviews and feedbacks were not bad. So, I started to use this library and implement simple protocol for client and server. However, then I realized that it will not be that easy to use this library for android platform, so I decided to go with QT.

I have been using QT for a long time to develop C++ GUI based applications on different platforms. It is very broad and capable library, its community is huge and has widespread usage. It is a cross-platform application development framework for desktop, mobile and embedded systems. If you are a C++ developer, I strongly suggest you to learn this library. Hopefully, with this post, I conduce you to learn this library :).

In addition to QT choice, I started to think about other possible topics that I can conver during developing this. Then, I decided to also include topics that every developer, IMHO of course, should know such as unit testing, continous integration and their application for C++ projects. Of course, we will still continue to develop this capability in cross-platform nature, especially, it should support android platform. I strongly believe that the best way to learn such concepts and technologies is to get your hands dirty and apply them in real project. Although, this may delay the Snake v2.0, it will be an education, and hopefully, entertaining journey. Of course, the scope will not be limited to ones that I just mentioned, I will try to enrich it as much as possible during the course. Meanwhile, I will continue to write about the topics that I already started (i.e. std::any and SOLID), but the priority will be this series.

So how did I plan the content of posts, how will we proceed from now on and what is the current situation? Frankly, I am planning to write short and guiding little articles about these new technologies and concepts that I mentioned in the first place. Meawhile, all of these articles will be reflected in code that I still develop and put on GitHub. After a quick look at the technologies, I will share with you also number of articles specifically about the code. At the end of my article, I have listed the possible titles of the articles I plan to write in this series (these are likely to change on the way), and as I write articles in the future, I will update their links. Of course, they will also have a title of their own under the Series and Example Codes page. I will collect all these articles under the title “Simple Multiplayer Game Engine (SMGE)“. Although, I called it engine, it will not be a very comprehensive or complete library, but it will give you glimpse of such engines 🙂

In fact, I have developed a set of codes for the client / server infrastructure that will serve as the basis for the multiplayer infrastructure. You can access them from the following SimpleMultiplayerGameEngine git repository, take a quick look;)

https://github.com/yazilimperver/SimpleMultiplayerGameEngine 

As I said, they are simple enough to show the concepts of unit testing and continuous integration. Additionally, it is operational and usable and, more importantly, gives you insight into the capabilities of network programming and QT. By the way, there will be a separate post about QT and socket programming.

Now let’s have a look at multiplayer support scope. Previously, I was simply planning to develop it as a library and add it to the snake game that I shared with you before. The current plan is, first of all, to develop a communication infrastructure at the bottom layer, then another layer that uses simple multiplayer capabilities will be developed, and finally applications that use these capabilites will be developed. The applications will be: QT-based GUI and console based client applications, there will also be applications to test and monitor socket communications and multiplayer capabilites.

SMGE Articles:

  • What is Qt?
  • SMGE communication infrastructure and socket programming in QT
  • SMGE capabilities
  • Continuous Integration
  • Unit tests
  • CMake scripts
  • SMGE game clients

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.