Monday, February 27, 2012

pyBotWar: State of the Code

Tomorrow we are moving into the final hackfest for this class. Before the hackfest I want to outline what we've gotten done so far and what I think we can get done before the project is due.

What We Have
  • Working back end code pushing to a memcache
  • Working client reading memcache and properly drawing all elements of the game.
  • Updated graphics for all the bots
What We Need to Have
  • Facebook authentication
  • User uploaded bots
  • Restricted python
  • Starting a game with friends' bots 
Would be Nice
  • Better selection of starting bots
  • Different weapons/ body types
  • Multiple arenas
  • Game playback
  • Communication protocol
    • hacking other bots (mwuhahaha)
At this point I feel comfortable saying we will have a finished, polished product. The remaining necessary features are fairly low hanging fruit. Given the amount of time we are planning on spending  hacking tomorrow I don't think we'll have any problems getting this done.
That means we get to spend most of the hackfest adding cool new features. I'm really excited to implement some new weapons and bodies. Also, I love the idea of hacking other bots through a communication protocol. You could have a bot that could just sit still and use all of it's processor power cracking the encryption of the other bots and telling them to attack each other.

Wednesday, February 15, 2012

PyBotWar

For the Open Source game design class we're going to try and make an online multiplayer version of the classic RoboCode game. We found a python port on google code http://code.google.com/p/pybotwar/ that we hope to put up on open shift. Robo Code is a game where you actually program a robot that fights other robots in an arena. The robots rely solely on the code you right as you cannot control them once the match starts. Our goals for the project are as follows:

Required:
  • Refactor the graphics stack to support a javascript client. Adding json communication between the server and client.
  • Upgrade existing sprites and graphics assets
  • Prevent users from calling dangerous python packages in their robots
  • Facebook authentication
Optional:
  • Add new arenas beyond the basic square one
  • Add additional weapon
  • Add different sensors
Pie in the Sky:
  • Communication protocol for teams of robots
  • Ability to hack opposing robot's using communication protocol
    • stack overflow, false commands, etc.
  • RPG elements including leveling up and earning new weapons or stats
At the moment we're still focusing on reverse engineering the graphics stack. We'll then implement a function that exposes the current state of the world using json. From there we simply need to write javascript to draw the game state.

Once our core goals are complete, we'll hopefully have time to focus on adding fun things like new weapons and body types. These would add value to the game play without requiring much time. If we get to this stage of development we should be able to produce several new options.

Friday, February 10, 2012

AJAXING It up!

I learned about ajax this week in class. I knew about it in the past but I haven't had much experience implementing it. Seems like a really good way to send and receive data quickly.

The basics of AJAX is that you create a function that will serve json whenever it is called. This function is tied into a URL that can be called with optional parameters. Then you can have another program, be it a web client or desktop software send a request to this URL. The program then receives back json formatted information it can use.

I will be using AJAX to implement my final project for class. I'll be able to run the python pyBotWar program on a server with a modified AJAX function that sends out the state of the game. The client can then ping this function periodically to get information about robot position, angle, health, etc. and draw the state.

Tuesday, January 31, 2012

Hola Mundo Turbo Gears

Today in the open source game design class we boot strapped for Turbo Gears. This, combined with open shift will allow us to quickly get web apps online and running.

Open shift works by tying it to a Git repository on your computer. When you push the repo to open shift it automatically turns off the Turbo Gears instance running on the cloud, applies the changes you've pushed, and then restarts the server.

This is incredibly useful for small applications when you don't want to spend a lot of time trying to set up your own server. Updating the server is as simple as git commit && git push openshift.

We'll be using this system to launch our app for the final project.

Sunday, December 11, 2011

My first bug fix!

So I just pushed a bug fix to the Tweepy library. I found a bug here: https://github.com/tweepy/tweepy/issues/41 that seemed like low hanging fruit. The loop that was reading information from the server response was very naive and basically assumed there would be no problems. I changed it to check the server status before each loop. This should solve the problem.

Pull Request: https://github.com/tweepy/tweepy/pull/139

Diff: https://github.com/tjr1351/tweepy/commit/d459ab929b18409534f15920e32ff35d0adc36f7

Although the change itself is not huge, I had to do a bit of research to figure out how to get the server status and then what status numbers to look for.

Node.js for gaming

So I'm taking a class now that is focused on open source social/ casual games. We're focusing on creating games with javascript and html5. Because of this I've decided to use Node.js to help write my game.

Node.js is a server architecture written in Javascript that allows for very easy, fast web applications. One of the huge benefits of Node.js is it's callback structure. It wraps a lot of costly, slow operations such as file system calls and database queries in a callback that does not block. Also, everything is run on a single process so, unlike other server architectures, it's very easy to see what users are online and pass information between them or two certain groups. Both of these features make it very easy to create multiplayer games.

I recently found an awesome blog post by Daniel Baulig showing how to link a Node.js server to a libary called Socket.io. Linking the two libraries to the same session ID allows you to now send dynamic messages to the client using a socket FROM your server. Normally with no configuration these two libraries run independently and cannot be called from within one another.

I'm still not sure what I want to do for my game but I'm leaning towards some sort of MMO turned based strategy game. Maybe one where it queries popular open source websites for your user name and gives your character bonuses based on your open source contributions.

Here's some other good Node.js references:
Express.js
Socket.io
nodetuts.com

Wednesday, August 10, 2011

POSSE Hackfest '11

I'm currently hanging out with the Foss Box and some professors from various local schools. We're trying to teach them about all things open source. I've been playing with Open Video Chat again to see if it works on the newest Sugar build. Sugar 0.92.2 is now running on Fedora 14. Hopefully this means it either has the version of Telepathy we need or we can install it. I was able to get OVC running on two XO's and connected them. When it tried to connect the pipes I got an error though. Seems to be a break at a file open :/ I'll have to look at this more.

Side Note: The XO's automagically start an adhoc network and connect to eachother again! WOOOOO!