Blog

Blog

Mash

Posted at 15:08 on 29 Jul 2010

I did my first ever talk at Guadec this year along with Damien and Chris. Thankfully there were no disasters apart from that I was pretty nervous and probably incomprehensible.

My part of the talk was about Mash which is a library for making ClutterActors out of 3D models. I forgot to give any links to where to get the code in the presentation however. I made the first release (0.1.0) before Guadec. It includes full gtk-doc and introspection support so it should be ready to play with if anybody wants to try it. It's quite likely that I'll change the API if I make another release though so please bear in mind that it's still a work in progress.

There is a wiki page with download links here.

I also demoed DFight which I've blogged about before and a ridiculous example game called Robot Pony. The source for robot pony is in a git repo here:

git clone git://git.busydoingnothing.co.uk/robot-pony.git

I probably also should have mentioned that the example code in the slides was using the semi-complete Ruby bindings. They are on the clutter-1.2 branch including bindings for Mash at:

git clone git://git.busydoingnothing.co.uk/rbclutter.git

I'm also trying to make an Ubuntu package for it. If I can get it working, it will be available from here

image

GUADEC

Posted at 10:39 on 24 Jun 2010

I'm
    attending GUADEC

I'm also taking part in a talk with Damien Lespiau and Chris Lord to talk about some fun things to do with Clutter. Damien will be talking about a cool project to render and animate SVGs with Clutter and Javascript, Chris will show how Clutter can be used to make games and if I don't collapse with stage fright I'll demonstrate ClutterPly which is a project to help render 3D models as ClutterActors.

Clutter Board Games

Posted at 17:58 on 30 May 2010

I'm a bit of a fan of playing board games. I'm also irresistibly drawn to somehow getting computers involved in all of my hobbies. Hence in my spare time I've been working on Clutter versions of two of my favourite games.

First up is a game which for some reason I've called DFight. The game is inspired by / stolen from a real board game called Khet. Khet is best described as ‘chess with lasers’ except it's probably a lot simpler and cooler than chess. In the real game there is a board with a real laser on either end. Each player has a number of pieces, some of which have mirrored surfaces. The idea is to move your pieces in such a way that your laser beam reflects off enough pieces to hit the ‘pharaoh’ of the opposing player.

image

For the Clutter version I thought it would be fun try and use 3D models of the board and pieces rather than a flat 2D interface that Clutter would traditionally be good at. This makes use of the CoglVertexBuffer API to create actors out of the models stored in PLY files exported from blender so that they can be animated with the usual Clutter mechanisms. The code for this ended up as the basis for the Clutter-PLY library. I won't talk about that library here though because in theory I'm going to give a talk about it at GUADEC.

The game is meant to be played over a LAN with each player on a separate computer. If all goes well, it should automagically discover any other users running DFight so that a second player would see the game in their list. It's also possible to play over the Internet but there is currently no UI to make this simple and instead you have to specify the IP address of the other player using a command line option.

The implementation knows nothing about the rules of the game but instead just gives you a virtual board to play on and assumes neither of you will try to cheat. Any player can drag pieces around at any time and the pieces are moved around live on the opponents screen.

Although the implementation is good enough to play a full game, it's still a bit rough-and-ready and there are plenty of improvements to make such as:

  • The models need a bit of love as you can't currently see which side of the pieces is reflective.
  • It'd be nice to be able to discover other players over the Internet. Perhaps GGZ could be leveraged for this?
  • It doesn't know the initial board layouts so you currently have to tediously re-layout the board manually before every game (although you could argue this makes it more authentic ;)

I haven't made an actual release yet, but the code is available to try in a git repo here:

git clone git://git.busydoingnothing.co.uk/dfight.git

The second game I've been working on is called Amagramanam. It is not entirely unlike a popular tile-based crossword-style word game that you've probably heard of. For this game I've also made use of Mx which is the Clutter-based widget set Intel has been working on for MeeGo. This version is not networked but instead is meant to be played against the computer AI.

image

The ‘AI’ is not really intelligent at all but instead just uses brute force to try every possible play and picks the one with the best score. However this makes the game impossibly difficult (at least for me) so it's also possible to limit the computer's vocabulary and cap the score by clicking on the computer icon.

The game includes a copy of the Webster's Second International dictionary which I believe is out-of-copyright. Of course it's much better to play with a real Scrabble word list but I'm not sure about the legality of distributing that. However it's fairly easy to find a list via the magic of Google and any text list can be used with the game.

This game is also missing a few features. In particular, it's not possible to pass or exchange tiles, there's no blanks and it doesn't tell you when someone has won. However it's close enough to play an interesting game.

The git repo is available at:

git clone git://git.busydoingnothing.co.uk/amagramanam.git

Frotz on IRC

Posted at 22:49 on 08 Apr 2010

image

For some reason I got the idea that it would be fun to play some text adventure games collaboratively over IRC. I also wanted to learn a bit about the IRC protocol so I ended up writing a little program that can proxy the input and output from a process into an IRC channel. It can be used with Frotz to connect up a Z-Machine file to IRC.

The program is meant to be general purpose so there are probably lots of other uses for it. For example you might want to relay the output of a log file to a channel. You could do this simply by setting the command to something like 'tail -f /var/log/messages'. The code is a glib-based C program and I've tried to make it reusable so that it has the beginnings of an IRC client library using the GMainLoop.

Frotz has a dumb terminal mode called dfrotz which is designed for this sort of thing. However I had to make some small changes to it to stop it from printing the prompt unless it is longer than two characters. Otherwise it would litter the output with '>' symbols at the beginning of messages. I've put the patch for my changes here.

The code for the program is available here:

git clone git://git.busydoingnothing.co.uk/irc-relay.git

Splinter as a Firefox extension

Posted at 13:21 on 23 Oct 2009

If you haven't noticed it on bugzilla.gnome.org already, Splinter is the nifty patch review system created by Owen Taylor. It allows you to view a patch as a side-by-side diff and insert comments directly inline with the code. The comments are stored as regular Bugzilla comments that are meant to be readable by both computers and humans.

The package is implemented entirely with client-side Javascript which does XML requests to Bugzilla using existing API. The only server-side code is a Bugzilla extension to add links inside bugs to start Splinter. As it is mostly client-side, I thought it would be fun to try packaging it as a Firefox extension so you can use it with any Bugzilla. The results are on a bug post here:

https://bugzilla.gnome.org/show_bug.cgi?id=599249

or you can install it directly from here:

http://www.busydoingnothing.co.uk/splinter.xpi

The extension works by packaging all of the Javascript and HTML from Splinter into a Chrome jar. There are some minor tweaks to the Javascript so that it doesn't depend on the Bugzilla URL being relative to the Splinter installation. There is also an overlay to insert 'Review' links next to attachments in pages which look like a Bugzilla installation.

I'm not sure whether it's entirely sensible to use it on a Bugzilla that doesn't have Splinter installed natively because it may confuse other people reading the bug report. However it does provide an easy way to play with Splinter for example on landfill.bugzilla.org and at least the reviews should be readable without Splinter.