Efficiency Factor

In my last post, I showed the results of FTP test measurement.  Here I’m trying to measure my Aerobic Efficiency.  To calculate this, I did a 10 minute warm-up (not shown), followed by a steady Z2 heart rate workout for 35 minutes.  For me, I should be around 145 to be in the middle of HR zone 2 on the bike – which I can figure out from the values measured in my FTP test.  It was harder than I expected to keep my heart rate constant, and I ended up with it a little low for the duration of the test – around 141 according the the data.  As before, I’m not used to pacing on the Wattbike, and I lost my concentration near the end – unintentionally speeding up a bit before correcting.  I’m also starting to get down on the drops as my arm flexibility improves, which does vary my output somewhat.  Next time I’ll know roughly the setting I should be shooting for, and be a little more disciplined!

Although 30 minutes should work for this test, I suspect an hour or so might give a more even set of data.  To make this test accurate, you simply need to keep your heart as steady as possible in whatever zone you’ve picked.  I wanted an ‘easy’ workout, so I chose Z2 for the test.

This time the dip in the graph is intentional, since I got up to open a window!  I also smoothed the graph to give a better view of what’s going on.  I guess it’s an issue that my workouts are typically done in a much warmer environment that I would be in outside.  But as long as this is consistent, it shouldn’t be a problem.

Firstly, as you can see from Training Peaks, you get great analysis data of your ride – much better than Strava.  The ‘EF‘ (Efficiency Factor) number is 1.18.  This is the ratio of Watts I generated to HR.  The idea here is that as I get more aerobically fit, the number should go up – since the watts I generate for a given HR during an aerobic workout should slowly rise – as long as I keep the HR at the same value each time.  The nice thing about this workout is that I can throw it in on any day when I don’t feel up to a harder interval session.  It will be interesting to see the number rise.  Additionally, if the number starts to level out, that means I need to do something to push myself to improve.

The second interesting thing here is commonly known as decoupling. Training Peaks display this as Pwr:Hr, and the number is ~8% in this case.  What this represents is the change in my heart rate vs wattage for the duration of the test.  It’s quite visible in the graph – you can see the pink wattage line diverging from the red line.  According to Joe Friel, this is a little high and represents ‘poor’ aerobic efficiency.  No surprise there, since I’ve been sat on my backside for most of this year.  But I don’t think it’s too bad, and I suspect it is a little skewed due to this being my first go at the test.  I like a number I know I can improve; since that’s the point of measuring this stuff…..

And for completeness, here are the other interesting values that Training Peaks gives you, among others:

IF – Intensity Factor – the % of my FTP during this workout.  Here, 75% of my FTP; around the intensity I would typically hope to do a Half Ironman bike at.

VI – Variability Index – the variability of my performance during the test (about 1% in this case – as it should be)

Power Balance – The ratio of left to right leg power.  Very close in my case, though I have noticed that during intense workouts my ‘right’ side tends to work a bit harder than my left.

W/Kg – The wattage I generated per Kg of body weight (not expected to be high, since this was a Z2 workout)

NP – Normalized Power – a better measure of Power based on the variable intensity of the ride (note that it is almost the same as average wattage in this case – as you’d expect for a steady ride).  If I’d climbed a few mountains you’d expect NP to be much greater than Average Power – giving a much better representation of the effort I put in.  I’m not sure why Strava choose a different version of this (theirs is ‘Average Weighted Power’, and seems consistently lower than NP).

EF Test
EF Test

Wattbike FTP

As I recover from a frozen shoulder I’ve been working on building up my fitness, primarily on the bike trainer.  It’s easier to pedal a bike than run or swim, and it’s the fastest way I know to get fit without risk of injury.  I’ve started doing my indoor sessions on a Wattbike.  This is a fantastic tool for getting real information about the power I’m generating in my legs.  The bike gives you separate right and left leg power, and you can compare the power generated to your heart rate, providing all sorts of insight into your fitness.  You can also see a graph of your pedal stroke, enabling you to work on improving your pedalling technique.

The first test I’ve done has been to measure my FTP (Functional Threshold Power).  This is the amount of power I would typically generate over the course of a 1 hour race, with nothing left on the table.  Knowing this number gives 2 things – I can use it to measure progress, and I can figure out my optimal training zones.

Since I wasn’t used to the Wattbike (it’s a much smoother ride, and the air resistance it very different to the turbo) it took me a couple of attempts to pace the test, but the end result seems about right.  My power is about 223 according to Strava.  At my peak, before injury, I was around 260.  I suspect the Wattbike is measuring higher than the estimates I got from Strava on the turbo, but  50 watts feels about right – I can believe that’s where I am at relative to the start of the year.   You might spot that this isn’t actually a full hour on the bike – it’s 30 minutes (after a warm-up which isn’t shown).  Joe Friel reckons in his ‘Power Meter Handbook‘ that a turbo session indoors is roughly equivalent to a 1 hour race outdoors – and if that means I only have to suffer through this gruelling test for 30 minutes, I’m in ;)  This is undoubtedly the toughest indoor ride I do – you need quite a bit of mental strength to hold on for the full duration – and I’m actually making it harder these days by going all out for a full 30 minutes.  You can see that nice steady climb in heart rate, right up to my max.  The Wattbike manual has alternative, less stressful ‘progress’ checking tests, which I will definitely try.

There’s a strange drop of speed on the graph; I didn’t actually stop – and the power/cadence values are constant, so hopefully that’s just a glitch.

The next test I want to do is a Zone 2 constant heart rate test, to get a baseline aerobic efficiency.  I’m also going to add a pedalling technique session to try to improve my power output over the whole pedal stroke.  Mostly, I’m going to continue with my program of interval sessions to build up my fitness/power as fast as I can.  My target is 300 watts by this time next year, in time for Ironman Barcelona….  I’ll post about future tests when I’ve done them.

FTP Test

Strava Data for FTP Test.

 

 

Boardz Sunsetting…

Please note that the Boardz Server will be decommissioned before the end of the year.  The financial reality is that the server costs far outstrip the sales.  An attempt to add in-app purchases didn’t help, and most players just reduced their active games so they didn’t have to pay the subscription.  On a personal note, I’ve been propping up the Boardz servers for the last 6 months, simply because it’s a piece of software close to my heart.  I’m sorry to see it go.

Boardz may be back one day, but for now it is not a supportable proposition, and I don’t have the time to work on new features & updates.  It’s been a fun ride!

Ironman UK 2013

I’m on the second lap of the bike course of Ironman UK 2013, and I’ve decided to stop.  It’s been a great day so far, but I’m pretty certain that I can’t make it to T2 in time.  My legs aren’t handling all the climbing, my lower back is very painful (a recurring injury brought on by lifting breeze blocks a few weeks before), and the weather is not being kind.  Stopping at the aid station located just before the beginning of lap three, I chat with the other cyclists in my position.  We console ourselves with the fact that the hills today have been relentless, and the picking up wind and worsening weather are not helping the situation.  Bolton Ironman has a reputation as being one of the harder Ironman courses, and now I understand why.  When I first signed up, a York Tri Club member sent me a message – ‘Bolton for your first Ironman – Kudos!’, but there’s no time to consider the foolishness of picking it as my first attempt at the long distance.  Checking my Garmin 910, I work out that I’m going to have to do the third lap more quickly than the second, in order to make the 10 hour 30 minute cut-off from the race start.  My fellow riders agree that it is a tall order and seem equally resigned about the outcome. It is slightly bemusing that so many riders I meet on the day don’t have hard data to figure out how they are doing; I couldn’t live without the GPS.

I decide to get to T2 so I can call my wife and meet up.  The only problem is the little voice in my head that’s responsible for me doing this race in the first place.  It’s saying ‘you can do this….’.  I leave my fellow cyclists to their fate, and decide to at least make the cut-off.  Next year, I’ll know I can do the first 2/3 of the race, I say to myself.

The weekend so far has been fantastic.  I’ve never seen such a well organised event.  With half of Bolton closed off, 1600 athletes getting ready for a race, and a complicated course involving transition areas and finish line all miles apart, I’m amazed things are going so well.  Stacey, my wife, has been a star – driving me to T1 to deposit my bike and blue transition bag, T2 to deposit my red transition bag, and the Reebock Stadium to watch the race briefing, eat some pasta, and shop for goodies.  I feel like a fraud buying an Ironman beer glass (I tell myself I’m going to celebrate with it later), but I whip out the credit card regardless.  I also pick up a beanie and the race shirt containing all the athlete’s names in tiny writing.  The pasta party is fun, and I enjoy the food despite the fact that I don’t eat much dairy these days.  Part of my transformation over the last couple of years from couch potato to triathlete has involved a major change to a mostly plant-based diet.  It’s enabled me to lose 3 stone and recover quickly enough to absorb the training that has got me here.  At the party, Greg Whyte is there to talk to the audience and give advice; he’s trying for Kona, but I hear later on that he didn’t manage it – despite a stonking first Ironman time of 11.49.  Greg is charismatic, and his advice is ‘race your own race’.  It is good advice which I take to heart, and repeat to myself throughout the course.  It helps keep me slow and relaxed on the swim (a miracle!), and stops me taking nutrition I haven’t had before – at least until the end of the bike, when I’m desperately looking for a quick fix and eat a ‘cookies and cream’ bar.  Yuck.

Although I make it to the lake with 90 minutes to spare, having already eaten an entire bar of dark chocolate and my homemade bread and avocado sandwich with almond butter, time just flows away.  Once I’ve checked the bike, put on my wetsuit and kissed Stacey goodbye, there are 30 minutes to go when I decide I have to go to the toilet.  I then spend the next 25 minutes queuing for the portaloos. In an otherwise faultlessly organised event, I’m surprised at the short supply, and my fellow athletes are  complaining loudly about the same thing, as they snake off in a long line around the toilets.  I’m told the queues on the other side of the transition area are even bigger.

With 2 minutes left I slide into the water, completely forgetting that I have a magic ‘Clif Shot Double Espresso Gel’ in my tri suit pocket – now trapped inside my wetsuit!  This being my third triathlon (I completed a Sprint at Allerthorpe in York a couple of months before this, and a half distance at Belvoir Castle a week before that), I knew what to expect.  It goes like this: Get into the water.  Start swimming.  Splutter.  Come up gasping for breath.  Try breaststroke.  Try freestyle again.  Repeat for about 30 minutes until I settle down and relax into my usually OK freestyle stroke.  Although usually a good swimmer, I’ve found that open water swimming in the cold closes up my lungs and gives me really bad asthma until I’ve warmed up.  For some reason the gods are smiling on me today though.  I glide into the water, set off on my swim and everything just works, as it normally would in the pool.  The sun comes up just as we set off, the water is warm, and the view is glorious.  I’m trying not to swallow water as I laugh with glee and for the first time ever, enjoy my open water swim.  I’m having so much fun, that I have to keep forcing myself to hold back and take it easy, and my biggest problem is getting past people, since I deliberately started right at the back, thinking that’s where I’d stay.  I even take a fist to my left goggle eye and a few kicks, but I don’t care.  Barber’s Adagio for Strings seems to be my ‘setting off on an adventure’ theme tune these days, and I hear it in my head as I thoroughly enjoy myself.  The Australian exit is no problem at all, and I calmly walk around it before dropping into the lake for the second lap.  I’m in no rush for the swim to end, and I’m almost sad to see the finish area.  The Strava data from my swim is below.  The official time of 1:20:46 puts me in 183 place of 337 in my age group, and a long way before the swim cut-off of 2:20.

It’s time for the bit I’ve been most worried about.  My aching back is going to suffer during this ride, and my nagging worries about not doing enough long bike rides due to the injury are at the front of my mind.  After almost 15 minutes of messing about in T1, I jump on the bike. I deliberately hold back on nutrition for 10 minutes into the ride, then take a caffeine energy gel – a tip I’d read beforehand from Chrissie Wellington about letting my stomach settle after the swim.  It does the trick, and for the first time I don’t feel sick during the ride.  A slight headache is probably due to the stress on my body, but I take an extra Salt Stick tablet to be safe.  The first lap goes OK – I feel good, reasonably strong, and enjoy the tapered feeling of no pain in my legs.  I tackle all the hills in the saddle, spinning in a high gear, and try to keep my heart rate down and stay in my endurance zone.  My wife has managed to find a pub on the route to sit outside, and she screams at me as I fly past – it’s a great lift to see her.  It isn’t until I work my way back to the start of the loop that I realise how far each circuit is, and how much my back is going to hurt.  Reluctantly I take an Ibuprofen – brought with me in case of emergency, since I hate taking medication.  Since I switched to a plant-based diet, I’ve had little need for drugs of any kind – I just don’t get sick any more, and I’ve always hated taking tablets.  The Ibuprofen works wonders though, and I thank the Gods.

Despite the relief, I find myself at the end of lap 2 with the realisation I’m in trouble.  As I set off on the 3rd lap, I become more determined to make it, even though I intend to stop.  Burning all my matches at once, I go round the last lap as fast as I can.  I never see any of the lads I chatted to at the aid station, and I pass several on the way round.  The last hour or so is brutal.  I’ve used whatever energy I had left, the wind is at its peak and the heavens have opened.  I’m like a drowned, crippled, exhausted rat as I fight through the last few hills.  At one point I look up to the sky and say ‘Really??!’.  It feels like a test, and I’m sure somebody has it in for me.  Becoming convinced that a finish-me-off puncture is surely on the way, I arrive at the darkest part of my day.  But there’s that voice again…. ‘You can do this’….

With 2 minutes to spare before the bike cut-off, I fly into transition and ask the guys how long I have to get out of T2.  I realise this is a stupid question because I’m not continuing, but there’s part of me that isn’t having any of that.   I am the last man standing in the whole race; nobody else makes it in time, and I only see one fellow who came in before me, who leaves the changing room as I sit and contemplate how to phone my wife.   The bike has taken me 8:47, and my age group rank has fallen to 274 – meaning that the remaining 63 people in my age group haven’t made it.  The Strava data below shows that I’ve climbed about 2100 meters during the bike.  With only 114 watts average power, it’s not my finest ride, but it is certainly the longest I’ve ever done by some 80 kilometers.

Perhaps because I’m on auto-pilot, it only hits me some time later, that I forgot to pick up my electrolytes and that emergency bar of chocolate when I set out on the run.  I do like what I find out about myself when I exercise for a long time; it’s a reason I do it, along with being fit and healthy for the sake of my family.  Today I find out that I’ve set off on the marathon with almost no conscious decision.  One minute,  I’m sat thinking about calling my wife, 10 minutes later I’m shuffling along the road at the very back of the race.  The marshal I pass calls out to me to tell me I’ve took a wrong turn, and ask if I’m in the race.  She’s been dozing, and probably decided that nobody else is coming.  I start doing maths in my head, trying to figure out how fast I have to move to finish the race.  I can barely stay standing, but combine walking with running and just try to keep moving.  The maths tells me there’s no chance in hell, but it’s hard to trust it because my head isn’t working right, and I can’t add 2 and 2 at this point.  Eventually I catch a guy called Jez, who’s in the 55-59 age group.  He tells me he’s done Ironman many times, and is doing the race this year despite 3 heart operations and the advice of his doctor.  We adopt a brisk walk for a while and chat about the race so far.  Jez assures me we will make it to the finish in time, and although I’m not sure if I believe him, it gives me hope and I plough on beside him.  We reach the end of the route along the Bolton canal, and enter the 3.5 loops of the circuit we have to do to finish.  Each loop is 10km, and we get a wrist band after each circuit.  When we have 3 we can take the alternative turn at the bottom of the hill in the center of Bolton to claim our medal.  This is pretty cruel because all around you are fellow competitors who have 1,2 or 3 wrist bands, and you know you have way more work to do before you’re in that position.  It takes more than an hour for me to get the first one, and even though I’ve covered a half marathon, I’m not convinced I can get to the end in time.  The run course follows a path down into the town, and I try to run these sections, then walk the up sections on the way back.  This works for a while, but I’m going painfully slow, and cramp has started to settle into my calves and shins.  Another cruelty  is the way you pass the announcer shouting ‘Competitor X, You are an Ironman!’, before turning around 3 times to run back up the hill.  Again, my wife Stacey is a life saver as she is waiting for me at the bottom of the hill with fresh supplies.  This is the only spot where your friends and family are allowed to offer assistance in the whole race.  She is screaming like crazy, and panicking that I won’t make it.  I assure her I will – “There’s nothing I can’t do”.  But I’m not sure I believe it.  At one point she passes me a panini and a coffee.  The taste of solid food and a hot drink is fantastic, but it doesn’t sit well on my stomach and I don’t finish it.  I share half of it with Jez, and this is the last time I see him, some time during lap 2.  At the beginning of lap 3 I’m in a lot of pain, but somehow I’m moving.  ‘Sod it’, I think, and discard my jacket when I pass Stacey.  I start to run up the hill, determined to make a good effort of the last lap.  At this point I realise I’m going to make it.  I have 90 minutes to complete 10km – a distance I can usually manage in less than 50 minutes.  Unfortunately my legs have other ideas and I feel two stabbing needle-like pains at the top of my left calf.  I’m not stupid – I can tell that I’m about to lose the ability to move forward, so I instantly stop and start walking again.  After a few minutes I give it another try, but the same pain arrives almost immediately.

I then discover that I can do a very narrow shuffle-run without too much pain, so I switch to that – it is marginally faster than walking.  As I come down the hill into town for the finish, my wife is screaming at me from the back of what looks like a garbage buggy – they’ve come to find me! The last few meters are heaven and the finish is truly special as Paul Kaye is stood on the red carpet screaming into the microphone – I can hear him building up the crowd for my arrival as I round the corner into town.  He comments that Stacey is louder than the massive crowd – ‘his wife is going bezerk!!’, and he’s right – I can hear her shouting over the top of all the cheering.  I’ve done it.  The run hasn’t been my finest moment, or perhaps it has, but it doesn’t matter any more.  I’ve achieved what I set out to do, and with only 10 minutes to spare – my official time is 16:52:05.  I am also last in my age group, and I think 3rd from the end, with Jez not far behind me.  In all the excitement and commotion I don’t get to see him after we finish, but my wife tells me he crosses the finish line.

My run data is below – it’s taken 6:09:30 to complete the marathon.

Easily one of the best days of my life, the Ironman was truly special.  I couldn’t have done it without all the support from my wife and family.  Crossing that finish line has been a year-long effort, with early morning runs, lunch time swims, and evening sessions on the turbo – not to mention long rides and runs at the weekend, and a knee operation for good measure!  I’m 3 stone lighter, and fitter than I’ve ever been.  It’s all good.

A History of Boardz, Part 3

This is the final part of my posts on the history of Boardz.  I’m going to talk about the artwork and the server.

Artwork

The artwork for Boardz was one of the most time consuming parts of the project.  I made the wrong decision early on that I wanted to do all the work myself, including the art.  I found a few pieces of free artwork on places like wikimedia commons, and bought some 3D models on TurboSquid, but the rest of the artwork was either drawn by myself, or generated on the fly procedurally.  My approach to a lot of this was pretty unusual I think, mainly because I was trying to find the best solution that was within my limited artistic abilities.  As an example, I knew I couldn’t model 3D chess pieces, so I bought a set of Staunton 3DSMax files, even though I was rendering the board in 2D, using OpenGL.  To get the 3D look, I rendered the pieces in Max, then I took screenshots of the renderings and used them as sprites in the game.  This worked pretty well, and I think my Staunton 3D set is one of the best looking sets on the App Store – it’s easy to see the pieces, without the 3D look making it hard to follow the game, and it looks very traditional.  I followed a similar approach for other games such as Go, and did some rudimentary modelling for pieces in Shogi – the ‘squashed pyramid’ shape of Shogi pieces was just about within my modelling ability.  The 3D pieces were in some ways easier to do because of this approach.  The 2D sets were much harder.  Although I could find free imagery for sets, I didn’t particularly like the quality of these images.  I spent a lot of time fiddling with individual pixels in photoshop, playing with blending modes, and sharpening/softening images.  I also spent endless hours tweaking filtering and rendering code to build up a 2D graphic on the screen that I liked.  Fitting a full set of Shogi pieces onto a 320 pixel screen is particularly challenging – the Kanji characters in their full versions are very detailed and hard to see at that screen size, not to mention the large capture area required, and the 9×9 board.  For that reason, I offered an optional reduced set of pieces with just the first character of the pair displayed – quite a common approach in the literature for shogi (newspaper columns often use a reduced set to document tournament games).  I later realized that I could have easily generated Kanji characters at any resolution by simply firing up Word and typing them in, but this was much later in the project when I worked on the iPad version.

As I mentioned, I chose to draw all the artwork using OpenGL ES.  For a 2D game, this is somewhat unusual, but for me it was a natural fit because I’m a 3D graphics programmer and most comfortable with 3D API’s.  Had I employed an artist to generate all the 2D artwork, and made use of the 2D graphics API’s I suspect I would have completed the project sooner, and with less difficulty.  Doing all the graphics myself meant I needed to work out how to handle animation, as well as combining iPhone 2D elements with my 3D renderer.  All that aside, for future projects I will still draw everything using OpenGL, but also generate all 2D user interface elements in the same renderer.  It’s really the only way to get a cross-platform game up and running without having to port all of the code.

With the pieces sorted out, I needed to draw the boards.  This part was a little easier, and involved finding some woodwork art, and writing some code to draw the lines onto the boards procedurally.  Being able to draw any size/shape of board in this way made it easy to offer different sizes of Go Board, and alternative games such as Mini Shogi.  For the most part the wood textures looked good, although on later versions I dialled back all the wood a bit and added a nice green felt texture for the backdrop.  I also added some small touches, such as fake shadows on the pieces, and scaling, etc. to give the illusion that the pieces were being lifted up/put down.

Server

Before Boardz, I’d never written any web based code at all.  Sure, I’d ran the odd sample ASPX demo and tweaked a little PHP code here and there, but apart from that I didn’t have the first clue about how to implement a server for a turn-based game.  After a lot of research, I came to the conclusion that I wanted to do a RESTful API, with very minimal web front end; since everything would be communicated through the iPhone client.  Installing and setting up a Linux server on a web host quickly convinced me that it was going to take a lot of maintenance, so I began looking around for easier solutions.  At the time, Microsoft’s REST story was not complete and difficult to understand, and I was nervous about maintaining and hosting IIS on a server – not to mention my total lack of experience with SQL Server.  At that point I discovered Rails, the web framework that runs on Ruby.  The nice thing about Rails is the way it abstracts the database from you, and makes it easy to build an app without writing SQL statements or managing the database.  For someone like me it was perfect, and after a few tutorials I was convinced it was going to work well.  At the time, I decided to leave the deployment problem until later on, but I eventually found Heroku and didn’t look back.  Heroku is a cloud host which makes it easy to deploy Rails apps; it’s one of the best pieces of software technology I’ve ever used – it’s trivial to get a Rails app running in the cloud, initially even for free.  You don’t have to worry about packaging up your app for deployment, you just push your git branch up to their server and a few moments later you are live.

The problems I had with the server mostly came down to my lack of experience.  I had some issues with my assumptions about how the Ruby language worked which bit me for a long time, and some problems with synchronising moves being made by the clients.  It took a while to get the authentication working with HTTPS too – installing an HTTPS certificate on a website and communicating securely is a bit confusing when you first set it up; and you have to be careful to get it right!  Getting the client to work with the secure connection also turned out to be very tricky due to the state of the SSL browser support in the phone –  which was improved by newer versions of iOS and became a non-issue over time.  To this day, the only real problems I get from users using Boardz are with the authentication/login.  Mostly these are just problems with firewalls, etc., but in future I’ll try really hard to make the authentication use OpenID/Facebook/Google, etc. and remove myself from the equation entirely.

One amusing part of the server design was how to send end user emails upon registration.  I worried about this for quite some time before using the Heroku Sendmail addon.  My concern was that I’d run out of email budget for new registrations!  I planned ahead, but never needed this functionality, since the app doesn’t create more than 10-20 emails per day…

Push notification support on Heroku was also pretty simple, due to the APN on Rails plugin, but it did add cost to the server, since I found I needed a worker thread to process game status and batch up the push notifications.  I have a worker that does this every minute or so and sends out ‘it’s your turn’ messages for the games.  In all, the Heroku server costs me around $60 a month to run, and I’m delighted with how it has performed – I haven’t had a single problem or outage in the two years it has been running.