The story of the creation of the world map for the game “C&C Tiberium Alliances”. Post mortem

    Hello! In this post I would like to share the experience of creating and developing a service for one notorious online game.

    Life in it is still warming, but, I think, it is already possible to take final results.

    I became aware of this game long before its release, and I was able to get among the first beta testers. I did not expect much from a browser game, but interest took its toll. Pretty quickly, I found an adequate Russian-speaking community and joined one of the clans.

    The first question that arose was “where am I?”. Following the canons of the genre, I suggested that I need to build a radar. But for some reason he was not there. Further, I was surprised to find that the minimap is not provided in the game at all. Which was very strange, given the gigantic gaming space. In addition, as it turned out later, the immediate plans of the developers did not include its creation.

    Having studied the server API a bit, I found where to get the data I need - lists of users with their databases. For a couple of hours I wrote a parser in php. Difficulties arose only with authorization. It was two-level, with hashes and its headers, but she succumbed. Blinded on the knee a page where he simply arranged the names of the players with absolute positioning, uploaded to a free hosting. Search on the map was carried out using the “ctrl + f” browser, just like scaling the map through “ctrl + mousewheel”. I shared this creation with my clan. It turned out that the map was missing not only me. Seeing her, the clan members were very happy, and the clan leadership “ordered” not to spread about the map outside the clan.

    The next day I posted the map information on the general gaming forum. For which he was expelled from the clan, but received a ton of positive feedback from the players. Inspired by such a reaction, I decided to develop the map further.

    At first I tried to replace the names of players with markers from html tags, but it all looked creepy when scaling. The second attempt was to use svg, but the performance was poor. There was only canvas, and here everything rustled already much faster.

    The first release on canvas looked like this:



    After introducing a couple more features, the number of visits to my resource reached ten thousand a day. With the increase in the number of users, more and more game servers were opened in the game. At that moment, one server (game world) was parsed for about an hour. It turned out that with an increase in their number, the map of each individual server was updated less and less. The relevance of the data quickly fell, users began to complain.

    The introduction of curl multisocket, although it reduced the parsing time of one world by half, but could not finally solve the problem. For my luck, one of the developers unsubscribed to me in PM. Pointing to the functions in the code that were responsible for working with the data transfer protocol, creating queries, and parsing information to render the in-game landscape. After several experiments to minimize the number of requests, the parsing time of one server was reduced to 6 minutes.

    Inspired by such luck, I began to saw new features with redoubled zeal. Added the ability to draw tactical maneuvers on the map and share them, completely change the color scheme and customize the icons. And again, everything came up against the parser when the number of worlds reached the 100 mark.


    It was decided to rewrite the backend completely. ZeroMQ was taken as a basis, there were managers of authorization, parsing, uploader, respectively, a set of workers for them + a monitoring system for this joy. The question remains where to put it all. For normal project performance, hosting costs would be just space-borne. A server search in the gaming community did not produce the desired results. I solved the problem by buying home a new hardware with hardware support for virtualization. Especially since I have long wanted to dig into this. I made one virtual machine for myself, having thrown there vidyuha and part of usb ports. On the rest I raised the system, and some of the virtuals were linux, part of windows. Due to the features of the implementation of 0mq binding. There were also problems with the uptime of the service, still not tier 4 :), but changing the provider everything stabilized.

    The map took the following form:



    In parallel with this, I started developing a client for android. I took my php API, ported it to Java and expanded it, implemented the basic functionality. Around the same time, an encoder from Chicago wanted to connect to the development, which I was quite surprised by. On his shoulders lay the task of realizing an e-mail notification of a player about an attack or destruction of his base. A C # colleague wrote a subscriber to the parser, which tracked all the bases of all players on all worlds.

    But everything stopped in an instant. My “insider” said that EA considered the project unprofitable. Their team was disbanded and scattered on other projects. The development of the game was frozen. Accordingly, the development of the client and service also ceased to be appropriate for a dead project, and I put an end to them.

    At the moment, the attendance of my card is 2.5 thousand people. Revenues from advertising since July 2012 amounted to 5 thousand bucks. Donat is less than 200.

    PS While writing an article, hetzner was suddenly offended that I was doing 100Kk post requests per day from one IP and uploading 5tb of traffic per month.

    The lib that I wrote for working with 0mq can be viewed here: https://github.com/limitium/0MQ . If someone is interested, then I will issue a readme and make a package for the composer. Nothing flows, plows 24/7 for 2 years.

    The project’s face can be found here: github.com/limitium/C-CTA-map-frontend

    Also popular now: