Search Unity

Rapid Sheet Data (Google sheets to JSON / C#)

Discussion in 'Assets and Asset Store' started by v0id, Sep 30, 2017.

  1. v0id

    v0id

    Joined:
    Feb 24, 2012
    Posts:
    1
    Rapid Sheet Data allows you to pull game data and content from private Google sheets to C# classes in editor and in runtime using only WWW calls. It is comprised of a web service written in Node.js and a Unity3D library.

    Why
    I developed something similar in work for a couple of projects we worked on and we found it extremely useful during prototyping and balancing, since it allowed us to quickly iterate without the need to create new builds.

    Back in March I was looking for something similar in the asset store (service / client architecture), for a side project I'm working on, and most of the assets I could find (with the exception of one or two if I remember correctly) would either rely on client side libraries, would only work on public sheets or just wouldn’t work in runtime.

    Since I also wanted to play around with Node.js at the time, I decided to write my own. I spend a few months refactoring the code and writing some documentation and here it is...

    Features
    • Web service, written in Node.js, to get data from private Google sheets, only using WWW calls from the Unity side
    • Support for basic C# types and list of types (bool, int, float, string, enum) with JIT and AOT platform support
    • Unity3D asset (Rapid Sheet Data Asset) created from the standard Unity's create menu, that can be easily configured in the inspector and can store a version of the data
    • Simple interface to query the data either using a unique ID specified in the Google sheet or by index
    • Interface to pull data from Google sheets in runtime, reducing the need to rebuild the game when tweaking values

    Get the source
    Node.js web service: https://github.com/dotv0id/RapidSheetData_service
    Unity3D library: https://github.com/dotv0id/RapidSheetData_library

    Documentation
    http://www.voidinspace.com/rapid-sheet-data/

    Deploying the Node.js service might be a bit of a pain for some people, so if you cannot or don't want to deploy your own service feel free to use the one I've got deployed in Heroku. To do so:

    Share your Google sheets with: rsd-agent@rsd-service.iam.gserviceaccount.com
    Add the service URL to the Rapid Sheet Data asset: https://rapid-sheet-data-service.herokuapp.com/

    I cannot guarantee that the service I’ve got deployed in Heroku will be fast enough for every use case, as it is running on a free dyno with limited resources, but feel free to try it before deploying your own service.

    Future work
    A few things I’m working on for the next version:
    • Create a Google sheet using a C# class as a blueprint from the inspector
    • Create a C# class using a Google sheet as a blueprint from the inspector
    • Playmaker support
    • SSL support for communication between the service and the client

    Let me know of any bugs, suggestions, or features you would like to see.

    Hope you find it equally useful!
     
    vvander and unity_IKo9TUH8FVFrSw like this.
  2. unity_IKo9TUH8FVFrSw

    unity_IKo9TUH8FVFrSw

    Joined:
    Dec 13, 2018
    Posts:
    1
    Hello! RSD is a very useful tool for working in unity, thanks for the work done. But I ran into one problem with the local server. I needed to change the file "secret.json", And after that, when I try to get the data, I get the message "Error loading client secret file: Error: ENOENT: no such file or directory". I checked the file name in rsdModule.js, everything is written correctly. I'm not sure, but maybe this error is related to google-auth-library. If you can advise how to solve this problem, you will help me greatly.
     
  3. Sir-Keyzinburga

    Sir-Keyzinburga

    Joined:
    Aug 8, 2011
    Posts:
    11
    Hi @v0id,
    I know it has been a while since you posted this.
    I stumbled on this plugin a while ago and finally got around to configuring it.

    After setting up the required dataobjects and such I tried pulling the data (of course I tried it first with the given example, which went fine; I also tested it with a small sheet of my own, which also succeeded)

    However after I configured my sheet a bit, it stopped working.

    I think it may have something to do with my removal of unused rows and columns.
    Now the cached json has a value such as
    {"Food!A1:E7":[{"id":"0","name":"Berry Cookie","cost":"25"},{"id":"1","name":"Berry Salad","cost":"40"},{"id":"2","name":"Berry Tart","cost":"70"},{"id":"3","name":"Berry Crème","cost":"100"},{"id":"4","name":"Supreme Berry Cake","cost":"280"}]}


    After some digging I found that this means that the Json does not get converted to the cached objects. Because the SheetName does not match the entryName in the Json Format.

    I could change the Deserializer to ignore everything after the '!' (basically splitting the string it is trying to compare)
    Though I thought, maybe you have a better solution, you know, as it's original creator?
     
  4. RaiderX84

    RaiderX84

    Joined:
    May 14, 2022
    Posts:
    1
    Just a quick question, and I know this is old but I picked it up today, where can I find the web service URL that needs to be imputed above the spreadsheet ID on the RSD asset in the editor?