Spherical forums

Creations => Game Development => Topic started by: N E O on March 25, 2013, 01:45:39 pm

Title: JS-based online database scripting with Firebase
Post by: N E O on March 25, 2013, 01:45:39 pm
I've been hearing good things about Firebase (https://www.firebase.com/) recently and while I signed up for the beta a while back and played around with it a bit I haven't been able to figure out a use for it related to the development that I do...UNTIL NOW.

So Firebase bills itself as "a scalable real-time backend for your app." What this means to us Sphere developers is that we theoretically can use pure JavaScript to interface with and update a real-time database. A high scores table? Done. Online multiplayer game that keeps track of everyone's everything? Easy. Chatroom? Real-time. Logging? Why not? Want to save arbitrary objects like an on-the-fly created spriteset? You can!

Maybe someone here more intrepid than myself can figure out a use for Firebase within their Sphere project that's not covered by the above short list. If someone here uses Firebase within a Sphere project let us know in this thread! It's free while in beta, has low rates after, AND apparently each month $20 in free credit is given.
Title: Re: Possible JS-based online database scripting
Post by: Radnen on March 25, 2013, 02:42:55 pm
Oh wow! That does look nice.
Title: Re: Possible JS-based online database scripting
Post by: N E O on March 30, 2013, 12:24:00 am
A completely JavaScript alternate solution that's basically "JSON as a database" : TaffyDB (http://www.taffydb.com/)
Title: Re: Possible JS-based online database scripting
Post by: Radnen on March 30, 2013, 02:27:11 am
I modified TaffyDB to be usable in Sphere, I even had to implement my own localStorage object, which basically wraps the Sphere file API.
Title: Re: Possible JS-based online database scripting
Post by: Jacob on April 15, 2013, 01:12:17 pm
I'll have to keep that in mind for the future. I've generally kept a non-funded approach to my games to allow for more flexible schedules and allow for the ability to avoid the need to shut down my projects, but that's not that bad in terms of pricing.
Title: Re: Possible JS-based online database scripting
Post by: DaVince on April 16, 2013, 09:39:00 am
Your post completely confused me until I realized you were replying to the original post, not the last reply... :P
Title: Re: JS-based online database scripting with Firebase
Post by: N E O on August 22, 2013, 07:50:29 pm
Bump! Firebase is now officially out of beta and has a free tier in its pricing chart:

Quote from: https://www.firebase.com/pricing.html

If you're an individual working on a side project or a business that is just getting started, you can use Firebase for free. A development Firebase is large enough for most individual projects and small business applications.

$0 / mo
5 GB Data Transfer
50 Max Connections
100 MB Data Storage


So! For $0, you can set up a Firebase account that you can theoretically hook into your Sphere project. This should take care of most of the basic uses for hooking up a server to a Sphere project, like a scoreboard, chat functionality, and basic online multiplayer (there used to be a multiplayer Asteroids example, now there's a multiplayer Tetris example (https://www.firebase.com/docs/examples.html)).

If no one here comes up with a sample Sphere project implementing Firebase I'll port the Tetris example to Sphere and put it up on Sphere's GitHub (probably in sphere-projects). I've already registered the "sphere" Firebase which you can use if you meet simple conditions which I'll document later and copied the Tetris example to http://www.spheredev.org/fbt.html (http://www.spheredev.org/fbt.html) which you can play right now (it's not Sphere JS, though).