The idea of using spreadsheets as a medium for developing toys is
not new . In this article, I will share my experience in creating engines for live-action role-playing games and team-building games that can make life much easier for game practitioners.
Why do you need it
Suppose you are playing a game in which 50-60 people participate simultaneously. Each player has a set of personal parameters (for example, experience, money, health, reputation), which vary depending on the actions performed by him. There are also a number of general game indicators (for example, the environment, a country's budget, or a government rating), which also fluctuate in accordance with the actions and decisions of the players. And there are game events that occur with a certain combination of external factors.
In general, this is a fairly dense flow of information that needs prompt and accurate reading. In the classic role-playing game, this function is usually performed by the game master. But the master is not immune from mistakes, and he still will not process a lot of information - neither in the head, nor even with the help of a piece of paper.
With the electronic engine, one person is able to process the information flow of any volume. At the same time, game statistics can be output to the projector, so that participants can see in real time how their actions affect the game layouts. Or, for example, you can show the secret data to each player targeted to the smartphone. And most importantly - you can use this engine for free!
')
Inspired by gaming practices about a year ago, I managed to write 7 engines for various team-building games. Most of these games are commercially successful, and one is even sold as a franchise abroad.
Cash flow
It all started with the game "
Cash flow ". My acquaintances invited me to play on the famous desktop of Robert Kiyosaki, and she hooked me very much. The only thing that irritated the game was the need to constantly make calculations in the bar, erase the outdated data and enter new ones. Due to the fact that all the participants, fearing to be mistaken, were constantly focused on their own calculations, the game was losing much in dynamics and dragged on for long hours.
I decided to optimize the gameplay by transferring all the cost estimates to the Google table.

To test this “calculator”, I spent a few games for friends. The effect was awesome! Instead of plodding over calculations, players were actively involved in the gameplay, negotiating, inventing complex financial schemes and frauds. The speed of the game itself has almost doubled. We managed to complete it for the first time, when all the players left the rat race track and reached their goals. For comparison, in the “manual” version, the participants barely had the patience to finish playing to the moment when at least one of them managed to reach the big circle.
“To go nuts! - exclaimed my friend Ruben during one of the games. - Eight adult men gathered to stare at the screen with a google tablet the whole evening. But it's really more interesting than any movie! ”
My plate for calculations in the game "Cash flow" can be downloaded
from here . If it is not fully understood how to use it, write to me and I will send detailed instructions.
Zombies, presidents and assassins
A little later, I stumbled upon the scenario of the armchair role-playing game "
All The President's Zombies " by American game designer Mike Young. In the story, a zombie apocalypse is taking place in the country, and a group of senior officials gather in the presidential office to work out a plan to solve this problem.

I liked the concept, and I decided to create my own game, localizing the creation of Young. It turned out the game "
Emergency Meeting ", which is far enough away from the original. It is based on a spreading tree of events that occur in real time depending on the decisions taken by the players at the meeting. Instead of painstakingly teaching the masters of the game, I created a Google spreadsheet that automatically calculated the consequences of each of the actions taken by players. The moderator could only put ticks on the screen and draw cards from the deck, the numbers of which were highlighted in the table.

A certain difficulty in me caused the need to track the dynamics of game parameters. After all, when the value of a cell changes, the table instantly recalculates all the formulas associated with it, without preserving the old value anywhere. I figured out how to get around this complexity, but I’ll talk about it below.
Having spent a couple of dozens of “Emergency Meetings” for friends and acquaintances, I realized that this is a promising format for all kinds of team building and corporate stories. Only a restriction on the maximum number of participants in 12 people prevented. And I began to invent new games that could be played by a large team. At the same time, the leading ecosystem was still to manage the game ecosystem. So there was the game "
Freaky Venice " based on the Assassin's Creed franchise, "World domination" about the confrontation of superpowers on the world stage, "Election Day" about honest and not very political technologies and a few more games that solve specific problems of specific customers.
When developing each of these games, I was faced with certain difficulties, and now I'll look at some of the most interesting examples.
Problem - Solution
The basis of any game engine is the following sequence of actions: 1) collecting information about decisions made by players, 2) entering this information into the system, 3) checking conditions and calculating new data by the system, 4) issuing players new data. Depending on the plot of the game, this cycle can be repeated from one to a conditionally infinite number of times. At the same time, all the players' communication that precedes the final decisions is left behind the scenes, and the game system is not taken into account. So, in general, the process does not produce the sensation of a computer game, leaving room for lively emotional interaction.
Cycle emulationThe main difficulty in the development of the engine in the Google table is the absence of such familiar programmer entities as a variable, cycle, interrupt, procedure.
Suppose that the missing buttons can be replaced by a cell with a checkbox value - in some particular cell there will then be a formula that checks the state of the checkbox and calculates the value of the target cell depending on it. But what about the fact that the entire table is static in time, and when the value of a single variable cell changes, the values of all other cells that refer to it in the formula are instantly recalculated and “without demand”? I didn’t come up with anything better than to compensate for the lack of subroutines and loops using tabs. You simply create as many tabs in a table as there are cycles in the game and how many times a game theoretically one variable can change its value. Then, for example, a cell in tab-2 will inherit the value of the same cell in tab-1, undergo some changes and transfer its value to the same cell from tab-3. Here, for example, how the cycle tabs look in the game “World Domination”.

In the story, the game always ends after 6 years, so in the table there are 6 tabs with playing fields.
And here, for example, is a formula that calculates the country's budget in the third year of the game, summing up the initial budget of the second year and the amount of the budget increment of the second year:

Here, E41 is the sum in the budget at the beginning of the year, X44 is the sum of changes in the budget during the year.
Or here's a formula that displays data on the economic condition of a city on a player’s tablet, depending on what year it is in the yard. Depending on the value of the cell “counter of years” $ F $ 1, the values of the same cell E36 are output, but from different tabs corresponding to one or another year.

Such a solution, unfortunately, makes it possible to develop only turn-based games consisting of certain cycles (day, day, night, month, year, etc.). Moreover, the number of cycles must be foreseeable, otherwise it will take an eternity to write the code. However, if there is no task to inform players of the intermediate values of the game parameters and track their dynamics in the process, with tabs-cycles, you can not bother at all.
Distribution of rolesSometimes, before starting the game, you want to wisely distribute the roles, so that, for example, the most active characters get to more sociable players, and double bottom roles - to those participants who know how to bluff and hold back emotions. In the game "Emergency Meeting" this task is also automated. Before the start of the game, participants receive a link to a Google Forms form, where they answer a few questions about their game preferences.

These data fall into the table, where the algorithm based on them distributes the roles between the players.
Player data collectionHow to organize the collection of data from the players, if their 80 people? At first it seemed to me a good idea to use instant messengers for this purpose. Each player (or each team captain) has a direct chat with the leader, where he can send his teams and orders, notify about decisions made. However, test games showed that messengers are a bad idea. Players begin to flood, ask a bunch of questions, make mistakes and cancel orders sent earlier. As a result, the data processing speed drops, the stack of requests grows, and players have to wait for a few minutes when their order takes effect. In addition, most of the game participants spend vostivivshis in their smartphones, but it does not contribute to live communication and team building.
A good solution was the collection of data from players through questionnaires and cards. For example, in Freaky Venice, players throughout the game pass the filled in cards with wordings like “Paolo Alighieri sent killers to Giacomo Sforza” or “Leonardo Bertolucci seduced Lucretia Medici”, and the leader can only tick the corresponding names and surnames.

And in the Election Day game, the high school students hand over the completed questionnaires of this format after each game cycle.

The data in such a questionnaire is as ordered as possible, and it takes the master no more than 5 seconds to drive them into the table.
Balance tuneIn role-playing games, the game balance is important: resources should always be in easy deficit, and various tools for achieving goals are about equally effective. You can rebuild the balance only manually and only empirically, conducting a series of test games. In order not to go crazy, changing back and forth the parameters in each formula and in each cell, a very convenient solution is a separate directory tab, where all adjustable parameters are displayed, and the formulas of the rest of the table refer to them. With the help of the directory, it is also possible, for example, to switch the language of the game by one checkbox switch. This feature is implemented in the game "World Domination".
Entering data into the systemIn order for the game not to sag, the master must be able to enter data into the table as quickly and ergonomically as possible. In Google tables, you can customize the data entry format (dada validation). The fastest and most convenient format is the checkbox. However, not all formulas can work with TRUE and FALSE values. Therefore, it is better to immediately translate the checkbox values to zero or one in some neighboring technical cell, and then to do anything with this zero and one.
The drop-down list is also a very convenient input format if the cell assumes more than two values. The presence of ready-made options in the list saves the presenter from typos that can play a critical role in the game.
Here is an example of data entry fields in the game "World Domination".
Event indicationIt is important for the moderator to notice and react to game events in time. So, in the “Emergency Meeting” you need to notice in time the changes in the cells with the card numbers that players need to issue. And in the “World Domination” it is necessary to inform the players in time that the city was subjected to a nuclear strike. So that the presenter doesn’t miss anything, you can use the conditional formatting property of the cell - for example, you can make it so that when the text "city is destroyed" appears, the cell itself is painted in red. In the field of view of the lead will be a bright red spot that is impossible not to notice.
Individual informationThere are situations in the game when some of the data is known to one team, but not to another. For example, in the game "World Domination" information about the presence of nuclear weapons in a particular country is classified. In this case, it is convenient to use separate output devices for each command, and only publicly available information is displayed on the main screen. Technically, this is solved as a group of separate tables (its own file for each command) into which only necessary information is pulled from the master table using the IMPORTRANGE function.
By the way,
Google Sheets provides the ability to export data from a table to a web interface , so if you want, instead of a dry table, players can display data on tablets in the form of a beautifully crafted and animated infographic.
Neat graphicsIn the game, instead of numbers, sometimes you want to display a graph, but standard diagrams annoy with their redundancy. And the fact that they do not know how to stick to the cells and always look very sloppy. Fortunately, in Google tables there is a SPARKLINE function. This function displays a mini-graph inside the cell. It has certain settings and can be used to concisely visualize some data.
Game newsSometimes it is required not only to display a number in a cell, but also to formulate a thought in the form of a well-constructed sentence (for example, in the “Latest News” section). In this case, the CONCATENATE function comes to the rescue, which is able to glue pieces of text with numeric values from different cells. This is what a formula looks like using this function.
SummarizingIn the "World Domination" and "Plague Venice" in the finals of the game not only the main winner is announced, but also the teams that have distinguished themselves in various nominations. To summarize it is very convenient to use the function MAX, which calculates the maximum number in the range. The moderator does not need to do anything extra - just read the names of the winning teams from the screen.
