My GameDev comeback #3

My third appearance in GameDev turned out to be quite productive.

Once again, my nostalgia for a closed gaming project Rival Fire in which our clan fought hordes of monsters and won in 4×4 and 2×2 PvP competitions, led me to try writing a similar project from scratch.

I have long wanted to try my hand at creating gaming worlds. But reading literature and creating primitive prototypes did not satisfy me. Now, I am determined to create a working prototype of a multiplayer mobile game. The main resource is time, and there is never enough of it. Of course, after a successful experience, I plan to outsource the character models, weapons, and locations.

Game client

I decided to use the Unity 3D engine for the game client. To create a working prototype, I used free models that are available, so as not to burn out at the stage of graphic design. Although I have gained experience working in Blender over the past three years, rendering 3D models takes a lot of effort. So for now, the only graphic design I have is for the UI.

On alpha version i planed

  • The CO-OP level battle (up to four online players) will have waves where the player and their team will have to clear the location of various monsters (from flying to crawling) and fight a boss on the final wave.
  • PVP 1v1 battle on a mirrored arena.

Server

I have written the match server on Node.js. For client-server communication, I use web sockets and the JSON format. Each match instantiates a process that serves the game session for all match game clients on a specific network port. I have not yet determined if it is a good idea to use the TCP protocol instead of UDP. However, there were no issues during testing with two devices simultaneously

Currently, the server successfully spawns NPC monsters according to the scenario from the database for all game clients.

A big topic for discussion is the synchronization of positioning and actions of the player, especially in cases where packets are lost. It may occur that on the player’s client, the character is already at point C, while for everyone else (due to lost data), the character is at point B.

Game assets

I have decided to put in-game assets that may undergo frequent changes (characters, models, sounds, shooting logic) in an Asset Bundle and check for updates every time the game client is launched. This is usually done in modern games to avoid forcing users to constantly download the app from the market during hotfixes, and also to reduce the initial size of the game to prevent scaring off players.

Git repo

The game includes server and client code. Storing the server code is easy because it only takes up 4 megabytes, but it’s more difficult for the client. Raw textures for prebuilds take up about a gigabyte and will continue to grow. That’s why I decided to build my own Git server at home using a Raspberry Pi 4.

I purchased a Raspberry Pi 4 along with a casing, cooler, and a 512GB M.2 SSD, and I am transferring all the code locally to the Raspberry Pi.

Raspberry Pi 4 in an M.2 Argon case looks like a TV set-top box.

Case and ssd extension you can find out here: https://a.aliexpress.com/_9RbPFU

I also set up a copy of the server on it and am testing the entire gameplay process locally with two computers. I think later I will show how funny my tests look from the outside.