As I started to create text-based MMO RPG
In this article I describe a personal experience of writing the first version of the text MMO RPG for Telegram, used for this technology and the stages through which has passed, when creating the game.
the
Introduction, or how I came to all this
trials and tribulations — from 2010. It was then that I met browser games, and even gave them a lot of free time. A couple of years of these games I have wanted to write my own. Collected a few other enthusiasts in one of these brauzerok and we sketched some semblance of TK for our future games. At the stage of writing TZ all ended then.
But the idea to participate "in the great game-the virgin" I never left — was burning somewhere inside, until I did web programming.
this lasted until the beginning of 2017.
About the middle of January, our team received an order from one well-known company to write a bot for several instant messengers. Since the server part of the development team on me, and chose the platform I mainly. First was tested a Microsoft Bot Framework for Skype and Telegram (I note here parenthetically that with a Telegram to the moment I was not familiar). Bot Framework showed some wild latency of responses to user requests from the telegram and I decided to work directly with the Telegram Bot API.
thus was written the first boat, with games unrelated.
But in the process of writing, I discovered several text-based games implemented in the form of bots for Telegram. Tried one of the "classic" MMO RPG about castles, swords, crafting, etc. in the same spirit. Liked the idea of the separation of 5 fractions, and the battle between them. Looked, tried it and soon realized that this is it — I can make a text RPG. This is enough of my resources and my motivation.
This was the beginning of February 2017.
the
creation of the first version of the text MMO RPG
first, was chosen setting — the most that neither is present. Initially, the game was named "the Hacker Wars" and it was agreed that there are 5 companies employing hackers and hacking each other. For successful hacks get local currency and experience for the failures — losing currency.
This basis with us still, though constantly pereplaniruemoe (more on that another time).
a Character on the classics degree and current experience. With increasing experience and increasing the level of the character. There is nothing complicated.
Next you need to determine the skills of your character. Strength, Protection, Agility, and other physical parameters I could not use it the hackers don't fight physically. So I chose the 4th such option opposite to each other in pairs: Practice-Theory, Cunning-Wisdom.
the Next 3 days I spent on a balancer and practiced a variety of modes of interaction of these 4 options have different characters.
this time, it was agreed that it would not simply comparing parameters from opponents and who has the most, wins. It's boring and no. It needed the struggle, chance to hit, evasion (similar to taken still from the physical world, so it is easier to explain). Or what is the same thing — with the chance of burglary, maintenance from breaking. Responsible Cunning and the Wisdom of Rand. And for the amount of damage and critical hits — Practice and Theory. Ie I was not to invent anything, just call skills in a better way.
so, 3 days and millions of bots fighting each other was conducted.
the Next stage is the so-called "Exodus". Various swords, shields, bows, and other belongings in a classic RPG. Or plasmogamy in a post-apocalyptic. In the current situation I decided to use the Gadgets. The 6 character slots for each kind of gadget. In one slot can carry only one appropriate gadget.
After making calculations of the cost of the gadgets and their increase to the skills of the character received such a sign (the sign was later prepared a girl player, my version was just a spreadsheet):
the basics of RPG's skills and gadgets. MMO interaction added — battle 5 companies. Formula gain experience and utaskivaet upon successful hacking currency — painted. But something was missing. I wanted some highlights.
So on the 7th day (and the programmer saw that it was good :) ) the project has all 5 companies. A player could buy shares in any company, but on hand after the purchase, he had to stay a certain sum in local currency — thus the beginning of the battle players have often turned out to be a non-empty wallets, have something to drag when a successful break-in. This was the first linkage of the shares and the battles between them. The next step — change in the value of shares depending on the results of each battle. If the company was broken into — shares lose in price if the crack failed, stocks rise in price. So stocks began to affect the battle, and the battle is on stock.
At that moment I decided to rename the game in Startup Wars — startup Battle.
From a similar MMO project was taken and the main "currency" of moving Energy, which replenishes over time, and increases through the refer-a-friend affiliate link — then I decided not to reinvent the wheel. The only thing — we have this currency called Motivation. Some player actions have a cost, motivation, and in return give experience, money and other resources.
in Parallel with all the mechanics were working on the creation of the game interface. The telegram-bot there are two types of buttons — "normal" text button under the input line and an inline above the input line. Plus the buttons are commands beginning with a slash, eg /help.
I was adopted by a number of architectural solutions based on existing interfaces. So the main movements into different "scenes" of the game are done through text buttons under the input line. They try to keep no more than 6 buttons given 1 to return to the main menu (main menu — profile character). If any page 1-2 actions for decision-making (for example, confirmation of the sale of all shares), then use an inline button. If operations on the page a lot (for example, to purchase gadgets in a local online store) — then use the commands beginning with a slash.
It was approaching mid-February, on the 15th I was scheduled for surgery, after which I was going to run the project. Before the surgery was a few days that I spent on the introduction to the game's extensive help and Refine various details (and the devil just lies in small things) — for example, if you buy a more powerful gadget for the hand, it will automatically replace the old, and the old is put in a backpack.
the First version was developed in exactly 14 days, in between the main work.
the
the launch of the first version of the text MMO RPG
so I returned from the hospital and the next day organized a launch. The guys from our team helped with configuration of your server. At that time it was 1 main game bot that receives updates from telegram via long polling. Plus it is a couple of scripts on the server that run on cron — Sami fights automatically every 3 hours during the day and the script restore lost motivation.
Simultaneously with the launch of the bot, I registered 5 closed groups in the telegram, one for each of the warring companies. Plus one open group for all communication between the players themselves. Plus channel news about the updates of the game. The artist of our team produced a beautiful logo for all these 6 chat bot game and news channel.
For this simple set of content and we kicked off on 18 February in the evening. The launch was timed article on Spark, which got the first players. These players have scattered friends promo links increase motivation and after 6 days we had about 400 players.
Game text, i.e., after each player action, the game sends him an answer. At the time of launch all the texts I prepared myself. Then there were only 2 of the quest, where you could spend motivation — Work and Walk. The player made more money, but less experience. To walk as more experience, but less money. Each quest required attachments 1 motivation and finished 5 minutes of real time. At the end of the quest the player went random phrase from a set of a few sentences describing events that happened to him at work or walk.
after a couple of days we have had 109 phrases of varying degrees of interestingness.
And then I realized that it is time for these phrases to organize, to send to his database and then use in the game. I'll tell you, that this phrase was not included in the first version of the game.
So there was a second bot to play, which I, without thinking, called the SW Informant — something like an electronic tour guide-assistant. I was "addicted" to all 6 game chat and he was called to collect phrases for the contest with the hashtag. Almost immediately after starting the bot, I invented a new hashtag for it — #idea. Each player could suggest any idea to improve the current functionality of the game or offer completely new functionality. Further, there were other hashtags, popular of which, for example, is #bug is the bug report from the players. For the bugs found and implemented in the game idea, I paid with ingame currency.
so, the game was launched and around it gradually began to form a community. I pixel players found bugs and implement interesting ideas. Unfortunately, at the end of February, I was in the hospital for 3.5 months and my friends were forced to stop the game server 3 Mar. So ceased to exist the first version of my first game.
the
technologies Used
the
-
the
- programming language: nodejs the
- library work with Telegram API Bot — http://telegraf.js.org/. the Liked the splitting into plugins (I use redis session and flow), middlewares, context. the
- as an operating base taken redis — everything is stored and used through it. Any temporary parameters of the character that you do not want to remember forever, are also stored here. the
- as a long-term base taken mongodb — here are stored all the data of the player, the companies immediately after the battle. Used for analysis and as a backup data store. the
- in the first version all pending actions (5-minute tasks "walk" and "work") have been implemented using setTimeout.
the
note
If you're interested, I launched a second version after returning from the hospital and after that was with her at the moment — please write in the comments, will prepare another article.
PS: For those of habrovky who wants to play this game, I have prepared a special bonus at launch, which can only be obtained after passing through the link to Habra.
Комментарии
Отправить комментарий