Thursday, May 13, 2010

Blackbox coding

I'm in the middle of a big project for work that is very geeky and fun. I'm having a blast coding it up.

Essentially I have a bunch of APIs that I have to integrate a game into each time one comes in.

As anyone who codes knows, this is a tricky proposition because it takes time to understand someone else's code. Once you understand the code then you have to start working the API hooks into it. Then you do your testing and get others to help test. Finally, you ship that version of the product and then do the next integration point for the same game (hook in another API for a different launch portal). Currently we have three portals to launch out of, but there will be another 3-5 over the course of the year. This puts me in the position of each game taking like a month to do. With 15 games looming, anyone can see that's not gonna happen quickly.

So I thought about it and decided to write a blackbox interface for all this junk that I can turn over to the game developer and allow them to do the integration themselves.

It looks something like this:



So the blackbox is essentially an interface. It has a list of all the available functions that the developer can code to. The developer doesn't have to worry about the Platform specific code. I do.

  • When the SWF is loaded, I set the distribution argument in the embed tags flashvars section, which tells the black box what platform to connect to.
  • The developer builds once on a generic platform, hand the code+build to me.
  • I create multiple .html files that have different distribution arguments, and then launch the game.
  • The blackbox handles the routing to the appropriate platform and the platform communicates with the appropriate server.
  • All the data that comes back into the game is identical regardless of the platform selection because the blackbox handles the translation.

I know that this isn't a novel idea at all, but it sure is freakin' fun to code! :D

2 comments:

  1. Nice to code, but be careful you don't code yourself out of a job.. That'd be a bad thing if you've automated it all to the point were your no longer required.

    Still though, it is pretty cool :D

    ReplyDelete
  2. Fortunately there are so many tasks that I do that this became a necessity so I can continue doing all the rest of the stuff.

    But in this industry there is no such thing as job security anyway. :) I'm just happy I'm getting to do geeky stuff.

    ReplyDelete