Posts Tagged ‘community edition’

Script Support in Firebase

Note: this post is cross-posted on Cubeia.com.

Now we have released a candidate for script support in Firebase! This is something we’re very excited about as it means no more Java (unless you want to of course, old hands like me aren’t likely to change in a hurry).This is a first release so there’s no support for tournaments or services yet. But is not far off.We’re using Java’s built in scripting support under the hood. It turned out to be not to trivial, but not very hard either. The interesting issues are likely to arrive when we start optimizing and bug hunting. And speaking of optimizing, I ran a few bots, say 50, against a very small script (basically the equivalent of a hello world) and on avarage the bots returned on 10 ms. That’s 10 ms for network latency, Firebase internals, and script evaluation for each event. Pretty damn good! Next step there will be to start optimizing depending on the script implementation, cashing compiled scripts, mutli-threading etc.One major up-shot of writing on a script language and re-evaluating the script for each event is the velocity: you don’t have to restart Firebase when you change code, the script is re-evaluated automatically. The round-trip time is cut dramatically!And… You want to see code? Here’ you are, this is the server part of the Hello World tutorial, written in…JavaScript:

function handleDataAction(action, table) {_log.debug('Entering handleDataAction');var data = _support.getActionDataAsUTF8(action);var playerId = action.getPlayerId();var outAction = _support.newGameDataAction(playerId, table);_support.setActionDataAsUTF8(outAction, data);table.getNotifier().notifyAllPlayers(outAction);_log.debug('Exiting handleDataAction');}

Ruby…

def handleDataAction(action, table)$_log.debug("Entering handleDataAction")data = $_support.getActionDataAsUTF8(action)playerId = action.getPlayerId()outAction = $_support.newGameDataAction(playerId, table)$_support.setActionDataAsUTF8(outAction, data)table.getNotifier().notifyAllPlayers(outAction)$_log.debug('Exiting handleDataAction')end

Python…

def handleDataAction(action, table):_log.debug("Entering handleDataAction")data = _support.getActionDataAsUTF8(action)playerId = action.getPlayerId()outAction = _support.newGameDataAction(playerId, table)_support.setActionDataAsUTF8(outAction, data)table.getNotifier().notifyAllPlayers(outAction)_log.debug('Exiting handleDataAction')

Groovy…

def handleDataAction(action, table) {_log.debug('Entering handleDataAction')data = _support.getActionDataAsUTF8(action)playerId = action.getPlayerId()outAction = _support.newGameDataAction(playerId, table)_support.setActionDataAsUTF8(outAction, data)table.getNotifier().notifyAllPlayers(outAction)_log.debug('Exiting handleDataAction')}

Cool, eh?You’ll notice some strange objects above. We bound some helper objects in the evaluation context, “_log” a Firebase Log4j logger, “_support” a tool for string to byte conversion etc, and some other helpful stuff.The JavaScript Hello World can be found here.And tentative documentation here. Have fun!

Write a multiplayer game in 10 minutes or less!

Note: this post is cross-posted on Cubeia.com.

As I was surfing along the other day it struck me that one of the coolest things about Firebase Community Edition is how incredibly fast you can get going. Do you think the title is a boast? Well, in a manner of speaking it is,  you see: we’re using Maven to build, and if you haven’t used Maven to build a Flex/Flash client before, Maven is going to start with downloading half of the Internet for you, and that will inevitably slow you down and may take a few minutes. But hear me! If you have used Maven before, and if you allow for the first time Maven will download the artifacts needed to compile the Firebase game and the Flex client, then I stand firm: you will have a Flex client and a Java server going in less than 10 minutes!Do you want to get started on a multiplayer game really, really fast? Here’s two different ways:

  • The Extreme Quick Start – This hard-core, and Maven only, quick start will have you up in less than 5 minutes (excluding Maven download times). It does not however, send actual game actions between the client and the server, all you can do is join/leave tables and chat with other players… Excuse me? All you can do?! It’s completely awesome if you ask me.
  • The Beloved Hello World – This tutorial can be done with Maven and optionally Flexbuilder. It will explain along the way what happens, and it will also replace the Firebase standard chat with game actions (also chat) showing you how to communicate properly between game server and client. 10 minutes? Well, if you’re impatient and a fast reader, or if you do it twice you will most certainly beat the 10 minute mark.

If you ask me, and I’m obviously biased, this is extremely cool. Of course, this isn’t actually a game yet and there’s a lot more to learn before launching your own international success on Firebase, but hell, you want to write a game? Hop right to it!Update: The commenting system seems to be behaving badly.  Even I can’t seem to comment at the moment. Please check the main blog for updates. I’ll be looking at switching blog system now…

Firebase Community Edition

Note: this post is cross-posted on Cubeia.com.

So what can you expect from the Firebase Community Edition (FCE)? Here’s a basic rundown:

  • It’ll be free and open source under the AGPL license. This means you can use, modify and even redistribute it to your hearts delight. However, you can’t change the copyright, nor the license itself. Also, there’s this viral GPL thing going on…
  • It’s limited to a single server. Sounds too restricted to you? Well, we’ve run thousands and thousands of players of single, rather cheap, servers so we’re not too concerned. Try it!
  • Performance! Basically FCE is an optimized single server version of the Enterprise Edition. While perhaps not your 1st choise for first person shooters, the FCE boasts a very low latency indeed. Not to mention the parallel event execution and the transparent transactions and so on.
  • Community support will be available. Forums, wikis etc.
  • There’s a clear upgrade path for you. Do you have a lot of players and you’re getting edgy about uptime? There’s the Enterprise Edition just waiting for you. Want more support? Sure. Scalability up to high heaven? Sure. Want a cherry on top? We’ll see what we can do…

I mean, seriously: The industry’s best and sexiest game server, for free?! It’ll be cool!

Return top