In our house in Broseley, Shropshire, we had a long room on the first floor, originally two smallish square rooms, since knocked together. We made it our study/workroom, with a couple of desks, a worktable, bookshelves, and the necessary electronica. There was a casement window in each end wall, and access was by a door midway one of the long walls.

One evening, going into the room to check everything was turned off for the night, I noticed an odd movement among the shadows, a bit of extra darkness that wouldn’t come into focus, a self-propelled fragment of night. A bat, a pipistrelle. It was late, I was tired and perhaps selfishly didn’t want the bother of dealing with it. I did not want to leave a window open all night, so left the bat to its own devices, shutting the door and thinking I would sort it out in the morning. I imagined walking into the room next day, finding the bat clinging to the wall or hanging from the ceiling, and coaxing it into a cardboard box to be released outside.

Of course, in the morning there was no sign of the bat. I guessed it was hidden, but still there. So about sunset I opened both windows, closed the door and left the bat to find its way out. I checked the room a couple of times without seeing anything, and on the third visit found the bat flying around the room at about chest height (my chest, that is). I wanted to make sure the bat got out, and didn’t want to get in its path, so sat down on the floor with my back to the door.

I soon noticed that the bat wasn’t simply “flying around the room”. It had established a pattern of crossing the room diagonally, in the longest straight path available, from one corner to its opposite. It would fly directly towards the corner, and at the last moment rose by perhaps twice its own length, which would have helped it slow, swiveled in a skew turn on its right wing, resumed its previous height and flew back across the room. Watching its progress back and forth was like following a game of tennis, played with a black rag doll.

It occurred to me that I could be in for a long night. I wanted to see the bat fly out of the window. I didn’t want to leave it, with the window open, not knowing whether it would depart or whether more bats might arrive. With the bat pursuing its relentless corner-to-corner flightpath, it would never find the window. I began talking to it: “Over there, look, there’s a big window!” I didn’t know what else I could do.

But then I saw that the bat’s trajectory had subtly shifted. It was no long flying corner to corner, but on a bearing of two or three centimetres offline, to the right of each corner. At first I thought it might have accidentally misjudged its “true” bearing, which it would return to. But it remained absolutely consistent, flying on its new track which took it a little closer to the open windows.

And then I began to see there was a gradual, steady, shift in its course. Each pass began and ended at a point fractionally further to the right. It was continually, microscopically, adjusting its bearing away from the corner and towards the window. If I waited long enough the bat would find its way out.

It was a long wait. The bat made no exploratory veer onto an entirely new track, but persisted in its minute compass adjustments on each lap of the room. It was aiming now at the recess of the wider window, and still went back and forth. Then it got to flying to the inside corner of the wooden window frame itself; the middle of the frame; to the point where it was aiming at the outside millimeter or two of the timber, and still it was registering an obstruction, flipping round and flying back down the room. Surely, this time? Next time? And then, at last, it flew its final lap of honour of the room, saw nothing in its path, went straight out through the window, and merged into the darkness.

Later, I drew a plan of the room, and plotted the bat’s course. I calculated that it had changed direction from start to end by approximately 10 degrees, over the course of perhaps 120 full traverses of the room; it was flying to an accuracy of one-twelfth of a degree. But what struck me more, the reason I wanted to write this, was that it suggested that bat navigation works in a way I had not anticipated: the endless fluttering and switching and swerving in the pursuit of insect prey, guided by echo-location, is something we all know about; the intelligent use of that information to modify behaviour in a steadfast, consistent, logical way, took me quite by surprise.