Multiplayer Games using Google Sheets

Google Sheets For Multiplayer Prototyping

The most essential part of a multiplayer game is the ability for players to communicate with each other in some way. The simplest way to achieve this is for players to have shared access to a database that they both can read from and write to. When building multiplayer prototypes, it can be a hassle to setup a server and database and to then manage connections between players. What if there was a free database that existed somewhere and which players could perform operations on? Well, a database can simply be a table consisting of columns and rows; exactly the same as a spreadsheet. Google Sheets is a popular free online spreadsheet application which can be read from and written to via APIs.



The idea here is to use Google Sheets as our backend database for our multiplayer game prototypes. In order to do this, we need to be able to read and write to the sheets via Javascript. To read from the sheet, we can use a library called Sheetrock which allows us to quickly connect to a Google Sheet and query it using Google's Visualization Query Language. Writing to the sheet is a little bit trickier as it involves writing a script using the Google App Script scripting language. We can write a function to update specific rows in the sheet. This function is then invoked via an HTTP POST request and performs the update.



In order to structure things properly, each row in the sheet must be identified by a unique id. This id can then be used to retrieve and update information in the specific row. When a player sets up a multiplayer game, a new id is randomly generated and a row is added to the sheet with this id. The Google App Script returns the id that was generated and the player is presented with a URL which includes the id. The player can then send this URL to a friend to challenge him to a game. 

When the opponent browses to this URL, we can extract the game id from the query string and use it to read and write to the database. In order to detect changes to the database, the clients must poll the Google Sheet periodically. By interacting with the sheet in this way, the players can effectively play with each other. This type of setup lends itself well to turn-based multiplayer games.


Comments


  1. When you receive the video bingo bash completely free chips used, you could save yourself a good bit. More information on Free bingo bash chips on steemit.com.

    ReplyDelete
  2. I can’t imagine focusing long enough to research much less write this kind of article. You’ve outdone yourself with this material. This is great content 0and also found some interesting topic is Google Play Services the heartbeat of Android smartphone

    ReplyDelete
  3. Such a wonderful message with a good outlook. It was a pleasure to read it. It's simple to comprehend. And, as a gamer, I'd like to recommend a shader pack for Minecraft. You can get the BSL Shaders  set here, and I'm sure you'll enjoy it.

    ReplyDelete
  4. Game Pyong offers a unique blend of strategy and excitement. Similarly, the jodie whittaker leather jacket represents a bold style statement, showcasing confidence and individuality. Both reflect a sense of adventure whether in gameplay or fashion encouraging players and fans alike to embrace their unique identities and take on challenges with flair.

    ReplyDelete
  5. Google Sheets For Multiplayer Prototyping sounds intense! It’s crucial to navigate such challenges effectively, much like how a well-designed twitch emote designer can enhance viewer engagement during high-stakes moments. Both require clarity and focus, ensuring that every element contributes to the overall experience, whether it’s in a game or a critical life situation.

    ReplyDelete
  6. What a fascinating take on multiplayer gaming with Google Sheets! It’s incredible how such a simple tool can facilitate fun and engaging gameplay among friends, especially during times when in-person gatherings are limited. Speaking of community and shared experiences, just like how players collaborate in these games, the same sense of connection can be found in niche markets like the Online Vape Shop in UK.

    Whether you’re strategizing in a game or exploring the latest vape products, both activities bring people together in unique ways. It’s all about creating enjoyable moments—whether that's through friendly competition or discovering quality vape flavors. I’d love to hear more about creative ways to use Google Sheets for gaming and perhaps even some recommendations for vapes that can enhance the experience!

    ReplyDelete

Post a Comment

Popular posts from this blog

Caribbean Games - Part 1: All Fours

Caribbean Games - Part 2: Pitch