Saturday, 26 October 2013

Jekyll and Foundation with Guard

tl;dr - I've dropped the jekyll asset pipeline in favour of Guard in my pre-configured example project of Jekyll and Foundation.

A few weeks I wrote about my attempts to create a bootstrapped jekyll / foundation combination using the Jekyll asset pipeline to keep things building on the fly. I hit a snag, though. The asset pipeline was abandoned back in February and is locked to version 0.12 of Jekyll (current release being 1.2.1 at the time of writing). There are various forks of the project which bring things up to date but I'm worried about being left in the same position again and, frankly, I'm starting to question the methodology of using Jekyll to do everything instead of running the tools separately.

What I really want, I think, is some kind of meta-tool which lets me manage my build environment but by using the core tools - in my case Jekyll and Compass and probably a CoffeeScript processor eventually - so I (hopefully) have fewer maintenance problems down the line. Seems like Guard is pretty much what I want. I'm coupling it with guard-jekyll-plus and guard-compass to work with those tools. It isn't perfect, and doesn't assuage my dependency fears entirely but it feels a much more robust solution than the previous version.

My basic jekyll-foundation project has been changed to use this new tool chain and seems much more responsive than before (could be anecdotal) so I'm looking forward to making more use of it.


Monday, 30 September 2013

Jekyll and Foundation automatically recompiling changes

tl;dr - I've glued jekyll, jekyll pipeline and foundation into a pre-configured example project.

I look after a handful of small sites and I've been playing with different ways of maintaining them and keeping them vaguely modern. A CMS is the obvious way forward, but that has the learning curve problem and, frankly, after working away at this kind of thing all day I'd rather approach the problem a little differently.

What I really want is something which lets me write content in my markup language of choice, then generates some html for me and wraps it in a template. It should also handle some of the simpler optimization tasks (minifying, compressing, compiling any sass) and ideally allow some kind of on-the-fly regeneration of all these assets so I can work and hit refresh with it running in the background.

Jekyll seems like a good contender as a starting point. I love the fact it generates static HTML files for me (I'm getting tired of requiring the comparatively slow processing power of PHP for ultra-simple tasks) and it has a "watch" mode for recompiling the pages as I work. It uses the Liquid templating engine, which is sufficiently simple for my needs, and there is support for a variety of markup options.

Next, I need some sass support. This is easily done, but I want a simple workflow so it needs to recompile on the fly while jekyll watch is running. Step up the jekyll asset pipeline which lets me add whatever I like to the jekyll process with a minimum of fuss, including css compression and the sass compilation I wanted. I'm pretty sure I could add CoffeeScript support with it too, but I haven't tried that yet.

Right, I have the components I need. I'm going to work with Foundation 4 because it happens to be a framework I know relatively well. If only there was a vanilla project which pulled all this together ready so I could just fork it and start building a new site. Oh look.

In all seriousness, I've hammered these elements together into something that should be easy to just pick up and start using. I'm hoping it'll be useful to me and - this being the internet - chances are that means it'll be useful to someone else too. If that someone is you, enjoy this vanilla jekyll project with foundation sass built on the fly. Why not let me know?

Friday, 31 May 2013

An FPS but a bit more

I find the mechanics of Republic Commando interesting. On the face of it, it's a basic FPS which uses the Unreal 2 engine. You can carry 5 weapons plus melee attack and you fight waves of droids and flying bugs. Underneath that, however, it is something a bit different.

At the heart of what makes Commando different is the squad combat mechanic. Instead of the usual lone commando setup, you are one of four and you can give your AI buddies orders to help out. So far, so unremarkable (although at the time perhaps not - I can't recall offhand when squad control started becoming a regular thing). The really nice part is the way the squad control mechanics are worked into the game.

Firstly, it is not a gimmick - rather it is a tool that is incredibly useful to progress. In a game such as Mass Effect 2 you can quite happily ignore your squad and they will do their own thing while you blast your way through the encounters, however attempting to do this in Commando this will likely result in a quick and messy death. On several occasions during my playthrough I blundered into a firefight and had my team slaughtered however on restarting the section, playing thoughtfully and actually using the options available to me the exact same encounter became a breeze. This isn't because your mates are victims of stupid and in dire need of micromanagement (the AI of your team is well above average in fact) but because there is a very tangible benefit to using the squad order system and instructing them to switch to sniper mode or hold a section of cover or whatever. Having said that, the order system does remain a tool. You are rarely forced to command your fellows and you can, if you're feeling light on your feet, play Commando as a more traditional shooter. Importantly, there are also some really bad command options presented so mechanically issuing orders doesn't work which avoids the danger of it becoming a simple "I win" option.

So the issuing of orders is a noticeably useful option given to the player. However it doesn't feel like a mechanic to be exploited because of the second great thing about its implementation - it is part of the game world. The obvious point there is that your character is the squad leader so you are expected to be telling everyone what to do. More subtly is the way the game encourages you to think carefully about your options. In any decent sized firefight there will be a dozen positions your squad can take up so you need to not only use the mechanic but think in real terms about the way this will benefit you. Most of the time it's fairly obvious stuff - but only if you're thinking about covering fire, line of sight and so on and then you're thinking about real world options rather than clicking buttons which helps with the immersion.

Something else important about the design of the squad is the commando skillset. Although each one of your team mates has a distinct personality, in terms of ability they are entirely interchangeable. While that may sound simplistic it helps avoid making everything too obvious. You don't drop your sniper in the sniper spot simply because he's a sniper, for example. You can have intersecting fields of sniper fire if you want - you aren't restricted to just one guy with a rifle. You also don't have the problem of needing to blow something up and your demo guy is the one who decided to get his face shot off - someone else can step up to the task.

Linked to this is the way you can define your own role in the team. You have the same skills as your team mates which means every time you order someone to set a bomb or hack a terminal, you can do it instead if you prefer. In the middle of a firefight, you can order one of your chaps to get on with hacking while you shoot the enemies off him, however if you prefer you can instead put yourself in danger and order your team to give you covering fire. It may not sound like much, but this really makes you feel like part of a team instead of above it which does wonders for the oh-so-important immersion.

There are other clever design ideas - regenerating shields but collectible health so you can barely survive a firefight and limp into the next bit without being completely crippled springs to mind - however the squad control system is what makes Commando interesting. It manages not only to avoid being a gimmick, but also demonstrate how a cleverly applied gameplay mechanic can enhance atmosphere and immersion.

Saturday, 18 May 2013

Defending the Republic

I've been playing Star Wars: Republic Commando because sometimes you need to step back in to the past to remember a time when games weren't all about DRM arguments and chest high walls.

Before moving on, though, I have a confession to make: I am a huge Star Wars fan. Not the new Clone Wars nonsense, but the older stuff made before Lucas went completely mad and (particularly) the Expanded Universe. For those who haven't read any Star Wars novels, the EU is the place where (mostly) talented sci-fi authors were allowed to play in George Lucas's beautiful sand pit and contribute to a (mostly) curated timeline which spanned thousands of years of Republic history. The stories explored different aspects of the central characters of the original films, but also expanded on the lives of pretty much every being shown in the films and added hundreds more besides. It's in this tapestry of supporting characters that Star Wars really shines - the Jedi may be the knights errant of the universe, but there are a tiny number of them. The other characters bring them to life.

For anyone reading this in the future, this is why Star Wars used to be great before the Clone Wars retconned a ton of stuff and Disney made some new movies which undid the rest (these movies don't exist at the time of writing - my crystal ball is not optimistic).


Republic Commando, then. It's a game which focuses on the clone commandos of the Republic (no, really) in a series of engagements during the Clone Wars. It spawned a series of excellent novels by Karen Traviss and contains no lightsabers or Force powers. In fact, a Jedi only shows up once in a cut scene and he just gives some orders and leaves again. It really is very good.

Firstly, the game feels like Star Wars. The blasters make the proper noises, the vehicles move around ponderously, the architecture looks right and the music is spot on. Secondly, and more importantly, the central characters are plausible. The commandos do joke and banter while moving around but they are focused on the task at hand. Throughout, there is a sense that the plot is moving on because the main characters are driving it onwards through their ability to complete missions, rather than hanging on while events unfold around them.

Mechanically, the game is a fairly basic FPS with some squad mechanics built into it. The squad controls are very well streamlined and well worked into gameplay. Successfully commanding your troops makes a huge difference to the frantic firefights and there are just enough options to leave you feeling in  control, without becoming needlessly detailed and fiddly. The AI is pretty good too - you generally feel part of the squad, rather than the leader of a band of special needs troopers. Your team will heal themselves, pick each other up, take intelligent firing positions and sometimes even take point when exploring - and this is before you start giving them orders. It means you can often choose your role in an encounter. Want to stand back and shoot Separatists whilst your team go and set explosives? No problem. Want to set up a sniper crossfire while you run around in the open hacking terminals and taking fire? You can do that too, and your team mates will actually shoot enemies off you.

There are problems too, of course. The AI is good, but not great. There are moments when they run off the wrong way or melee the super battle droid you want to grenade. The contextual squad controls can sometimes be annoyingly fiddly to target. You non-squad allies are, to a man, completely useless and will usually catch a blaster bolt within a moment of appearing and some of the badguys are horribly unfair as they flit around, dodging your gunfire. All of these problems are ignorable because it's so Star Wars which, after sitting through Clone Wars cartoons and that horrible cgi film is so very nice.