Posts Tagged ‘community edition’

Script Support in Firebase

Wednesday, March 10th, 2010 by larsan

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!

Wednesday, February 10th, 2010 by larsan

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 CE – What’s next?

Tuesday, January 26th, 2010 by larsan

So, we’ve released Firebase Community Edition. Now there’s a Java game server which is open source and available to be used. Now what?

Well, here’s what! There’s a couple of things we’d like to get out of the door immediately and some of them will start appearing soon indeed:

  • Script support: Java 6 has build in support for JavaScript and can be extended to support a rather large list of script engines. We’d like to add support for writing your game using any of these script languages. We’d love to see the first Ruby+Flash game out there!
  • IDE support: We already have proto code for some Eclipse plugins lying about, and these should be polished up and released. Of course, you can always use our Maven archetypes and plugins, and then import into Eclipse, but direct support would be nice too. Of course, if anyone want to use NetBeans weed have to figure out something for you to eh?
  • Documentation: It’s sparse at the moment and needs to be fleshed out. We hope you’d like to help us here by simply telling us what is missing and asking us about all those things weäve forgotten to write down. Or indeed wasn’t explained properly.
  • IoC support: This is a biggy. Again we have proto code for for Guice lying about which needs to be fixed and published, but obviously we need to add direct support for Spring as well. Actually, you can write your components in Guice now but you’d have to wire it together yourself. Spring needs to be tested, so let us get back to you on that, ok?

And that’s what we want to do the immediate future. Watch this space, this is going to be fun!

FCE: The Upgrade Path

Monday, December 7th, 2009 by larsan

So if you write your game with Firebase Community Edition (FCE), what happends then? After all, writing a nice game and getting players is only the first step on the journey. Well, basically this is what we’re thinking (and the information here should be taken with a pinch of salt, we’re still thinking).

If  you have a sucessfull game on FCE but don’t wan’t to share your source code? There’ll be a Firebase Standard Edition (FSE), identical to the FCE with the exception of a proprietary license.

How about scalability? Well, if you want to, you can sticky-balance sessions across multiple single instances, so in theory you can scale both FCE and FSE, but if you want scalability and high availability included, you can upgrade to the Firebase Enterprise Edition which gives you the entire package.

  • FCE -> (success, a couple of thousand players, limited budget) -> FSE
  • FCE -> (success, a lot of players, in need of scalability) -> FEE
  • FSE -> (success, needs HA and scalability) -> FEE

In terms of support, there’ll be an entire range of options, starting from the Basic Support which will offer a ticketing system for bugs, API and maintenance questions, all the way up to Enterprise Support with full telephone support, dedicated personnel, dedicated development branch and customizes hot-patches etc. But I’ll go through those in a separate post. Stay tuned!

Firebase Community Edition

Thursday, December 3rd, 2009 by larsan

So what can you expect from the 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!