Sunday, June 27, 2010

Blog<Running> Learning To Walk

In my previous 2 posts about running I talked about taking it slow, listening to my body, maintaining proper form, and not injuring myself. That progress would be slow, but eventually I would be able to run longer distances, pain free. It turns out that progress is even slower than I first thought.

In that last blog post, I outlined my plans for strengthening my flat feet. I would cut back on the running attempts and wear my Vibrams every day at the gym. After my feet got stronger, hopefully my shin splints would be under control, and I would be able to start running for longer and more frequently.

Stumbling Block

Over the week following that post, I started feeling pain in my feet. I'm not talking pain from impact, or general soreness from using the muscles in my feet. This felt more serious. It was like the shin splints moved from my shins down into my ankles and feet. But it was worse than shin splints because instead of only feeling pain when I walked, I also felt it while just standing or sitting too long in the same position. There were two spots on each foot (on the inside and outside, just below the ankle) where it hurt to touch, almost like a bruise.

Looking back on my plans, I'm reminded of the Greek proverb:
Learn to walk before you run.
I think I was asking too much of my feet, too soon. They've been locked up in rigid shoes for my whole life, and I was expecting them to magically get stronger in a few weeks. I didn't want to aggravate them any more (and it hurt to walk around anyway), so I took a week off from working out. Last week, when I started back, I wore my cross-trainers instead of my Vibrams on the elliptical machine. Until this morning, I hadn't run at all in 3 weeks.

Getting Back Up

For the past couple of days, my foot pain has gone away completely (the human body is kind of incredible like that.) So, this morning I attempted a run. I was able to go about 3/4 of a mile without pain, and then I decided to stop before hurting anything. After my run, on my short cool-down walk, I started feeling some pain again in my ankles, so I'm glad I stopped when I did.

If you don't learn from your mistakes, you're doomed to repeat them, so I'm changing gears for what seems like the 5th time. I need to slow down again, and this time test the waters a little before jumping in with both feet.

My plan for this week is to continue wearing my cross-trainers on the elliptical machine, but wear my Vibrams on my 2 weight days. I'm still going barefoot at home and wearing sandals when I have to go out in public. Then, if my feet feel okay next weekend, I'll go for another run. I'll run until I start feeling pain, or until I reach the .8 mile mark.

I'll keep doing this (gradually increasing my run distance if I can) until I can go a full week without foot pain. Then, I'll start replacing my cross-trainers with my Vibrams on some of my elliptical days, and replace at least 1 elliptical day with a run instead. By the end of August I'll hopefully be able to throw away the cross-trainers for good.

I'm sure there are flaws in this new plan as well, but it's good to have a goal to work towards. I'll be keeping this blog up to date as I make progress.


Some Miscellaneous Observations

There are a few things I noticed over the past 3 weeks that didn't really fit into the text above, but I feel like they might be useful to put in writing.

1) The elliptical machine. The strange thing about the elliptical machine is that it's a rigid, defined motion. Your foot moves maybe an inch inside its stirrup (that seems like an apt description of the thing that keeps your feet attached to the machine) over the course of several cycles. It's almost like wearing shoes outside of your shoes. So when I wear the Vibrams instead of my cross-trainers, it doesn't really feel any different. At the same time, my almost-naked foot doesn't really feel "right" in the stirrup. I have more range of motion in my foot because of the Vibrams, but I'm still performing the same movements over and over for 50-60 minutes.

I think it was this repetitive motion that caused me a lot of the pain over the past 3 weeks. Without any variation in terrain, my foot's ligaments and joints were just grinding back and forth, back and forth, over-training very specific muscles, ligaments, and tendons in my feet. Since the pain went away literally days after I switched back to my cross-trainers, I'm pretty confident that this was the case.

The conundrum is that most of my strength training workouts involve sitting or lying down. The only time I'm on my feet is during my elliptical workouts. To improve my foot strength, I need to be doing more, but not so much that I over train and injure myself. The best plan would probably involve stopping partway through my elliptical workout and switching shoes, but who wants to change shoes in the middle of the gym? Sometimes I think to myself that if I get off the machine now, it's not very likely that I'll get back on. So hopefully my plan of mixing in one day of elliptical with the Vibrams will allow me to get there gradually.

#2 Conflicting Goals. I have two fitness-related goals at the moment. For the past 6 months, I've been trying to lose a specific amount of weight. And for the past month and a half, I've been trying to become a runner. The problem is that in order to lose weight at a quick pace, I need to burn a lot of calories during my workouts; and since I'm a newbie runner, I can't use my runs yet to replace a cardio workour. Furthermore, the setbacks I've experienced so far while running have crossed over to the weight-loss side. When I took a week off to let my feet heal up, I had to stop my weight-loss training as well. Fortunately, I'm only a few weeks away from meeting my weight-loss goal (5-6 more lbs) and I can start focusing more on running.

#3 Perseverance. In the past, I would have given up on the running a long time ago. As soon as I felt the shin splints the first time, or the foot pain from the past few weeks, I would have probably thrown in the towel. For whatever reason, I seem to have turned a page mentally. I've been able to stick with the weight loss, I've been able to stick with the running (even though there have been few victories), and after a month of I've also been able to stick to updating this blog at least once a week. Hopefully the feeling decides to stick around for a while.

Tuesday, June 22, 2010

Blog<Losing Weight> Addendum

I left out some stuff in my last post because it was already ridiculously long. I'm just going to throw a few more things out there for you to think about in case you weren't overloaded with data the first time.

The Mythical Fat Burning Zone

Look at any cardio machine at your gym and you'll see a little sticker that shows which heart rate ranges are better for... whatever reason you have to use their machine. There's one that's called "Fat Burning" that I'm sure you've seen and thought "hm... I wonder if I'll lose more weight if I try to stay in that zone?" It's usually between 50% & 60% of your maximum heart rate (the elliptical machines at my gym have it between 90 and 120 bpm).

In short, this zone is really only needed by ultra-endurance athletes, and unless 60% of your max heart rate is as intense as you can go, it's pretty terrible for weight loss. But before I go into that, it's important to look at what energy sources your body uses while exercising.

Your body require a specific molecule, ATP, in order to fuel muscle contraction. ATP is a very short term fuel source, and is only stored in tiny quantities (seconds worth at any given time), so it must be constantly created from other sources like fat, carbs, or protein. Protein does not contribute very much while exercising, so for the purposes of this post, I'm going to skip it.

At around 50% of your max heart rate, fat supplies most of the fuel for ATP creation, which is why you see the unfortunate "fat burning zone" label on the machines at the gym. Fat is a very efficient fuel source, but it takes a while to convert it to ATP. The good thing (or bad thing in the case of losing weight) is that you have a ton of it stored in your body. It's a slow burning fuel stored in a big tank. If fat were a non-renewable fossil fuel, it would be coal.

At around 60-70% of your max hear rate, you will start using more carbs as a fuel source than fat. That's not to say that you stop metabolizing fat (in fact, when your heart rate increases, you will metabolize fat at a faster rate), it's just that you will start burning a higher percentage of calories from carbs. Carbs are much more efficient to convert to ATP than fat. If fat is coal in our analogy, then carbs are jet fuel.

But why do we care about burning a bunch of calories from carbs when we could just burn fat? Sure, higher intensities might burn slightly more fat, but is it worth it for me to expend the extra effort?

The reason is pretty simple. You have a limited store of carbs that your body can use while exercising (about 1 to 2 hours worth depending on intensity). After you work out, and especially while you are sleeping, your body has to refill its store of carbs so that it can be ready for whatever else you throw at it. To refill the store, your body needs to convert from an existing energy source, your body fat. So while you are sleeping, your body is busy converting your fat onto carbs to replace the ones you used while you were working out.

So, the next time you're working out, decide what you'd rather do
  1. Pay heed to the "fat zone" label and burn maybe 150-300 calories in an hour, burning fat only while you are working out.
  2. Increase the intensity. Burn more carbs than fat as a fuel source, and two to three times as many total calories, and then burn fat later while you sleep.
So why did I mention the thing about super-endurance athletes? Well, you can literally workout for several hours (days even) provided that you have enough fat in your body. If you keep your heart rate at about 50%-60% you can keep going until your fat stores run out. There are ultra-marathon races that are 100 miles long and start and end with the sun down. In this scenario, wouldn't it be better to burn mostly fat?

Your carb stores on the other hand only last about 1 to 2 hours, after which, you must go back down to a lower intensity to burn fat (or, you can replenish carbs by eating/drinking while you're working out, but then you're burning calories directly from your food and not the calories stored in your body).

I don't know about you, but spending more than 2 hours at the gym doesn't sound very appealing. The pure and simple fact is that you will burn the same amount of fat regardless of the type of energy you use while exercising. Fat loss is only related to the amount of calories you burn, and you will burn way more calories by kicking up the intensity than by sticking in the so called "fat burning zone".

HIIT

The processes above are specific to a certain type of exercise. They require the presence of oxygen, supplied by your blood, to convert carbs or fat into ATP. This process is called aerobic respiration. However, once your intensity increases to a certain level, your muscles will no longer be able to get oxygen fast enough to create the ATP to keep moving.

When this happens, the carbs stored in your muscles will be converted to ATP without the presence of oxygen, in a process called anaerobic respiration. Anaerobic respiration is highly inefficient compared to aerobic respiration. It only produces 1/20 the amount of ATP from the same amount of carbohydrates, and it also creates lactic acid as a byproduct. As lactic acid builds up, your muscles will start to burn, become fatigued, and eventually you will become physically unable to continue at such a high intensity.

There is a specific type of training that takes advantage of this process, called High Intensity Interval Training (HIIT). The premise behind HIIT is that, by exercising anaerobically, you will metabolize carbs more quickly than via normal aerobic exercise. It usually consists of a period of very high intensity exercise (90-100% max heart rate) lasting anywhere from 30-90 seconds. This is followed by a period of low intensity exercise for the same duration or until your heart rate drops below a certain threshold (70%-ish of max). You then repeat the intervals anywhere from 8-12 times.

The appeal of this type of exercise is that, through the inefficient process of anaerobic respiration, it allows you to burn through a large chunk of your carb store in as little as 20 minutes. Because of the lactic acid build up, it also shouldn't be performed without at least 48 hours to recover, so for those MWF people, who have limited time to spend at the gym, it can be a great way to burn a ton of calories with a minimal time investment.

HIIT isn't for everyone though. It's extremely physically demanding. You shouldn't even attempt it unless you have a good amount of endurance built up from a regular exercise plan. The goal is to go as hard as you possibly can for each of the high intensity intervals, until you literally can't continue (due to lactic acid buildup). It's a lot higher impact than normal aerobic exercise, and you have to be able to maintain a certain level of control to avoid injury (falling off the machine). If you do it right, by the time you finish your last interval, you'll be close to passing out or puking or both, and you'll barely be able to stand on legs that feel like rubber. So if that doesn't appeal to you, then it's probably not for you.

The other major reason not to attempt HIIT is if you aren't limited by time. You will be able to burn more calories through normal aerobic workouts, since you aren't limited by the 48 hour recovery period.



So hopefully I was able to shed some light on some of the processes that occur during exercise and how they relate to your weight loss goals. I'm sure I still have a few nuggets on the subject that you can expect in a future update.

Sunday, June 20, 2010

Blog<Losing Weight>

I am a person who believes in math, science, and logic. I hate it when someone tells me that the best way to lose weight is cardiovascular exercise, lifting weights, and diet. And then they don't spend anymore time explaining why. For me, the derivation is more important than the proof itself (forgive the kludgey math metaphor), otherwise it's hard for me to buy in.

So let me start off by telling you that the best way to lose weight is cardiovascular exercise, lifting weights, and diet.

If I do a good job explaining it, the rest of this post will tell you why.

When I got really serious about losing weight earlier this year, I did a bunch of research. I knew it would take a long time to reach my goal (losing 60 lbs), but I wanted to make it as efficient and quick as possible. The first thing I found was really obvious:

Calories Burned - Calories Consumed = Calorie Deficit = Weight Loss

That is weight loss boiled down to a simple formula. The higher your calorie deficit, the more weight you will lose. To throw another formula into the mix, 3500 calories is equal to 1 lb of body fat. So if you want to lose 1 lb of fat a week, you need to burn 500 calories more than you eat every day. The one simple rule I can give is this: it is impossible to lose weight without creating a calorie deficit.

The Calories Burned part of the equation can be further split into BMR + Calories Burned during Exercise. So the equation now looks like this:

BMR + Burned Calories due to Exercise - Calories Consumed = Calorie Deficit

Everything I researched pointed to this "magic" formula. So I took a closer look at the 3 things on the left and tried to figure out how to make it as efficient as possible.

BMR

BMR, or Basal Metabolic Rate is something you don't have any control over. It takes into account your age, sex, height, and weight. It is a measure of how many calories your body burns just to keep itself running. There is a pretty good BMR calculator here (everyone is different, so no BMR calculation is going to be perfect, but it will get you in the ballpark.)

I am a 6'4", 27 year old male. When I first started trying to lose weight, I was 266 lbs and my BMR was 2505 calories per day. Basically, if I was in a coma, I would need 2500 calories to maintain my weight. As a comparison, I redid the calculation with my goal weight of 206 lbs and I got 2131 calories per day. So clearly your weight plays a big role in your BMR.

Also, your BMR seems to be a lot more important than exercise in the "calories burned" part of the formula. I mean according to the formula, if I ate nothing and never exercised, I would lose 2/3 lbs every day. It would seem that increasing your BMR would be way more important than exercising more or eating less. It would be pretty difficult to burn 2500 calories in a workout. But you can't change your BMR, so why am I even talking about it?

Well, it turns out that I was lying a little bit when I said you're BMR is a fixed value. There is a different parameter that you have some control over (that isn't taken into account in the online calculator that I linked to). Actually, your BMR is almost solely based on your lean body mass, and the other 4 things in the formula are just used to approximate it since % lean body mass is not easy to calculate without having it professionally measured.

The main take away from this is that your BMR is higher when your body is more muscular, and lower when it's flabby. Muscle requires more energy to maintain than fat. So the first component of losing weight should be to increase your muscle mass.

So I started lifting weights 2 times a week. I focused on my upper body because I knew my legs would need a break from doing cardio. Aside from the benefits of having an increased metabolism, feeling stronger is a pretty good motivator. That said, weight lifting isn't really the way I want to spend my time at the gym. After almost 6 months of working out, I still have to force myself to do my weights days, but the benefit is tangible and the theory is sound, so that's enough motivation to push through it.

I like to mix it up a little bit to keep things interesting. Sometimes I will do high reps for each exercise at a lower weight (20 reps X 3 sets). This has the benefit of leaving your muscles feeling rock hard, like you really used every last ounce of strength. The only downside is that it takes a little longer.

Sometimes I'll do heavy weights and lower reps, but more sets (6 reps X 6 sets). Doing fewer reps allows you to lift more weight, and after a week of doing light weights makes you feel super strong. The downside is that you don't feel quite as physically exhausted afterward. Like maybe you could do the whole thing again in an hour or two.

And sometimes I'll do something in between (12 reps X 3 sets with moderate weights). The benefits and downside are also somewhere in the middle. For someone who doesn't have a specific strength-related goal, mixing it up like this takes out some of the monotony.

Calories Burned Wile Exercising

The BMR is a calculation of how many calories you burn while not moving. Basically, how much energy you would use if you slept in bed all day. Depending on your activity level, you will burn an extra 20% (sedentary) to 100% (super-athlete) of your BMR due to exercise. That means that just by doing things like eating, driving, brushing your teeth, sitting on the couch, or watching TV, I was burning 2500 calories from my BMR and an additional 500 calories from not being unconscious.

Fortunately, this number is way easier to increase than your BMR (and you can start burning more calories right now, instead of waiting for your muscles to grow). You just have to get your heart pumping. There are a bunch of ways to calculate calories burned for a variety of exercises, and none of them are exactly right. Distance and speed are not as important as effort level and time.

Distance and speed are about efficiency, which is the opposite of what you want to do if your primary goal is burning calories. When the exercise becomes easy, it's your body trying to tell you that it has found an efficient way perform what you are asking of it. And it means that if you spend the same amount of time at the same effort level, you will be burning fewer calories. So you either need to bump up the duration, or bump up the intensity. Or do something that keeps your body guessing. If you want to maximize your calorie burn from cardiovascular exercise, it shouldn't be comfortable or easy.

I started out using the elliptical machine about 3 times a week and eventually moved up to 4 times a week. I normally do between 50 and 60 minutes with the occasional 80-90 minute workout thrown in on Saturday. I like the "cardio" program because it mixes things up. It's 2 minutes of light-moderate effort (130-150 bpm) and then 2 minutes of hard effort (160-180 bpm). It prevents your body from getting in a steady-state "efficient" mode and keeps the calories burning.

This may be a part of the plan that just works better for me than other people. Unlike most people I know, I really like cardiovascular exercise. I like the elliptical machine because it allows me to push myself as hard as I want. My favorite days are the ones where I had a good meal and a good night's sleep the night before. I'm full of energy it's easy to push myself into the 190 bpm range on the hard parts and recover to about 170 bpm on the easy parts. After 45 minutes I'll have burned 1000 calories.

The problem with losing weight though is that you have to work harder to keep up the calorie burn. I started out at a low resistance, and am now about half way up to the maximum of the machine. The most important thing I have discovered is that if it's still hard, then I'm still burning a bunch of calories. I have to push myself up to that next resistance level or I'll get comfortable and the weight loss will slow down.

Diet

Diet is pretty self-explanatory. You want to minimize the amount of calories that you eat. It's also really easy to overlook. It's not so much about how much you eat, but what you eat.

In my earlier years, I never really paid any attention to what I was eating. My three most important criteria for food were convenience, taste, and cost. My ideal meal was something I could get quickly, without traveling very far, and without making it myself. It didn't have to taste like "real food" as long as it tasted good. And if I could be full after spending 5 or 6 bucks, then I felt like it was a good deal. Basically, my ideal meal was driving 2 minutes to Taco Bell.

When you are overweight, it is because you are eating more food than you need. Overeating causes your stomach to stretch. So the first struggle of dieting for me was feeling full after a meal. I forced myself to look at what I was eating. Initially, I tried to find the biggest thing I could eat for the lowest amount of calories. Things like salad, popcorn, and pickles.

But I couldn't eat just those 3 things every night. So for the first 2 weeks, I went to bed feeling not quite hungry, but definitely not full either. Eventually, my stomach shrank back down to a normal size, and I started feeling full after smaller and smaller portions of food.

The second thing I struggled with was time. I went from driving through a fast food window twice a day to having to actually make my own food. For lunch, I decided to go half way. No more fast food, but I wasn't exactly making my own food either. I settled on a bowl of Campbell's soup (150-200 calories) , a make-it-yourself sandwich-in-a-box (300-400 calories), and a bag of baked chips (100 calories). I make my lunch in about 4 minutes.

For dinner, my problem was eating by myself. My wife works late a lot of nights, and it's usually a pain to cook for just one person. So I focused on quick, simple things that could be cleaned up easily. I bought some pre-made stuffed pasta and pasta sauce (700-800 calories), or a frozen skillet dinner (550-650), or Tuna Helper (600-700). Occasionally, if I was feeling really lazy, I would cook a can of turkey chili and eat a can of tuna with some crackers (600). I have since graduated to slightly more complex meals, but I can still make dinner somewhere in between 5 and 20 minutes (if I have to cook pasta).

My third struggle ended up not being as big a deal as I thought it would be. Giving up soda. I used to hate the taste of water. Why would I want to drink this bland, colorless, odorless thing when I could have a Mountain Dew? Well, I added up the calories from sodas that I was drinking every day and it was more than half a lb of fat a week. One of the easiest decisions I've ever made. And after the initial week of withdrawal headaches, water started tasting pretty good. In fact, by drinking only water, it somehow made me crave it even more.

Putting It All Together

So, as a recap, here are the things you should know about weight loss:

BMR + Calories Burned Exercising - Calories Consumed = Calorie Deficit = Weight Loss
  • BMR - Can be increased by lifting weights (building lean body mass)
  • Calories Burned Exercising - Has a base component for being a conscious human being, and is greatly increased by working out hard for long durations
  • Calories Consumed - Can be decreased by eating less food.
So based on this, it would seem like the best thing you could do is lift weights, run until you pass out, and starve yourself.

Hopefully your spidey sense is tingling after reading that sentence.

There is a fourth component to weight loss that is just as important as the other 3 (if not more-so): keeping yourself healthy. There is a lower limit on the calories you need to consume, and an upper limit on the maximum calorie deficit you can safely achieve.

Don't eat much less than your BMR in calories every day. The amount of energy your body can replace from its fat stores is limited to a certain rate. If you don't eat enough, your metabolism will start to slow way down, and your body will start using your muscles as it's source of food (instead of fat). According to some research, this rate is about 30 cal/lb of fat. Which means that a 200 lb person with 20% body fat can safely create a deficit of 40lb * 30 cal = 1200 calories a day. The amount of fat you can burn by diet alone slows down as you lose more body fat since there is less fat to replenish your energy from. At a certain point you hit diminishing returns and start metabolizing your hard-earned muscle instead.

There is a maximum calorie deficit that you can safely achieve, and it's similar to what I mentioned above. This was one area where I couldn't find a lot of good information, so take this with a grain of salt. The maximum rate of fat metabolism increases when you do cardiovascular exercises, which means that you can safely create a higher deficit through exercise than by diet alone. But, there is still an upper limit to how much energy can be replenished from your fat stores, and without any real research on this effect, I'm not going to list a formula for calculating it.

My suggestion is to just never eat less than your BMR (or consult a doctor first). It's safer to just make up the calories with exercise, and you won't have to starve yourself. You need to eat a certain amount of food in order for your body to function, and you need to eat certain types of food to exercise effectively (carbs).

My other recommendation is to take it slow. Don't go out and overdo it or you'll lose motivation. Or you'll get injured or sick and have to sit out for a few weeks. On the food front, start out by eating just a little bit less, and make healthy choices like cutting out the soft drinks and fast food. Also, it can be useful to keep a food/exercise diary until you get into a routine. I kept one for about 1 month and a half, until I basically had every meal or workout memorized. Then one day, I realized I didn't need it anymore because my routine was ingrained into my life.

I set a goal to lose 2 lbs a week for the first couple of months and then between 1 and 1.5 lbs a week after to lose 60 lbs. After setting this goal, I did the research, and put together a plan that would allow me to lose the most weight as safely and as quickly as possible.

3-4 days a week, I do hard cardiovascular exercise for 50 minutes to an hour (about 1000-1200 calories according to the machine). 2 days a week I lift weights (arms, chest, abs, and back to give my legs a break from the cardio). I strive to eat my BMR in calories for each week. Which means I get to enjoy that high-calorie meal every once in a while without feeling bad about it. Every 6-8 weeks, sometimes on purpose and sometimes because life intrudes, I get a week off to recover (and as a bonus, this tricks my body into losing some efficiency on the elliptical machine.)

After following this plan, I've lost close to 2.5 lbs per week for the first 3 months, and 1.5 to 2 lbs per week for the next 2 and a half months. There's lots of other benefits that I've gained, but from a pure weight loss standpoint, I'm ecstatic. As of this morning, I've lost 50 lbs and that goal that seemed so out of reach 5 and a half months ago is about 5 or 6 weeks from being met.

Sunday, June 13, 2010

Blog<Game>

Programming

I'm a pretty left-brained kind of guy. I enjoy math, logic, and things with structure. I enjoy thinking about implementation more than abstraction. When I'm describing what type of thinker I am I use words like "implementation" and "abstraction." I'm pretty good at following directions to get something to work. I would say that close to 90% of my life involves this kind of thinking

At the same time, I enjoy creating things. I used to want to be an artist, or a writer, or a musician. I like to think about questions that don't have answers, or about how a song or piece of artwork makes me feel. The best part of my job is coming up with a solution to a problem. Hell, my creative side is one of the reasons I'm writing this blog.

I continued to program after my first programming class in high school for one simple reason. It's a combination of the logical and the creative. It's analyzing a problem, figuring out a solution, and then making the solution work. But there are areas of programming where there's a bigger creative outlet than my normal job provides, which is why I started developing a game a few months ago.

The Game

The game's tentative title is Reborn. The overall vision for the game is to create a giant world that the player can manipulate however they want. The biggest feature is that you can change the terrain of the world by farming, mining, tunneling, creating burial mounds, or whatever else you can come up with.

Well, as of right now, it's just a collection of tools to eventually allow that kind of interaction. If the past 6 or 7 years have taught me anything, it's that creating a game takes a long time and requires a ton of motivation and patience. I plan in posting more about it in the future. Things like design docs, pictures, videos, downloads (at some point), and general info on its progress.

Some very general info:
Language: Scala
3D framework: OpenGL (JOGL)
Platform: Windows, Mac, Linux

For now, I have created a few videos of some of the tools that will be used in the game. This technology will eventually allow for a giant deformable world. Sorry for the poor quality. The screen-cast software I used to record the videos didn't handle the recording process very well, especially while the CPU was trying to make the tools run smoothly.

Rendering geometry using Vertex Buffer Objects. VBOs let you render a large amount of geometry very quickly. The geometry is stored locally in the video card's memory, so it avoids costly memory transfer operations. It also allows for quick updates to the geometry as you can see in the video.


Creating surface normals. Surface normals are required for lighting. This video is rendered using OpenGL's per-vertex lighting model, but eventually the game will use a fragment shader for per-pixel, bump-mapped lighting.


Partitioning a mesh along a plane. The game will require splitting up the world into smaller pieces so that it can be rendered/updated efficiently. This video shows a mesh being split about 30 times/second along a rotating plane.


Reducing a mesh. This video shows 2 meshes. The first is the original mesh, and the second is the same, but with about 100 fewer triangles. The goal is to use as few polygons as possible, but retain the interesting features of the original. The tool itself still has some issues that I'm working out, but the video is a pretty good indication of the final product.



There's still a lot to be done. Once I work out the final kinks with the mesh reduction tool, I can start creating the world proper. This will include things like texture mapping, nailing down a lighting model, organizing the world into a fast data structure, and adding non-terrain geometry like trees, people, animals, buildings, etc...

Also, at some point I need to add sound, input, and possibly physics.

I'll hopefully be updating my progress regularly.

Saturday, June 5, 2010

Blog<Running> Part 2

If you managed to get through part 1, you were probably wondering what my history with swimming, my recent motivation to lose weight, and my newfound interest in running have to do with each other. Well, here it is:

Why Running?

The elliptical machine is a great tool for working out. It's low impact, it has a variable resistance, it's climate controlled, it's about 15 feet from a large tank of cold water, and it's green (the one I use is powered by the cycling motion).

It's also incredibly boring. If it weren't for several podcast subscriptions, I wouldn't be able to motivate myself to workout every day for 30 minutes, let alone 60-90 minutes. It's stationary, it's the same motion minute after minute, day after day, month after month, and honestly, I started getting tired of measuring my progress with calorie counts, or watts, or cycles per minute, or even heart rate.

I wanted to do something where I wasn't just running in place. Where I could go for a while and let my body tell me how hard I was working and shut all of that other stuff out. I thought about swimming, but it's just too inconvenient. By the time you drive to the pool and get changed you've already wasted 30 minutes. Then, you have to find an open lane (or share with someone willing). Once you're done you have to take a shower, change and drive home. That's another 30 minutes gone. Swimming is something that I enjoy, but if I've learned anything from my recent weight loss it's that you have to put yourself in the best possible situation to succeed. For now, swimming just doesn't fit the bill.

So I still needed to find my convenient, low impact, cardiovascular exercise. Cycling is too much of an investment (and between you and me, traveling great distances is a recipe for getting lost). Rowing? What is rowing? How does a person even start rowing? Basketball, tennis, soccer? They all require coordination with other people, and wouldn't necessarily let me go at my own pace. And they are also not very "low impact". So, what's left?

Well, for a couple of months now, I've been reading various articles about the evolution of the human foot, and about how modern shoes make our feet weak and more prone to injury. Then I started seeing people post about their Vibram FiveFingers on facebook and twitter.

My interest was officially piqued, but I have always had problems with running. Also, how the hell does using less cushioning translate to a lower impact?

Running Form

This is the first piece of advice I normally receive when I ask how to be a better runner: get proper running shoes, with a big padded heel and a stiff high arch for your flat feet. In the past, I would try to follow this advice. I would get the shoes and start running, and for the first 3 or 4 runs I would be fine. Then I would start developing shin splints, or I would roll my ankle (even with the rigid support of the shoes). Then, after a couple more painful runs, I would stop altogether. After a few rounds of trying and failing, I eventually gave up for good.

But recently, I started seeing all of these articles about people running pain free, either barefoot or in their Vibrams. Even people like me who have flat feet and suffer from chronic shin splints and weak ankles.

I went on a research bender. I found a bunch of websites and blogs with information about minimal or barefoot running. I read the research on impact of heel strikes versus forefoot/midfoot strikes. I discovered how running can be "low impact".

The gist of it is that your foot has more nerve endings in it than any other place in your body (well, technically there is a place where they are more concentrated, but it's probably not as big as your feet). These nerves are there to tell your brain what you are stepping on, so that your brain can tell your feet how to keep moving safely. Your primary contact with the outside world is through your feet, so having that connection is important. It's an extremely sensitive feedback loop that has been honed over hundreds of thousands of years of evolution.

When you wrap your feet in a big padded shoe, you are cutting off this feedback loop. The problem is that your feet still want to "feel" what they are running on. Add more padding, and you have a tendency to pound your foot down on the ground. Your brain is trying to push your foot through all that rubber, or gel, or air cushioning so that it can figure out the safest/most efficient way to move. Well, now, you are literally stomping the ground with every step, so it's no wonder that running is so high impact.

Now take off your shoes and run. Pounding the ground for even 100 steps will be incredibly painful. You will naturally become more careful about how you land because you want to minimize the impact that you feel. You will also begin to realize that landing on the front of your foot is easier than the heel. This is because all of the force of the impact will be handled by the soft tissue in your feet and legs (tendons and muscles), instead of the hard tissue (bone and cartilage). Your soft tissue has this miraculous ability to stretch and store energy. So instead of just absorbing the impact in your joints, you're compressing and storing the energy in the natural springs in your feet and legs. Energy that will be released when you follow through with your stride.

That's the theory anyway. There's actually not a lot of scientific research in this area. Just anecdotal evidence, and that common sense light bulb in your head blinking "no shit".

Running: First Attempt

So, using this knowledge, I finally decided to go out for a run in my old New Balance cross trainers (the closest thing I have to a shoe that I could reasonably exercise in), focusing on landing with a forefoot strike instead of a heel strike. I ran/walked for about 2 miles until my calves were on fire and I couldn't go any further. I didn't feel any shin pain though, so a couple days later I went for another run. This time, I was able to go a little further, but I started to feel the familiar pain of shin splints coming on.

Not wanting to give up, I did more research. I found that shin splints have many causes, one of them being flat feet. When your foot has a weak arch (or low arch) it tends to roll inward more than usual when you land on it. This pulls and stretches one of the muscles that attaches to the inside part of your shin bone. This constant stretching causes the muscle to start tearing away from the bone, which is what causes the pain in some types of shin splints. It also just happens to be the same part of my shin that hurts after running.

Okay, so all I need to do is fix my flat feet.

Running: Second Attempt

More research. Again, there is no scientific evidence to prove (or disprove) what I'm about to say, but the ideas resonate with that same "no shit" feeling. Shoes and orthotics with high, rigid arches (made for people with flat feet) cause your feet to weaken. If you rely on some external structure to fix your arch, then your foot's muscles start to atrophy. Eventually, you will completely rely on the arch support. When you take off your shoes and stand upright, your feet roll inward because you are not used to standing without the external support. The shoes actually make your flat feet worse.

So, the "solution" is to train your foot to support itself again. Time to lose the rigid shoes and go natural.

Well, almost. Since I wasn't ready to take the plunge into barefoot running, I went out and bought a pair of Vibram Sprints. They feel like you aren't wearing anything. You have full range of motion of the entire foot (including toes), and there is absolutely no arch support. The only thing between your foot and the ground is about 5 mm of flexible rubber. You feel every twig, pebble, and crack in the sidewalk. Interestingly, you start avoiding the dangerous things you would normally step on while wearing shoes.

So last Saturday, I went for a jog in the Vibrams. I'd been told to not go more than half a mile for the first run, and that was good advice. It was over in about 5 minutes. Just long enough to start falling in love with the "shoes", and not so long that I was in pain. The freedom I felt in the Vibrams was amazing. It reminded me of what it felt like to run around barefoot in the grass as a kid. In that brief half mile, running was fun. On top of all that, I didn't feel any more pain in my shins.

After my first experience with the Vibrams, I bought and read Born to Run by Christopher McDougall. Upon reading it, if you are like me, you will immediately want to go out and run a 100 mile race through the mountains. So, I impatiently went out and ran 2 more half miles in the next 3 days. That was a mistake. I ended up aggravating my shin splints from my first (shod) running attempt from the previous week, and I started feeling pain in my knees. The thought of miraculously becoming a runner made me go out way too fast and way too hard.

I got a much-needed reality check.

Today

After my ill-fated attempt to run for the past 2 weeks, I decided to take it slower. I gave myself 3 and a half days off from running and threw some tried and true recovery techniques at my shin splint problem: ice, stretching, massage, shin muscle exercises, and Motrin. While waiting for my knees and shins to recover, I still went to the gym to lift weights and run on the elliptical machine. I didn't want to have to sit out for too long and lose any momentum (or endurance), so the elliptical machine's ultra-low impact motion is nothing short of a godsend.

In addition to the cure for shin splints, I started working on some preventative measures. Over the past week, I focused on improving my arch strength. At work, I loosened my shoes a little, and tried not to let their arch supports do the heavy lifting. At the gym I wore the Vibrams, and when I got home, I walked around the house barefoot.

It sounds kind of ridiculous, but after focusing on letting my own feet support my arches for a week, they already feel stronger. Maybe that's just me being optimistic, but there are muscles in my feet that I wouldn't have known about, if it weren't for the fact that they are now sore.

By this morning, I was completely shin pain free, so I went for another run. I focused on keeping my arches from flattening, and on trying to eliminate a lot of up and down movement. My theory was that by preventing the shin muscle from stretching too much I would also prevent the shin pain. So far, I'm happy to say that it was a success. I ran 0.6 miles today before I started feeling my foot muscles lose the strength to maintain their arch shape. I stopped to prevent injury. I might not be going very far yet, but that extra tenth of a mile is still progress.

The Future

My experience over the past 2 weeks has taught me that it's going to take a long time to get where I want to be. The difference between previous attempts and this one is that I'm now armed with the knowledge to get better, and the motivation to get stronger and go further. The difference is that I used to want to become a runner, and now I am one.

My eventual goal is to just be able to run pain-free until I'm tired. To get out of the gym and into the real world. Expect plenty of (much shorter) progress updates along the way.

Thursday, June 3, 2010

Blog<Running> Part 1

I recently became really passionate about running.

By "recently," I mean as of 2 weeks ago, and by "really passionate about running," I mean that my frothing desire to run is starting to spill over into the rest of my life. Which just so happens to include this blog. I feel like that's as good a reason as any to put it down in ink (pixels?) for consumption by anonymous internet people.

The Beginning

My experience with exercise started when I was 3 years old. My mom took me to a pool, got me a kickboard, and I was set. At age 6, I joined a summer league swim team and until my freshman year in college, I basically swam nonstop (with the exception of that time that I lived in a small town in Kansas that didn't have a swim team). Swimming is great exercise and as a result, I stayed lean and healthy while I kept at it.

As I entered high school, my training intensified and I started to experience what it felt like to push my body as far as it would go. I loved barely being able to pull myself out of the pool because I had spent all my energy in a race. I loved the accomplishment of making it through "hell week", 2 practices totaling 5 hours and 10,000 yards every day for a week (almost a quarter marathon every day for 6 days in a row... swimming.)

Swimming instilled that sense of accomplishment, satisfaction, and wellbeing that comes after doing something really hard. And don't forget the endorphins that rush through you when you've just kicked your ass for 2 hours. It's easy look back on those days with nostalgia.

The Middle

When I went off to college, I joined a club swim team with the hopes of one day walking on to the school's team. Shortly thereafter, I was overwhelmed by school work and my newfound personal freedom. I stopped swimming and started partying. My dream of joining the swim team suddenly didn't seem as important. As I started feeling the pressure of my future bearing down on me, I replaced most of the partying with studying. I still swam on my own every now and then, but it was nothing close to the intensity or duration that I was doing in high school. I just didn't have time for it anymore.

When I graduated and got a job, I went through a similar phase. I gained more free time (no homework), but spent most of it playing video games or watching TV. Having a job also increased my income. With the price of restaurant food no longer an issue, I started eating out all the time. Every day for lunch, I ate some ridiculous-sized portion of fast food. I started swimming again off and on, but it was only enough to slow my weight gain to about a pound a month. Finally, I was transfered to Dallas, and after a brief attempt to lose weight, I stopped working out all together.

The Recent Past

One day at the end of last year, I got out of the shower and looked in the mirror. When I saw the chubby naked body staring back at me, it triggered something in my brain. I hated what I saw. I wasn't the skinny, lean kid I remembered from just a few years ago. I had become chubby, flabby, weak, and old.

I needed to make a change in my life. I got on the scale that I had been avoiding for months and it read 266 lbs. How the hell did I weigh that much? My senior year in high school I weighed 185, when I graduated college I weighed 220, and on my wedding day, I weighed 230. Oh. I suppose that could be considered a pattern. I am pretty tall at 6'4", so it took a long time for that weight to spread over my frame, to the point where I wasn't noticing how out of shape I had become. But give it a couple months, a couple years, and suddenly I hardly recognized myself.

Without hesitation, I started going to the gym. It's literally inside the building where I work. In hindsight, if it weren't for this convenience I probably wouldn't have made it very far. I started working out every day. On Monday, Wednesday, and Friday I used the elliptical machine for about 30 minutes (plus 10 minutes for warmup and cooldown). On Tuesday and Thursday, I did resistance training, starting off with high reps of low resistance free weights. On Saturday, I went back to the elliptical machine for a slightly slower pace, but bumped the time up to 40-50 minutes.

I also started watching what I ate. I went from eating 4000 calories on some days to eating between 1800 and 2400. I stopped drinking Mountain Dew for breakfast, and replaced it with a granola bar. In fact, I cut out sodas almost entirely (from 2-4 a day to 1-2 a week), and replaced them with plain old water. For lunch, I substituted the fast food with a can of Campbell's soup and a sandwich, and maybe a bag of baked chips. For dinner, I started eating pasta, or chicken, or maybe a can of chili, or some tuna helper, or occasionally a healthy-ish frozen dinner (one of the ones that comes in a bag you heat up in a skillet).

After 2 weeks, I had lost 5 lbs.

After a month, I had lost 10 lbs and felt way stronger. I was no longer winded from walking up the stairs. I could easily carry that 40 lb container of kitty litter, or that 50 lb bag of dog food.

Since then, the ride has occasionally been bumpy. About once a week, I cheat and eat out, and there have been a couple of weeks where I hardly worked out at all, but I don't lose motivation because I continue to see results. I am still on track to meet my goal of losing 60 lbs by October (at this rate, I'll finish 2 months ahead of schedule). I keep getting stronger, I keep building my endurance, my pants and shirts keep getting looser, I sleep better, my acid reflux is gone, and I could honestly list dozens of other ways that this decision has improved my life.

The Present

This morning, I weighed in at 219 lbs. Yesterday, I was able to keep my heart rate between 170 and 195 bpm for about 55 minutes on the elliptical machine (1200 calories burned). Two Saturdays ago, I was able to run on the elliptical machine at a slightly slower pace for 90 minutes (1600 calories). The feeling is the same as when I was swimming in high school: the muscle soreness, the physical exhaustion, the accomplishment of doing something hard, and the endorphins that make it all feel really good.

So what the hell does all of that have to do with my sudden interest in running?

Find out in part 2.

Wednesday, June 2, 2010

Blog<Meta>

I'm just going to get the standard first post over with: This is the first of (hopefully) many updates about the things I find interesting. Everybody says that for their first one, before they fall of the face of the earth. Hopefully there will be more text to read for anyone viewing this blog 6 months from now, but if not, this post should be pretty humorous.

Now that we have that out of the way, let's get started with some Q&A. These are the questions that I think you, a complete stranger (and in all likelihood, an imaginary person), would like to ask about me:

So, who the hell are you?

My name is Kyle Sweeney, and I live and work in the DFW metroplex. I am married to the smartest woman I know (smarter than any man I know for that matter). I have two lazy cats, and two crazy dogs. I am an employee of Valtech, which is a consulting company that primarily focuses on agile software development and agile training. My primary responsibility there is creating kick-ass web applications. I don't know how to write without overusing parentheses (as you could probably already tell.) For the rest, you'll just have to keep reading.

So, what is your favorite beer?

This seems like a pretty good second question for getting to know someone. I'm a wheat beer kinda guy, and my favorite is Franconia Wheat. It comes from a local brewery in McKinny, TX, and is my beer of choice whenever I can find it in a Dallas bar.

So, what the hell does Blog<T> mean anyway?

I'm terrible at explaining programming concepts to people without programming experience, but I'll try my hand at it anyway (in other words, feel free to skip this paragraph.) In most programming languages, it is possible to create a type of object that is too generic to live on its own. This object is a framework or a template that requires another type of object in order to fully define what it is. For instance, if you have a list, it probably won't be too useful without knowing what types of things you can put in it. In a language like Java, you would say List<T> is a list that is parameterized by the type T, which can be whatever you want. When you want to use the list, you have to say what it can contain (what the T is), so List<Person> is a list of Person objects. You can probably guess what a List<Thing> or a List<List<Product>> is.

If you don't understand what any of that means, it's just a really long way of saying that Blog<T> is a blog about... anything. Whatever I happen to find interesting at the moment. Expect posts about programming, working out, relaxing, video games, and everything else.

See you next time.