Main menu

Post navigation

Last time I left my preliminary game characters to move around the preliminary game world with their legs gliding across the ground and their arms sticking out like scarecrows’. My task since then has been to get them animated properly.

There’s a few different ways of handling animation in 3D. At the most basic level, if you want to make a character model appear to walk, you need to show the model with its arms and legs in different positions each frame to give the illusion of motion. So one method would be to just make a separate 3D model for each animation frame and show them in quick succession, one after another.

This is a pretty simple approach, but it has its drawbacks. Firstly, you’re going to have to make a lot of models! If you want a walking animation that runs at 30fps and is 2 seconds long, you need to edit and export 60 separate models, one for each frame. That’s a lot of work, and if you then want to make a walking animation for a second character, you need to do it all over again. Secondly, a lot of models means a lot of data, and in the case of a web-based game like mine a lot of data is bad news because it’s all got to be transferred over the internet whenever someone plays the game.

These drawbacks can be overcome by using skeletal animation instead. In this case you assign a skeleton (a hierarchy of straight line “bones”) to your character model, as well as a “skin” that describes how the character mesh deforms when the skeleton moves. Then you can create animations simply by determining the shape of the skeleton for each frame, and the model itself will automatically contort itself into the right shape. This means that you don’t need to store a complete new copy of the mesh for each frame, only the angles of each bone, which is a much smaller amount of data. Even better, as long as all your human models share the same skeleton structure, you can apply the same animations to all of them.

A skeleton “walking” in Blender:

Sorry, your browser does not support this video.

Despite the big advantages of skeletal animation, I hadn’t been planning to use it at first for this game, because it requires some slightly complicated calculations that JavaScript isn’t ideally suited to. But once I’d thought about it a bit I realised that realistically I would have to use it to keep the amount of data involved (and the amount of manual effort to create the animations) manageable, so I coded it up. It wasn’t as bad as I feared and the core code to deform a mesh based on a skeleton only came to about 100 lines of JavaScript in the end.

Even small bugs in the animation code can cause effects that surrealist artists would have loved

You can make animations using Blender’s “Pose Mode” and animation timeline, then save them to BVH (BioVision Hierarchy) files. I wrote (yup, you’ve guessed it) yet another converter tool to convert these into binary files for the game engine, as well as extending my previous Collada converter to include the skeleton and skin information from MakeHuman. MakeHuman has various built-in skeletons that you can add to your human. I use the CMU skeleton, partly because at 31 bones it’s the simplest one on offer, and partly because it works with some nice ready made animations that I’ll talk about in a bit.

Here’s a simple animation of a character’s head turning that I made in Blender. It probably won’t win me any awards, but it served its purpose of reminding me how to create animations:

Sorry, your browser does not support this video.

I didn’t, however, make that “walking skeleton” animation that I showed earlier. It came from a great animation resource, the Carnegie Mellon University Motion Capture Database. This contains a huge library of animations captured by filming real people with ping pong balls* attached to them performing various actions, and they’re free to use for any purpose. I will probably use some of these in the game, though they probably won’t have all the animations I need and I’ll still have to make some myself, so I’m a bit worried that the CMU ones will show up mine as being pretty rubbish! Still, we’ll get to that later.

Here’s one of my game characters walking with an animation from the CMU database:

Sorry, your browser does not support this video.

With the animation in place it suddenly starts to look much more like an actual game, though admittedly a pretty dull one at this point!

Next I think I’ll turn my attention to re-organising the code a bit so that it can better manage all the assets required for an actual game – not the most glamourous of tasks but it needs to be done and will be well worth it. Then I’ll probably switch back to working on the game world and add something more interesting than a bare landscape for the characters to explore! Hopefully talk to you again soon.

(In case anyone’s interested, the current JavaScript game code runs to 1,558 lines).

Last time I worked out a method of editing terrain using Blender, exporting it and then rendering it using JavaScript and WebGL. This time we’re going to add something a bit more interesting: namely a character!

Now, the characters in my game are going to be humans, and modelling 3D humans is not an easy thing to do unless you’re a pretty experienced 3D artist (which I’m not). Fortunately for me and others like me, there’s a great little free program called MakeHuman that does most of the difficult bits for you! In fact, I would go so far as to say that I probably wouldn’t be building this game at all if it wasn’t for MakeHuman, because I’d be worried about my character models looking so depressingly awful that they’d ruin the whole thing.

Making a male character in MakeHuman

MakeHuman is (to me, at least) one of those tools that’s so amazing that it’s almost difficult to believe it really exists. Basically, you start it up and you’re confronted with a 3D human model and a bunch of different controls (mostly sliders) that you can use to change various properties of the human. The sliders on the initial screen control very important properties that affect the shape of the entire human: here you can control gender (a continuum between male and female rather than a binary choice), age (from 1 to 90 years), height, weight, race (as a mix of African, Asian and Caucasian) and a handful of other things. But if you drill down into the other tabs, there are sliders to change just about every detail you can imagine (for example, there are 6 sliders just in the “Nose size” category, and there are also “Nose size detail” and “Nose features” categories!). The quality of the generated models is very good indeed.

As well as giving you a huge amount of control over the shape of your human model, MakeHuman also provides a wealth of other useful features. On the “Materials” tab you can assign skin and eye textures to the model, and there’s also a “Pose/Animate” tab that controls the character’s pose and allows you to add a skeleton for skeletal animation (more on that in a future post). And unless you’re exclusively making naked, hairless characters (not that there’d be anything wrong with that 😉 ), you’ll definitely want to visit the “Geometries” tab to add some hair and clothes to your model. If MakeHuman has a weakness it’s probably that the selection of hair, clothes and other accessories included is a bit barren, but you can make your own using Blender or download ones other people have made from the MakeHuman Community site, which has a much better selection.

Making a female character in MakeHuman

As you’ve probably guessed by now, I rather like MakeHuman! I’m only really scratching the surface of it here as this is supposed to be a blog about my game rather than about MakeHuman, but there’s plenty more information on the MakeHuman Community website and elsewhere online if you’re interested.

The licensing of MakeHuman is set up so that as long as you use an unmodified official build of the software and export using the built-in exporters, the resulting model is under the Creative Commons Zero licence, allowing you to do anything you want with it, even incorporate it into a commercial product. In order to get my character models out of MakeHuman and into my JavaScript game engine, I decided to use a similar approach to that used for the terrain last time: export to a standard file format and then write a converter program to convert to a compact binary format for the engine.

MakeHuman supports the same OBJ format that I used for exporting the terrain from Blender, but I didn’t use it this time; it doesn’t support all the features of MakeHuman and although this limitation wouldn’t be a problem right now, it will become a problem in the near future. Instead I used Collada, a complex XML-based format that captures a lot more information than OBJ does. Loading Collada files is a lot more involved than loading OBJ, but luckily I already had some C++ code from a previous project that was capable of extracting everything I needed. I modified this to write out the important data (at this point just the basic 3D mesh for the human body as well as accessories like the hair and clothes) to a binary file that I could load into my engine.

I also had to make quite a lot of changes to the engine at this point. When I wrote my last blog post, all it could do was display a single terrain mesh with a single texture mapped onto it. I rewrote the code to include a scene graph system, allowing multiple models to be placed in the 3D world in a hierarchical fashion, and also to support multiple textures. Then I wrote a loader for the models I converted from MakeHuman and added my human to the scene.

Male character in the game world

(The meshes exported from MakeHuman contain a lot of faces and are very detailed, in fact probably too detailed for my purposes. Fortunately it gives you the option of using a a less detailed but more rough looking “proxy” mesh in the place of the detailed mesh, so that’s what I’m doing for my characters, so that file sizes stay small and rendering isn’t too slow. However, the clothes and hair meshes are still very detailed so I suspect I will end up making my own so as not to bog the game down with too many polygons to deal with, as well as to make them look just how I want).

At this point (once I’d ironed out the inevitable bugs) I had a character in my game world, but all it could do was stand there. I wanted some movement, so I added code allowing me to move the human across the terrain using the keyboard, keeping the model at ground level at all times. I also added a very basic “floating camera” that would follow along behind the character. All of this (the models, the physics, the camera) is very preliminary and will need a lot of improvement in the future, but right now it’s quite cool to see the humans and the terrain working together in the game engine like this.

Female character in the game world

“But”, you might say, “Why are their arms sticking out like scarecrows’?”. If I’d been arsed to make a video rather than just post still screenshots, you would probably also comment on the fact that they’re sliding along the ground without their legs moving at all. Fear not! My very next step will be to add some animation to the characters. I was originally planning to have that done for this post but once I realised how much work it would be I decided to split it off, so stay tuned for that.

Last time I talked about the new game project I’m planning to start. I was feeling quite enthusiastic about it and I had a bit of time while I was away in the caravan, so I decided it was time to actually start doing stuff on it!

I won’t say too much about the actual concept of the game yet, and in fact it might still change a bit before it’s finished, but it’s going to be set in a 3D town that you can wander round. So one of the first things to do will be to get the bare bones of a game engine running that can display the 3D world using WebGL, and also get an editing pipeline working so that I can create and edit the environment.

For most of the 3D editing I’m planning to use Blender. It’s free, it’s very powerful, it has a great community, it runs on almost everything and I already know how to use it, so what’s not to like? At some point I might want a more customised editing experience, maybe either writing a plugin or two for Blender or adding an editing mode to the game engine itself, but for the moment vanilla Blender will do.

The first element of the environment that I’m going to focus on is the actual ground, since it’s (literally) the foundation on which everything else will be built. I could model the ground as a standard 3D mesh, but it would be more efficient to treat it as a special case: it’s basically a single plane but with variations in height and texture across it, so we can store it as a 2D array of height values, plus another 2D array of material indices. My plan for the ground was as follows:

Add the ground as a “grid” object in Blender, and model the height variations using Blender’s extensive array of modelling tools

Write a converter program in C++ to convert the OBJ file into a compact binary format containing the height values for each point and the material values for each square

Create a single texture image containing tiled textures for all the materials used

Write JavaScript code to parse the binary file and actually display the terrain!

(We could load and parse the OBJ file directly in JavaScript, but this would be significantly larger, and size matters when working in a browser environment, because every data file has to be downloaded over the internet when running the game).

Editing terrain in Blender

The terrain work went reasonably smoothly once I got started. Editing the heights as a Blender grid worked well, with the proportional editing tool being very useful. Writing the C++ converter tool didn’t take too long, and the binary terrain files it creates are about 10 times smaller than the original OBJ files exported from Blender, so it’s well worth doing the conversion.

Terrain rendered in WebGL

Writing a WebGL renderer for the terrain was a bit more involved. The main problem I ran into was an unexpected one: I could see dark lines appearing along the edges of the terrain “tiles” when they should have joined up with each other seamlessly. I eventually traced this to my decision to store all of the textures for the ground in a single image. This works fine for the most part, but I hadn’t foreseen that it would cause problems with the filtering used by WebGL to make the textures look smoother at different scales. This causes a slight blurring effect and when you have multiple textures side-by-side in a single image, it causes their edges to “bleed” into each other slightly.

I solved this by putting 4 copies of each texture into the image, in a 2×2 layout, and mapping the centre section onto the terrain, so that the blurred edges are never used. This reduces the amount of texture data that can be stored in a single image, but it’s still better than storing each texture in a separate image and having to waste time switching between them when rendering.

Now that it’s done I’m reasonably happy with how it looks. I was a bit worried that the height differences might distort the textures too much, but they actually don’t seem to. I do plan to add some additional texture images for variety, and it should also look a lot better once some of the other elements of the scene (buildings, roads, vegetation, etc.) are in place.

Another shot of the rendered terrain

The WebGL renderer is still in its very early stages; right now all it can do is render a single 3D terrain object with a plain sky blue background, illuminated by a single directional light source, and allow me to move the camera around for testing. Obviously it’ll need a lot of other stuff added to enable it to show everything else required for the game, as well as to make things look a bit nicer and run a bit faster – but we’ll get onto that next time.

(Incidentally, the texture images are all from textures.com, a great resource for anyone doing anything 3D related. You can get loads of textures of all sorts from there and they’re free to use for most purposes).

I’ve decided it’s time to start a new game project. I haven’t done one (well, not a proper one) in a few years but things now seem to be nudging me back in that direction.

A screenshot from the first full game I created. Yes, it’s a fan-made Dizzy game for the Spectrum.

Since the Union Canal Unlocked project finished a year or so ago, I’ve been working on a 3D project in my spare time, but I’ve become frustrated that it’s not really going anywhere, at least not very fast. I had very ambitious goals for it and maybe I’m just starting to realise how long it would realistically take for me to achieve them. I may go back to it at some point, but right now I’m getting tired of pouring time and effort into code that may not actually produce any interesting output for several months or even years.

At the same time, a few things have happened that reminded me how much I used to enjoy making games. I read through an old diary from the time when I was making my first one (well, the first one I actually finished), back in 1994, which seems impossibly long ago now. It brought back the feeling of achievement and progress I used to get from making another screen or another graphic. I’ve also recently played through a game that a friend made a few years ago, and another friend started studying game design just a few weeks ago. It feels like the right time to go back to it.

My second game, also for the Spectrum. This was going to have a ridiculously ambitious 56 levels but I only got around to making 6

Of course, it’s going to be challenging to find the time, especially with our new arrival in the household! But in a way that just makes me more determined to use my scarce time more effectively, on something that I’ll actually find rewarding, rather than trying to force myself to work on something I’ve lost interest in. Even if I only manage to do a little bit each week, I’ll get there eventually.

I have a rough plan for the new game, which will no doubt get refined and altered a lot once I get started on it. It’s going to be my first 3D game (except for a little joke one I made late last year), something I’ve shied away from in the past mainly due to the additional complexity of 3D asset creation, but after actually completing some 3D models in the last few years, I feel a bit more confident that I can do it, and I think it will fit my concept better.

My third game, this time a historical Scottish game for DOS PCs. I only finished one level of this one

I’ve decided to write it to run in a browser, using JavaScript and WebGL. This will have its pros and cons. On the plus side, it’s technology I already have quite a bit of experience of; the game will automatically work on pretty much every platform without much extra effort on my part; people won’t have to install it before playing it; and not using a ready-made game engine will give me freedom to do everything exactly the way I want (plus I find tinkering with the low level parts of the code quite fun!). On the minus side it likely won’t run as fast as it would have as a “native” app, though I don’t see this being a huge problem in practice as what I have in mind shouldn’t be too demanding; and building the engine from scratch will take quite a lot of work.

To begin with I’m just going to target computers rather than tablets and phones. The control system I have in mind will work with keyboards and mice but not so well with touchscreens. At some point later on I might add a touch control scheme since most of the rest of the code should work fine on touch devices.

“Return of the Etirites”, probably the best game I ever made. It’s basically a rip-off of Mystic Quest on the Gameboy

I’m intending to write a series of posts on here to chronicle my progress. Of course, it’s always a bit dangerous to commit to something like this publicly, but that’s part of my reason for wanting to do it… I hope it will encourage me to actually do some stuff and not just think about it! And it will give me something nice and constructive to write blog posts about, instead of Brexit 😉 . It might take me a while to get the first post up, because as anyone who’s used WebGL (or done any OpenGL coding without using the fixed pipeline) knows, it takes quite a lot of code to even display anything at all. But once the basics are done it should be possible to build on it incrementally and progress a bit more rapidly.

The news that the Linux kernel development project has adopted a new code of conduct has prompted a lot of comment. As someone who’s been a software developer for all my working life and who’s written about vaguely related stuff before, I thought I would stick my oar in as well, at least to address what I think are some widespread misconceptions.

First off, I’ll say a bit about myself and my own experience. I’ve been a software professional for 16 years. During that time I seem to have impressed a lot of the people I’ve worked with. I have more than once “rescued” projects that were previously thought to be doomed and turned them into success stories. Collaborators who have worked with me in the past have frequently requested to work with me specifically when they approach my organisation for further consultancy. Last year I was promoted to a fairly senior technical position, and also last year I did my first paid freelance project, receiving glowing praise from the client for the way I handled it.

I’m not saying this to brag. I’m normally a pretty modest person and believe me, talking about myself in those terms doesn’t come easily. I’m saying it because it’s going to be relevant to what I say next.

I’m also, by pretty much any definition, a snowflake. (That’s the term these days, isn’t it?). I don’t like confrontation and I tend to avoid it as much as I can. I find it hurtful being on the receiving end of harsh words or blunt criticism and I also tend to avoid situations where this is likely to happen. When it does happen I find I need to retreat and lick my wounds for a while before I feel ready to face the world again.

I didn’t choose to be this way, and if I’d been given the choice I wouldn’t have chosen it, because to be honest it’s pretty damned inconvenient. But it’s the way I am, the way I’ve always been for as long as I can remember. (Again, this may not seem relevant yet, but trust me, I’m bringing it up for a reason).

It’s maybe not surprising, then, that I’m broadly supportive of any initiative that tries to make software development a friendlier place. I don’t follow Linux kernel development closely enough to have a strong opinion on it, but some open source communities certainly have acquired reputations for being quite harsh and unpleasant working environments. This probably is a factor in my choosing not to contribute to them – although I have contributed a bit to open source in the past, these days if I want to code for fun I prefer to just tinker with my own solo projects and avoid all that potential drama and discomfort.

Not everyone agrees, of course, and sites like Slashdot are awash with comments about how this is a disaster, how it’s going to destroy software quality, and how it’s the beginning of the end of Linux now that the Social Justice Warriors have started to take over. I’m not going to attempt to address every point made, but I would like to pick up on a few common themes that jumped out at me from reading people’s reactions.

Fear of harsh criticism makes people deliver

The main justification put forward for keeping the status quo seems to be that people will up their game and produce better code if they’re afraid of being flamed or ridiculed. I don’t believe this works in practice, at least not for everyone.

I remember years ago when I was learning to drive, my first instructor started acting increasingly like a bully. When I made mistakes (as everyone does when they’re learning something new), he would shout at me, swear at me and taunt me by bringing up mistakes I’d made weeks before. But far from spurring me on to improve my driving, this just wound me up and made me stressed and flustered, causing me to make even more mistakes, in turn causing him to throw more abuse my way, and so on. It got so bad that I started to dread my driving lessons and when I was out in the car with him I lost all confidence and became terrified of making even the tiniest mistake.

After a few weeks I got fed up with this so I phoned the driving school and told them I wanted a different instructor, someone who would build up my confidence rather than destroy it. They assigned me to a great instructor, an experienced and patient older man who I got on very well with, and the contrast was dramatic. My driving improved straight away and I started to actually look forward to my lessons. Within a few weeks I was ready to take my test, which I passed on the first attempt. I always remember this experience when I hear someone express the opinion that abuse will make people perform better.

Of course, everyone responds differently to these situations. I knew someone who said he was glad his driving instructor shouted at him because, after all, it was potentially a life-or-death situation and this would help him to take it seriously. So I’m not saying everyone’s experience will be the same as mine, just pointing out that not everyone responds positively under that sort of pressure.

Furthermore, someone who goes to pieces in the face of abuse might still be perfectly capable in other circumstances. I was able to drive just fine once I got away from that first instructor, and since then I’ve driven all over the country, driven minibuses and towed caravans without incident.

People will use the code of conduct to blow grievances out of all proportion and seek attention

Personally, as someone who hates conflict and hates being the centre of attention, I can’t imagine anything I’d be less likely to do than go out of my way to draw attention and publicity to myself. If anything I think I’d more likely be far too reticent about seeking help if someone was violating a code of conduct, and I imagine it would be the same for most of the people who would actually benefit the most from the code.

That’s not to say everyone would be the same, of course. There might well be a vocal minority who would act in this way, but that shouldn’t stop us from trying to improve things for people who genuinely do need it. In any case, whether a given behaviour really constitutes gratuitous “attention seeking” or whether it’s out of proportion is very much a subjective judgement.

Emotionally fragile people have nothing to offer anyway

I hope my description above of my own working life has shown that we do have something to offer. I think this belief is due to confusion between “people who are good at software development” and “people who are good at being loud and obnoxious”. If you create a working environment so toxic that 70% of people can’t cope with it and leave, that doesn’t mean you’ve retained the 30% best developers, it means you’ve retained the 30% of people best equipped to thrive in an abusive environment. I see no reason to think there’s going to be much correlation there.

I think a similar argument can be made about the contentious “safe spaces” I’ve written about before. Many of their opponents argue that it’s healthier to be exposed to a diverse range of different points of view rather than living in a bubble. I completely agree, but I disagree about how best to achieve that. A complete free-for-all isn’t necessarily a reliable way to foster open debate – you can easily end up with a situation where the loudest, most abrasive people come to dominate and everyone else is reluctant to express a contrary opinion for fear of being abused and ridiculed. If you genuinely want (and I’m not convinced many of the detractors actually do want this) to hear as wide range a of opinions as possible, you need an environment where everyone feels comfortable expressing themselves.

Maybe if there were unlimited good software developers in the world you could make a case for only working with the emotionally hardy ones and avoiding the possible difficulties of dealing with us “snowflakes”. But there aren’t. In most places developers are highly in demand, so it makes no sense to dismiss people who might actually be able to make a valuable contribution.

It’s not up to us to accommodate your emotional frailties, it’s up to you to get over them

Of all the views expressed in these discussions, I think this is the one that irks me the most. It implies that anyone who reacts badly to harsh words and insults could easily “get over it” if they chose to do so, and that just doesn’t tally with my experience at all.

I’ve spent many decades trying to “get over” the problems I’ve had. I’ve spent a five figure sum of money on therapy. I’ve read more self help books than I care to remember and filled notebooks cover-to-cover with the exercises from them. I’ve forced myself into numerous situations that terrified me in the hope that they would be good for me. I’ve practised mindfulness, attended support groups, taken medication, taken up exercise, talked things over with friends and family, spent long hours in painful introspection. You name it, I’ve probably tried it.

And you know what? I’m a lot better than I was. At the start of the process I could barely even hold a conversation with someone unless I knew them well, and I certainly wouldn’t have been able to hold down a job. Now I function reasonably well most days, I do pretty well at work and I have a decent social life as well. But despite all this progress, I’m still pretty emotionally sensitive, and I still don’t cope well with insults and intimidation. Maybe I’ll get even better in the future (I certainly hope to and intend to), but I suspect I will always find that kind of situation unpleasant enough to want to avoid it when possible, even if I no longer find it as debilitating as I once did.

So it makes me pretty angry when people who don’t even know me assume that, because I still get upset more easily than most, I obviously just haven’t tried hard enough. It’s noticable that these people almost never mention how you should “get over it”. Some of them seem to just assume that if you keep putting yourself in the situation that upsets you then you’ll eventually adjust and be OK with it, but this has never worked particularly well for me – as with the driving lessons example I gave above, it typically just leads to me feeling more stressed and harassed.

Basically, I think this one is an example of the just-world fallacy. It’s uncomfortable to realise that some people might struggle with certain situations through no fault of their own and that there might not be any easy solution open to them. It raises all kinds of awkward questions about whether we should be making adjustments to help them and so on, not to mention the fear of “maybe this could happen to me too some day”. It’s much neater to pretend that those people must have done something to deserve their problems, or at the very least that they must be “choosing” to forego a perfectly good solution.

Whilst I do have a tiny bit of sympathy for some of the objections to the way things are going (I wouldn’t personally relish software development becoming yet another field where social skills and confidence are valued over actual technical ability, for example), overall I find it really hard to take most of the objectors seriously. They moan and whinge about what a disaster it would be to have to treat others with basic civility, then go on to accuse the other side of being over-sensitive and blowing things out of proportion. They heap disdain on people for having problems they never asked for and almost certainly don’t want, but fail to put forward any useful suggestions on how to deal with those problems.

I’ve been going through a rough patch again lately and I feel like I could easily end up losing sight of what’s important, as well as forgetting the progress I’ve already made. So, inspired by seeing a friend’s bucket list on Facebook, I decided to make one of my own.

I’ve included a lot of stuff that I have already achieved, but that’s deliberate, to remind me of how good the last few years have actually been and what I can do if I put my mind to it. Conversely the stuff that’s not yet ticked off is a little sparse right now, but I’m sure more stuff will come to mind to flesh it out with now that I’ve got this list.

So, without further ado, on with the things! They’re not in any particular order, I couldn’t be bothered sorting them by importance or anything, and in any case my idea of their relative importance probably changes with my mood. I also haven’t set myself an end date of a particular significant birthday like some people do; my next “significant” birthday is uncomfortably close already and so wouldn’t give me much time to make progress.

Have a child – due 09/2018!Climb the main hills of the PentlandsVisit ItalyGo to a ghost hunting nightPlay a pipe organLearn to speak GermanFinish writing my 3D softwareMake some 3D environments with my softwareGet weight down to 80kg (and keep it there)Learn Chilly Gonzales “Solo Piano II”Write a book

In my last post I talked about how I thought it should be OK to share more about your mental health issues on social media and that there should be less stigma attached to it. I’m starting to realise, though, that I haven’t really been practising what I preached, and maybe it would help if I did.

The truth is that so far, I’m not doing so well this year. Over the course of my adult life I’ve had a lot of years (the large majority in fact) in which I haven’t done well in this respect, but 2018 is a bit different in that it’s come after a run of comparatively good years. Up until about Christmas last year I really thought I was starting to get this under control, but now I don’t know anymore.

(I should preface this entry by saying that I’m not about to do anything daft and irreversible, so please don’t worry about that. I’ve been through far worse than this for far longer in the past and I’m still here, so I doubt this latest down period is going to finish me off).

I’m not entirely sure what has made the depression start to come back, though I have a few ideas of what might have contributed. Being ill three times already this year certainly hasn’t helped; I feel like I’ve spent half of January and February either suffering from the cold or flu, or trying to recover and catch up on everything, and by the time the third virus hit I was getting seriously fed up with living that way. I also feel I haven’t been doing enough in the way of socialising or fun stuff lately, which usually doesn’t help either.

But in truth, while those things obviously haven’t helped, I think the problems run much deeper. I’m starting to question whether the progress I thought I’d made since about 2012 is really progress, or at the very least whether it might be built on much shakier foundations than I thought.

You see, the only thing that was ever really effective in making my depression go away was to find activities that excited me and do as much of them as possible. These included taking up Scottish Country Dancing, going hostelling in Europe and, probably most of all, urban exploration (which for a time was such a large part of my life that I made a second blog completely dedicated to it). At the time, doing all this stuff felt amazing and I didn’t waste much time worrying that it might not be the right approach to solving my psychological problems. For the first time since 1997 I wasn’t feeling dragged down by depression at every turn, and that was more than good enough.

The best antidepressant I’ve found so far

The trouble with using excitement to combat depression, though, is that for it to keep working, you need to keep on doing exciting things, and that’s not always easy. Life intervenes and the time, energy and money required are not always plentiful. More than that, no matter how amazing any activity seems at first, the novelty just tends to wear off a bit after a while. Take the urban exploration, for example. The places I loved exploring the most were the disused urban tunnels… but there really aren’t that many of them in Scotland. Once you’ve explored Scotland Street, Botanic Gardens and a handful of others, you’re left with ones that are either far too difficult or risky to get into, are a huge anti-climax compared to what you’ve already explored, or both.

I’m now wondering whether all I really did for the last few years was try to outrun my real problems, but now they’re catching up with me and I don’t think I’ve got the strength to run any further. “What real problems?” you might ask, and that’s understandable. After all, I’ve got a good job, a happy marriage and a nice house, and I haven’t suffered horrific abuse on a par with what some people go through. What right do I have to feel so depressed?

Well, the biggest problem is a constant feeling of being out of place, disconnected, and different from other people. It’s bothered me pretty much my whole adult life, other than fading into the background a bit during the last few good years. I experience it with almost everyone (I think I can literally count the exceptions on one hand), almost all the time, and it can get intense enough to make me just not want to be around people anymore. And I really don’t have a clue what to do about it 🙁 .

Over the years I’ve already exhausted the obvious potential solutions. Most people seem to think (and I used to as well) that if I just pushed myself to be sociable despite my discomfort, I would then realise that actually there’s no reason for me to feel out of place and the feeling would go away. But unfortunately it doesn’t, not even when I spend quite a lot of time around people and get used to them.

The worst thing about this is that it becomes a sort of vicious circle. The more I keep myself apart from other people, the more I don’t just feel different from them, but actually am different. For example, whenever any group of people around my age socialise together, it seems to be only a matter of time before the conversation turns to reminiscing about the great times they had at uni or in their teens. I don’t have any great times from that part of my life to reminisce about (the depression and social awkwardness was at its worst back then) so it makes me feel utterly alienated and depressed. So then I avoid that group, I miss out on yet more life experiences, and I feel even more out of place in the next group.

(Don’t get me wrong. I’m not saying there’s anything wrong with them reminiscing about that stuff. It’s obviously enjoyable for them and I’m certainly not going to ask anyone to stop it for my benefit. I’m just observing that it inevitably puts up a barrier between me and everyone else, one that I haven’t yet found a way to get past).

I suppose, since the simple and practical solution failed, all that’s left is to dive into the murky waters of my emotional mind and try to work out what the hell’s gone wrong down there. I have tried this in the past (in fact I once calculated roughly how much I must have spent on private therapy sessions over the course of my life, and it was quite jaw-dropping), but I think for various reasons I shied away from doing it properly. There are certain upsetting facts about my life, and more generally about how the world works, that I didn’t feel ready to fully accept, but I probably need to accept them if I’m ever going to conquer this.

Do I feel ready now? Frankly, no, and I strongly doubt I ever will. But maybe realising that’s what I need to do is the first step.

This blog post by my brother is worth a read (in fact his whole blog is, but I’m going to focus on that particular post just now). In the second half he brings up things that I’ve thought about before, related to social media and mental health. He points out that making negative posts online when you’re struggling is sometimes frowned upon, and that people who do so are often labelled as attention seekers, something that I’ve observed as well.

I’ve always thought that the “attention seeking” accusation in particular is an odd one. Surely seeking attention is exactly what we’re trying to encourage depressed people to do when it gets too much to deal with on their own? There are any number of mental health awareness campaigns out there these days, and the core message of pretty much all of them is something along the lines of: don’t suffer in silence, don’t bottle up your feelings, reach out and talk to someone when you feel down. If we’re serious about that message (which we really should be), we’re going to have to accept that it will mean seeing things we might not be comfortable with on social media from time to time.

Some people seem to have a curiously black and white view of mental illness sufferers, as if we can be neatly divided into two groups: on one side the “moaners” who just complain incessantly about their problems and are never going to get any better, and on the other the more positive people who are bravely and quietly putting in the work required to get better. In my experience it doesn’t work like that at all. God knows I’ve done a lot of moaning in my time (mostly on specialist forums but occasionally on regular social media), but I’ve also put a lot of work into trying to get better, even at times when it felt completely hopeless.

Other people I know are the same; there is no great divide. The people who are moaning helplessly one day might be pouring their effort into recovery a few hours or days later when they feel a little better, and even the most dedicated positive thinker needs to vent from time to time. In fact, if anything I’d say the people I’ve known who never expressed their negative feelings are probably less likely to get better, because they seem to be less in touch with what’s going on in their heads and more likely to be in denial about their problems.

Maybe some people are fine with the idea of talking about mental health, but think that social media is the wrong forum, and that those sort of discussions should be kept for family and close friends and professional therapists. That’s all very well, but not everyone has those options. Some people’s families and friends aren’t sympathetic to these issues. Some people have no family or close friends. As for professional therapists, NHS waiting times for them are ridiculous and not everyone can afford to go private. Finally, some people (myself included) might simply find it easier to be open online than they do face-to-face.

The downsides to being too negative in public are often pointed out: you’ll drive people away, you’ll just wallow in your problems and become overwhelmed by negativity, you’ll regret revealing such personal stuff later on. What’s rarely brought up is that there are also significant downsides to not talking about it. The main one, in my experience, is that if you’re going through massive turmoil inside your head, it’s basically impossible to forge any kind of meaningful connection to another person if they don’t know about it.

When I was first suffering from social anxiety and depression, I followed the standard advice of trying to meet people at social events and meetup-type groups. I would dutifully go along to as many of those as I could, then try to pretend as best I could that I was a normal person and didn’t feel like I had a huge aching void inside me. To put it bluntly, it was a total waste of time. I hated every minute, I felt horrifically out of place, and I never succeeded in making a friend that way.

Things changed dramatically when I stopped trying to hide what I was going through and started actually opening up to people instead, regardless of how negative I must have been sounding. Within weeks I had made several good friends, some of whom I was still in touch with a decade later, and within months I had been… ahem… more than friends with a few people as well.

Sure, it’s a lot nicer if mental illness isn’t a huge part of your life, but sometimes it is. And when it is, the only successful way I’ve found of building a meaningful friendship or relationship is to share that part of you along with the rest. Of course given the choice it might have been nicer to base those relationships on something more positive, but at the time there was simply no other choice. All the more positive stuff seemed to pale into insignificance compared with what was going on in my head, and trying to interact with people based on it felt shallow and dishonest. It was a choice between revealing the negative stuff or not having any meaningful interactions with people at all.

(The other option, I guess, is to recover from the mental illness first and only then seek out friendships and relationships. Maybe that would work, though I’m not sure it ever would have for me. It’s a lot more difficult to overcome these sorts of problems when you feel completely alone, and it’s difficult to start feeling like you’re a valid, fully fledged member of the human race when you have no friends and no love life).

This has gone off at a bit of a tangent, but I think it still has relevance to the original point about social media. Basically, sharing how we’re feeling, whether in person or online, is a way of building connections with people, probably the only way of building genuine connections. When we make certain people feel like they can’t share their feelings, we’re excluding them from building those connections, quite likely at a time when they need that more than ever. Worse still, we are invalidating them and likely making them feel as if they shouldn’t even have those feelings, which can be surprisingly destructive. And I don’t think that’s a good thing.

I tried to write some thoughts on 2017 and 2018 in a Facebook status, but it was getting far too long for that so I decided to put it up here instead.

I’m looking forward to 2018 more than I’ve looked forward to most new years, but I think that’s more to do with my state of mind than with anything specific I’ve got planned, or any external circumstances. Over the past few weeks I’ve sorted out a long standing sleep problem (I hope… at the very least it’s a lot better now than it was) and it also feels as if I’ve made a lot of progress with my general mental state as well.

It’s weird… for years (well, decades to be honest) I felt like I was constantly struggling and struggling with it and getting almost nowhere, but recently I seem to have reached the point where it’s improving almost on its own without me having to do much at all. It’s strange but I like it. Of course a part of me is still worried that my mood’s going to crash again and I’ll be back to where it was, but I don’t know if that’s likely. Some of the realisations I’ve come to are things that I don’t think I could ever easily un-realise, so while there will no doubt be more ups and downs in the future, maybe I won’t ever be as down as I was before.

It’s been a good year in other ways, too. After feeling stuck in a bit of a rut with work for a while, 2017 brought me both my first ever promotion and my first paid freelance project, which have been great learning experiences and things I definitely want to build on. Doing the canal app has got me into the habit of working on projects in my spare time in a properly focused way and I’m trying to keep that up. In the past I’ve had lots of ideas but I’ve only worked on them sporadically, or I’ve tried to do too many things at once and failed to really get anywhere with any of them. So now I have picked one project that I want to focus on in 2018 and I’m trying to keep up the momentum on it. I don’t know where it will lead me, but that’s part of the fun.

As well as that, and some domestic things that I won’t bore you with the details of, there’s a few other things I want from 2018:

Do some fun stuff! If 2017 had a failing, it’s probably that I wasn’t as sociable as I could have been and didn’t spend a lot of time having fun. So this year I want to do Beltane again, go travelling again, and whatever else takes my fancy.

Stop stressing about politics so much. OK, I may not like what’s happening in the world right now, but there’s effectively nothing I can do about it, so there’s no point making myself feel worse by obsessing over it. That doesn’t mean I’ve stopped caring, or forgiven the people who caused this mess, just that I’ve realised I’m a happier and healthier person for not thinking about it so much. And if things do go badly wrong, I’ll have a much better chance of surviving it and helping the people I care about if I’m happy and healthy.

Get out of the city more often. Towards the end of 2017 I started to go walking in the Pentlands quite a lot, something I hadn’t done for a while. I definitely want to keep that up as much as possible, and maybe even get back to walking in the Highlands.

Lose some weight… but only if I can find a way to do it without feeling constantly hungry and miserable (like I did last time I tried).

Happy New Year to anyone who read to the end 🙂 . I hope 2018 will be good to you.

This post probably falls into the category of “cans of worms I probably shouldn’t open, but need to in order to stop them running round inside my head forever”. (Apologies for the horribly mixed metaphor there).

Not long ago I read an article about the shameful male suicide rate in the UK. I think the article was in the Guardian and I can’t find it now, but there are plenty of similar ones from the last couple of years, and they all make pretty grim reading: suicide is now the biggest killer of men under 45 in Britain, and the rate has been increasing. I don’t think it would be unreasonable to call this a crisis.

It’s not just a male problem, of course, but the suicide rate for men is around 3 times higher than it is for women. Intriguingly there doesn’t seem to be a correspondingly higher rate of mental illness in general in men, so naturally there’s been a lot of speculation about why that might be. Whilst I’m not of course claiming to speak for all men or to understand what all of them might be going through, I do feel that as a man who’s struggled with suicidal feelings quite a lot in the past, as well as spending a lot of time learning about mental health, I may at least be more qualified than most to stick my oar in.

The first thing that strikes me (and I’m aware I’m probably stating the obvious here) is that we have real problems with emotions in our culture. People aren’t just made to feel like they can’t express their emotions, which in itself would be bad enough; they’re often made to feel like they shouldn’t even have them at all.

You can see this attitude in almost any online debate, for example. Those raising concerns about how something might affect people’s emotional wellbeing are routinely ridiculed, dismissed as oversensitive snowflakes. Anyone who admits to experiencing negative emotions, no matter what their circumstances, is seen as weak and is brusquely informed that they just need to “grow up”, “man up”, “get over it”, “deal with it”, etc. (or worse), and that under no circumstances should they expect any help or support from others.

I can sort of see where this comes from, but for reasons I’ll go into shortly I think it’s a very flawed, irrational and destructive way of looking at the world. People defending this position are quick to point out that it wouldn’t be possible to have a world where no-one is ever upset by anything. Since everyone reacts differently to the world around them, we can only be directly responsible for our own words and actions, not for how other people might respond to them.

In this at least they are correct. It isn’t possible to engineer a society where no-one ever upsets anyone else, and attempting to do so would lead to serious problems, such as severe restrictions on freedom of expression. I also agree that it’s better if people have some measure of control over their emotions so that they don’t experience wild mood swings due to external factors they can’t control. But many commentators go much further than this, making various other assertions that don’t actually follow from that first one, and are in fact highly debatable. For example:

That there is no downside whatsoever to upsetting people, so we don’t need to bother considering other people’s feelings before deciding to speak or act.

That it’s possible and desirable for human beings to reach a state where they are no longer emotionally affected by other people’s words or actions.

That when someone claims something has had a negative effect on them emotionally, they’re not genuinely hurt, they’re just being a crybaby and seeking attention, or trying to manipulate others.

That people who are emotionally sensitive could quickly and easily become less sensitive any time they wanted, they just choose not to.

That people who are emotionally sensitive just don’t have enough life experience, and a good dose of cold, hard reality will make them toughen up.

That mental illness is some distant, mysterious, tragic thing that can’t be helped (or can only be helped by specialist treatment), and is not influenced at all by the way people treat each other in normal, day-to-day situations.

All six of these statements appear to be widely held beliefs, but I would dispute all of them. I suspect that many of the people espousing these beliefs are doing it because they want the world to work that way rather than because it actually does. I used to believe a lot of that stuff myself, back when I was badly depressed, and I used to think that attitude would help me get better, but as I described in my Safe Spaces post last year, it didn’t. It was a disaster. I think that’s why I feel so strongly about this… I hate to see vulnerable people being led down a path that might result in them experiencing years of needless misery, like I did.

“But”, I hear you say. “Isn’t your way just as bad, if not worse? Aren’t you just encouraging people to be self-indulgent, to wallow in self pity and demand that others walk on eggshells around them, instead of taking responsibility for their own lives?”.

No, I’m not. I’m encouraging people to face reality instead of denying it. In this case, the reality that human beings have emotions, that they’re an essential part of our existence, that we cannot live life to the full without them and that the things we do and say affect others whether we want them to or not. I know a lot of people are uncomfortable with emotions; they see them as troublesome, or childish, or mushy, or irrelevant, or effeminate, or whatever; but pretending they’re not there or pretending we don’t need them simply doesn’t work.

Whenever I think of someone trying to deny their emotions or bottle them up, I’m reminded of my old next door neighbour, whose solution to his water tank overflowing was to stuff plastic bags into the overflow pipe until the water stopped coming out. I never actually saw the end result of his endeavour since it would have played out inside his house, but I can’t imagine it ended well. Bottling up emotions tends to result in similarly bad consequences.

I think this is what a lot of people fail to understand. They present a false dichotomy between thoughts and feelings, with logical, rational, sensible thoughts on one side and hysterical, irrational, sentimental feelings on the other. They talk disparagingly about emotional people while seeing themselves as superior, rational beings driven by logical thoughts alone. But in reality, as Dr Jonice Webb puts it in Running on Empty (a brilliant book which I would totally recommend to anyone who’s struggling with their emotions, or even just finds this stuff interesting), the happiest and most successful people tend to be the ones who are comfortable with both their thoughts and their feelings, who have found a way to make both work in harmony, helping them towards achieving their goals rather than getting in the way.

I have read a lot of self help and psychology books over the years, some good and some bad, but Running on Empty puts forward one of the most helpful models for how emotions work and how to solve emotional problems that I have ever seen, and does it in a very clear and readable way. Here are some of the main points that I took away from it:

Human beings evolved as emotional creatures, and there’s no getting away from that. Our emotions will always be there and trying to get rid of them isn’t a healthy or useful goal.

Emotions are incredibly useful, indeed essential, for navigating the world. Every emotion is actually a signal trying to tell you something. Life works much better when you are able to listen to those signals and respond appropriately.

Emotions are important and every emotion you feel is valid and acceptable. There are no “bad” emotions, only bad actions.

Emotions that are expressed and out in the open are far less likely to cause problems, both for you and for those around you, than ones that are bottled up and denied.

Many people do not learn good strategies for dealing with their emotions during childhood, for various reasons. This can lead to a range of problems later on in life: depression, anxiety, feelings of emptiness or not fitting in, even suicidal feelings in some cases.

Being made to feel that your emotions don’t matter or that you somehow shouldn’t be feeling them can be particularly destructive.

These problems can be overcome in adulthood by learning how to deal with emotions effectively, as well as other related life skills. Contrary to popular belief it is not “too late” if you didn’t learn this as a child. However, it can be difficult and time consuming, and some people may need external help to be able to do it.

This, to me, is a far healthier, more constructive and balanced set of beliefs than the ones I listed several paragraphs back.

This post is getting much longer than I intended, so I’ll try and wrap it up now. Getting back to my original point, I believe that at least one reason for the high suicide rate is the hostility towards emotions that’s unfortunately often displayed in our culture – especially if you’ve had bad experiences in the past, it’s difficult to cling to the belief that your feelings are important and that you’re entitled to feel the way you do when you’re bombarded with the opposite message several times a day. And I think the reason males seem to be more at risk is the old macho stereotype that men are supposed to be strong and stoic and not show emotion (and especially not “negative” emotions like sadness and fear).

If I’m right, though, what’s the answer? I don’t know. But I do think it would be a good start to at least acknowledge that emotions are, and always will be, central to our lives, and that living in a culture that’s hostile to them does have adverse consequences.

And we need to stop letting those who would have us do the psychological equivalent of sealing a dripping overflow pipe with plastic bags get away with claiming they’re the sensible, rational ones.

Post navigation

"I think who [gcat] is, really, is a very caring and non-judgemental person... and a bit of a nerd. And for me, that word has no negative connotations whatsoever. He's not one of those trendy new nerds who are basically normal people who like superhero movies. He's a proper, old-school nerd who gets absolutely obsessed with the most obscure subjects, regardless of whether anyone else is into them or not".