📜 ⬆️ ⬇️

How to develop a multiplayer 3D game without artists, designers and modelers in six months



Hi, Habr!
There were a lot of stories about game development, today I will try to briefly tell ours.

Peace is text - Jacques Derrida
Game is a dictionary - a11aud

Idea


It all started with the idea put forward by a11aud that the state of most processes can be represented by a state machine that is controlled by commands. The state of this finite state machine is represented as a dictionary, which is handled in a high level language, in our case in Python. Such an approach promised many advantages with the proper choice of technology. Anton wrote down a test messenger on the tornado and everyone safely forgot about it.
')
By the end of last year, the economic situation forced us to return to the idea and the concept was born. Although the invented architecture allowed to tighten almost any strategic game on the mechanics, the final decision was a team tower defense 4x4 in a fantasy setting.

There were four of them


And the developers were only two. And everyone worked on the main jobs for 8 hours a day. And we stood at that pace for half a year.

In accordance with the principles of democratic centralism, all decisions on architecture are made by the architect, and decisions on game mechanics by the game designer after a joint discussion.

The process was organized iteratively: a list of features for implementation with those responsible was planned for each week. Regardless of the results of the iteration, the functional should grow from iteration to iteration. Every week, whenever possible, a joint gathering, demonstration of achievements, distribution of elephants, eating food and sometimes even drinking beer were held.

It was planned to smoothly increase the software functionality and starting from the playable version in parallel to begin work on creature models and interface design.

Technology


For the server, it was decided to continue using tornado. This made the development accessible for the little ones and made it possible to scale the server solution easily. The server was thought authoritarian from the very beginning. A player can interact with him only by strictly defined game actions and cannot influence the mechanics. Excuse me, cheaters. That is, the client is essentially just a “TV with remote control”, which shows the gameplay.

Unity was chosen for the client application: cross-platform, excellent support, ease of entry made this engine the only reasonable solution in the context of our team.

The interaction between the server and the client, it was decided to implement the raw protocol websocket. Bribed the simplicity of work in the tornado , but then it came back.
But first things first.

A little bit of the basics


What is any game? This is the cycle of calculating the game world with a certain calculation step, continuing to win / lose. In exactly the same way, the state of the game arrives on the client, which it draws, simultaneously sending the players actions to the server. There can be a lot of gaming data, so in order to have about 5,000 gaming applications running on one server, we had to go the following way:
  1. Initially, we drove json-serialized state of the game world.
  2. When it became clear that it was not enough for 10 instances, a diff-algorithm was implemented which allowed sending only the delta state. Life has become better.
  3. The websocket 'specification suggests the possibility of traffic compression by the deflate algorithm. But unfortunately in the implementation that we chose, compression depended on the system libraries and was different for Windows and MacOS. I had to go to the source and make my own compression with the toss and goblins. This gave a gain of 40 more times. Life has become more fun.



Game mechanics




The calculation of the battle takes place according to the obvious pattern: units approach each other, if the distance to the nearest enemy allows an attack, the fight is tied up with damage calculation. It sounds simple, but in real life it is an algorithm of quadratic complexity and the speed of python operation seriously affects the mass batch. A comprehensive solution was applied:
  1. Units began to be stored in an R-tree . This reduced the cycle time for calculating targets for an attack.
  2. With Cython, the combat component is compiled into sish code. Performance gain is about 10 times.


Fox attack




And now back to the question in the title. Of course nothing. If the game is more difficult than tic-tacs, nothing will come of it. In the initial stages, we debugged on cubes, then switched to free models from the Unity Asset Store. When we were nearly injured by the type of attack of puppies and foxes, we called on the Varyag to help. One great designer from Chisinau responded to our call. The design that you see on the video was made by him, but life circumstances imposed some restrictions on our cooperation. Dimych, if you read this, thank you very much for the goblin, the speedy housewarming, we are waiting for you.

In general, if you decide to follow in our footsteps, do not start without artists. Despite all of us, we are optimistic about the future and continue to search for people who are ready to cooperate.

Source: https://habr.com/ru/post/258859/


All Articles