Rotates.org

March 12, 2011 - Merry Christmas, happy new year and so on

First of all, apologies for not updating in yonks – I could give you the usual programmer excuses about real life, work and so on but you’ve heard them all before, so I’ll dive right in to what I’ve been doing:

Archaos is very, very slowly moving along – we’re talking geologically slow here, but nonetheless there’s still a roadmap and there’s still progress on it. My aim now is to have a release before my 30th birthday (next year) and I’ll be damned if I don’t make it!

I’ve been experimenting with presentation and so on, and came up with a little thing tonight which I thought was quite cute.  I’m really feeling the love for CSS3 and HTML5 now.

WordPress has become my new powerhouse tool at work, and I’ve been churning out sites left, right and centre in this wonderful blog engine turned CMS (as of 3.1 especially so) – check out some of the following:

The last is our most recent project, and is very much not a site you’d expect to be WordPress powered – such is its flexibility!

I don’t update on Twitter much anymore, as it’s become a bit of a joke now with all of the celebrities and ridiculous trends; it pains me to say it but I think Twitter is more about Justin Bieber now than anything sensible. Alas, I spend most of my social networking time now on Facebook.

Finally, I’ve booked a flight to Arizona in September for a two week photography road trip with two of my good friends – should be awesome!

Anyway, hopefully that’s got everyone up to speed on what I’m doing – keep your eyes peeled in the coming months for updates on Archaos and other projects.

January 16, 2010 - Full cycle

The Archaos server now validates, processes and outputs a full turn of human interactions. This is a pretty major milestone in the development process, and I’m very happy with the results so far:

{
  "turn" : 1,
  "phase" : "move",
  "interaction" : "sequence",
  "finished" : true,
  "actions" : [
    {
      "type" : "move",
      "player" : "lewster32",
      "time" : 1263682234,
      "data" : {
        "piece" : "p0",
        "path" : [
          {
            "x" : 1,
            "y" : 7
          }
        ]
      }
    },
    {
      "type" : "end_turn",
      "player" : "lewster32",
      "time" : 1263682234
    },
    {
      "type" : "move",
      "player" : "bobster16",
      "time" : 1263682234,
      "data" : {
        "piece" : "p1",
        "path" : [
          {
            "x" : 13,
            "y" : 5
          }
        ]
      }
    },
    {
      "type" : "move",
      "player" : "bobster16",
      "time" : 1263682234,
      "data" : {
        "piece" : "p3",
        "path" : {
          "x" : 11,
          "y" : 4
        },
        "flying" : true
      }
    },
    {
      "type" : "end_turn",
      "player" : "bobster16",
      "time" : 1263682234
    }
  ]
}

I’d like to mention the huge amount of support, encouragement and fantastic resources provided by certain people of late. @andy_herbert has been a fantastic vocal advocate and provider of much inspiration and technical knowhow (he’s an utterly brilliant multi-talented programmer in his own right) and I owe an awful lot to his ‘cheery’ tone on Twitter! 😉

Secondly, I’d like to shout out a big hello to the Slashdot horde, who accosted the site a few days back. I got a hell of a lot of visits from these guys and I’m sure it’s helped spread the word about Archaos (even if that wasn’t actually my intention) and more importantly the Chaos scene in general!

Finally, a big thanks to @Zolyx for mentioning the project on his blog along with the other fantastic Chaos projects out there – muchos appreciated!

January 10, 2010 - nodelog IRC bot

As a little bit of an aside to ‘the main project’ , I’ve been getting more familiar with node.js by forking a nice simple IRC bot project on github. At the moment I’ve just got it logging in an mIRC compatible format, and added some missing features to the logging, but in the future I’m going to extend it into a proper modular IRC bot.

January 4, 2010 - Non techies avert your eyes

The server is really starting to take shape now. Turns and phases flow along nicely, and I’ve spent the last few days working on the spellcasting system. If you’ve read the Google Code page on Spells you’ll know that the spells themselves are simply sandboxed Javascript functions. I had thoughts before about writing some kind of scripting language for the spells because I wanted maximum flexibility, but it dawned on me that simply giving the spells access to the game and board data themselves in the native language would be the best way to do it. I also not long after that thought about making the validation step the spell goes through beforehand (i.e. where it tells you you can’t cast the spell here, or you can’t cast it on this piece or whatever) in a similar manner, but subsequently rejected it for one very good reason: the clients also need to validate at their end, and they may not be written in Javascript!

For those interested in creating a client (and because the code isn’t yet ready for viewing!) here’s the current output of a test run on the server. Note that games, pieces and spells have a unique game ID, which is a letter followed by an incrementing numeric value. One of the current things I’m working on is cleaning up the code so all possible references are made to these UIDs, and not directly to the objects, as this will make things safer and more manageable within the engine at the expense of a little bit of performance (no doubt I’ll rewrite much of this at a later date so there are two ‘levels’ of code; the UID data-driven level that the users interact with, and the deeper object-driven stuff that processes things.

{
  "turn" : 1,
  "phase" : "select_spell",
  "interaction" : "all",
  "finished" : true,
  "actions" : [
    {
      "type" : "select_spell",
      "player" : "lewster32",
      "time" : 1262563476,
      "data" : {
        "spell" : "s0"
      }
    },
    {
      "type" : "select_spell",
      "player" : "bobster16",
      "time" : 1262563476,
      "data" : {
        "spell" : "s6"
      }
    }
  ]
}
{
  "turn" : 1,
  "phase" : "cast",
  "interaction" : "sequence",
  "finished" : true,
  "actions" : [
    {
      "type" : "cast",
      "player" : "lewster32",
      "time" : 1262563476,
      "data" : {
        "spell" : "s0",
        "target" : {
          "x" : 0,
          "y" : 1
        }
      }
    },
    {
      "type" : "spawn",
      "player" : "lewster32",
      "time" : 1262563476,
      "data" : {
        "x" : 0,
        "y" : 1,
        "occupant" : {
          "uid" : "p2",
          "owner" : "lewster32",
          "properties" : {
            "movement" : 1,
            "combat" : 7,
            "defense" : 8,
            "maneuver" : 6,
            "resistance" : 4
          }
        }
      }
    },
    {
      "type" : "succeeded",
      "player" : "lewster32",
      "time" : 1262563476,
      "data" : {
        "spell" : "s0",
        "target" : {
          "x" : 0,
          "y" : 1
        }
      }
    },
    {
      "type" : "end_turn",
      "player" : "lewster32",
      "time" : 1262563476
    },
    {
      "type" : "cast",
      "player" : "bobster16",
      "time" : 1262563476,
      "data" : {
        "spell" : "s6",
        "target" : {
          "x" : 11,
          "y" : 1
        }
      }
    },
    {
      "type" : "spawn",
      "player" : "bobster16",
      "time" : 1262563476,
      "data" : {
        "x" : 11,
        "y" : 1,
        "occupant" : {
          "uid" : "p3",
          "owner" : "bobster16",
          "properties" : {
            "movement" : 1,
            "combat" : 6,
            "defense" : 5,
            "maneuver" : 2,
            "resistance" : 4
          }
        }
      }
    },
    {
      "type" : "succeeded",
      "player" : "bobster16",
      "time" : 1262563476,
      "data" : {
        "spell" : "s6",
        "target" : {
          "x" : 11,
          "y" : 1
        }
      }
    },
    {
      "type" : "end_turn",
      "player" : "bobster16",
      "time" : 1262563476
    }
  ]
}

These are what every player will receive at the end of each phase. They contain each action performed by the players in the order that they performed them, and timestamped for reference and backup purposes. Players have relatively limited access to the game in terms of actions, just like in the original game. A player may select spells, cast spells, move and attack pieces and end their turn. From these actions however, more actions may occur, so a player casting a spell on tile x will set off a chain of actions, where the server rolls against the spell’s chance, then (if successful) performs the spell’s effect, which may be to spawn a new piece or whatever.

Soon I’ll be locking down the format of these outputs, and documenting the errors and notices a user receives directly. This will allow for anyone wishing to do so to begin planning or working on a client – and I sincerely hope people do!