Monday, August 30, 2010

Blog<?> Running and Game Update

Running

After last week's set of complaints I feel like I'm obligated to talk about the 3 great runs I've had since.

On Tuesday, I ran half a mile shod, and then half a mile barefoot. I thought I would need the Vibrams because it was so hot, but I took them off and had no problem finishing the second half of my run. On Thursday, I decided to go barefoot-only and managed .8 miles (a personal record) before I started to worry about overdoing it. Since I run a 1 mile loop, I walked the last .2 miles back home. And on Sunday (yesterday) I ran the whole 1 mile loop barefoot (new personal record).

I feel like I'm finally starting to get the technique down. I ended up with zero blisters and zero shin pain. The only thing that started to hurt was the outside of my left foot where my sole meets the ground. I think that my foot twists a little when I land because that spot was starting to get "hot" (no blister though). Also of note is that I finished my second week of planned runs. My total barefoot mileage for the week was 2.3 miles.

So what was different?

Well, for starters, it was about 10 degrees cooler than it's been for the past 6 weeks. This meant I got to run in daylight for all 3 runs. I also decided to start forcing myself to walk 5 minutes as a warm-up before every run (.35 miles). I've been doing the warm-up in my VFFs since my barefoot walking is not quite frictionless yet and I want to save my soles for the running. And lastly, the barefoot running is forcing me to make major corrections to my running form. It's kind of amazing how most of my pain went away just by taking even shorter, less springy strides, but I never would have thought to try it if I still had the protection of a few millimeters of rubber under my feet.


Game

I've also been making some strides on the game development side of things. I added a few features to hide the mouse cursor, and keep the cursor centered on the screen. This prevents the mouse from covering anything, and also keeps the user from clicking outside the window (causing it to lose focus). Also, the Esc key now causes the app to exit (although the key/condition is configurable by the application developer).

Those are pretty small features though. I spent most of the past 2 weeks creating a texture manager and a kind of virtual camera to make scene navigation easier. The standard disclaimer about the crappiness of these videos is in full effect. Each of these is running smoothly when not passed through the screen capture software.

Procedural Textures:

By procedural, I mean not loaded from an image. The basic gist is that each pixel value in the texture is chosen based on its distance from the center. The 1D texture looks like a few points that have smooth transitions between them. The 2D texture looks like concentric rings. The 3D texture, if you could see inside it would look like concentric shells. It is being translated (moved) in the depth direction, giving the appearance that it's animating. If you look closely, you can see how the 3D texture is a moving volume that is being projected onto the geometry (cube, sphere, torus) as it passes through it. It's especially evident on the sphere and torus. I'm not sure how many textures I'll need to procedurally generate, but it was a good test of the texturing code without needing to worry about getting the data from actual image files.


Image Textures:

Each of these textures was loaded from an image file. The cubemap texture is actually 6 different images mapped to the 6 faces of a cube (hence "cubemap"), and then the texture coordinates are generated to make it look like the geometry is reflective. The 3D texture was created from 16 cat scan images, stacked one on top of the other. Like the procedural video, it's being translated in the depth direction, giving the appearance that it's animating. Most of the textures in the game are going to be loaded from image files, so this is going to be used all over the place.


Virtual Camera:

I generated some terrain using the diamond-square algorithm (random noise generator). Then, I added some code to move the camera around. The changing checkerboard pattern is just a weird texture-space trick to make the terrain seem less/more detailed.

Sunday, August 22, 2010

Blog<Running> Week 12

The past 4 weeks have been frustrating as far as running goes. Here's a sample of the latest setbacks.

Our Yellow Sun is Destroying Me
Which kinda makes me the exact opposite of Superman. After coming to this revelation, I'm giving serious consideration to a low-carb, high-kryptonite diet (it's basically Atkins, so it's probably safe).

The temperature for the past month has been a consistent 100 degrees. On a few days, it's gotten up to 106. Since I can't do all 3 of my weekly runs on Sunday morning, I've been running on week nights after work. It's either that or endure the sauna that is Dallas between 10AM and 8PM.

The problem with running at night is that it's not any fun. It's dark. It's still 96 degrees despite the fact that the sun is down and it's after 9 PM. Everyone is running their sprinklers (okay fine, running through sprinklers is still as fun as it was at age 6.) Running shirtless is not getting me any tanner. It's way passed the time that I want to do anything strenuous. And the biggest problem is that it's hard to keep track of my form when I'm trying to avoid tree-branches or stumbling over curbs. I find myself stomping whenever I'm unsure of my footing.

Success Breeds Overconfidence
About 3 weeks ago, I had the kind of breakthrough that I was talking about in my previous post. I was running in my VFFs after dark, and I just kind of slipped into a relaxed gait. Next thing I knew, I had run 1.8 miles. So on my next run, I did the same thing. After about half a mile, I got in "the zone" and everything just felt right.

The next day, my shin splints pain was back. I had to skip my weekend run to avoid aggravating it further. The next Tuesday, I felt fine again, so I ran about the same distance. This time I got some minor blistering on the balls of my feet, along with some slight shin pain. I ran on Thursday and only made it about a mile before the shin splints pain made me stop. And I had to skip my weekend run again to let it heal.

A Few Steps Back
This past week I took a hard look at my running form. I tried to make it as smooth as possible. I exaggerated my knee bend, and minimized my up-down motion. As a result, I slowed way down and didn't run as far (about a mile), but my first run on Tuesday felt pretty good. No shin pain and no blisters. My run on Thursday didn't feel quite as smooth, but my shin splints didn't come back.

So this morning, for the first time since I've started running, I completed my 3rd run in a single week. And to top it all off, it was a successful barefoot run. I managed to go 0.7 miles without any blisters (after a .4 mile barefoot walk).

Now, the careful reader probably noticed that my 3 runs this week at 1, 1, and .7 miles is not as much as my 2 runs at 1.8 miles each from a few weeks ago, but I think the fact that I've been injury-free for 3 straight runs outweighs the decrease in distance. Of course there's also a good chance that my injury rate is related to distance.

Some Self-Evaluation
Looking back on the past 12 weeks, the first question that pops into my head is: "why the eff is this so hard?" I see other people running 5 miles at a time. I see C25Kers running 3 miles after training for 10 weeks. Surely a part of it is getting used to the barefoot running style, but there's got to be something else as well. Maybe my body just isn't made of the same stuff everyone else's is

I feel a bit like a fish out of water. Put me in a pool, or a lake, or the ocean, and I can swim circles around almost anyone. Put me on land, where our mammalian ancestors have evolved for millions of years, and I flounder like a beached whale. Maybe it's just going to take a long time. Or maybe I'll never be able to run more than 3 miles at a time.

In the end it doesn't really matter. Despite the setbacks, I still feel like I'm making progress, and throwing in the towel isn't really my style. I'm stubbornly determined to see it through to whatever end is waiting for me.

Sunday, August 15, 2010

Blog<WIP> More Old Blender Stuff

Well, my Blender phase is winding down since the game is picking up my attention again. When I was at the height of it, I made this: a sort of lily thing



I didn't like the way the texture on the petals were repeating, so I re-did it a little.


I also went back through some of my older stuff came across some animations that I thought were interesting.


This is a test animation for a robotic foot:


This is a weird Tube thing in black and white.



And here it is again, with different lighting and texturing.


A test of Blender's ray-tracing



A family logo thing


That's all for this time. I think I'm done with Blender for a little while, but at some point I'll probably start using it to create in-game assets, a much different kind of work.

Sunday, August 8, 2010

Blog<Game> Now an Open Source Project

In my last post about the game I've been working on, I gave a very high-level overview of what I thought the game would be like. About a week later, I ran into an issue and didn't work on it again until this weekend. I managed to get a lot done, even if some of it was just project management stuff.

Google Code

The most important thing I did this weekend was to move the project over to Google Code. It's Google's open-source project hosting site. The fear of my hard drive suddenly imploding is what precipitated this change, but if anyone is interested in contributing, that is now an actual possibility.

The project page can be found here. There are instructions for setting up your environment here. If you would like to contribute, just let me know (either by commenting on the blog, or through email).

The Other Stuff

The google code thing was important, but quick. I spent most of the weekend working on the following:
  • Integrate JInput for keyboard and mouse support.
  • Clean up project so that it has a modular structure.
  • Fix Maven build files so that the project can integrate nicely with Eclipse, and can be built on a variety of platforms.
Unfortunately, only one of these things has an accompanying video, so here is Keyboard and Mouse Input. Sorry it's not very exciting.



That's it! If you have any questions or comments about the game, feel free to leave me a message in the comments.

Sunday, August 1, 2010

Blog<Works In Progress>

I started getting back into Blender about a week and a half ago. As I sat around waiting for inspiration to strike, I went back through some of my older stuff and found a bunch of unfinished projects. A timeline of a few spurts of creativity, digitally preserved on my hard drive. I figured I'd share some of them here. Maybe I'll find one that I want to continue working on.

Spider - This was the first picture that I ever made in Blender. A strange-colored spider made of geometric shapes, posed the low-res, low-polygon ground. The background was supposed to look like fire, but it just looks kind of abstract and blurry.



Temple - I found the reflection tools in Blender and tried my hand at making water. The second one is from when they released the ray-tracing renderer.



Drawbridge - I remember spending a lot of time on the door. I also spent a lot of time trying to get the stone wall to look good, but the procedural textures are hard to work with sometimes. This was going to be just a small part of an entire castle.



Alien - I wanted to try my hand at modeling something organic, but I didn't want the pressure of making a human. I finished modeling everything except the hands because hands are hard.



Building - The entrance to some office building. I like it, except for the windows. If you have reflective windows, it helps to have something (behind the camera) to reflect.



Apartment - I tried to make a detailed apartment building. Windows have the same problem as the other one. Also, the brick texture is flat, and there's no dirt/water stains. Texturing is way harder than modeling.


Tree - A weird tree that I modeled from a sketch I found on the internet. I put the apartment build in the background as a placeholder.


There's a bunch of other stuff that I'll save for a future post. Mostly tests or animations. I also have a large-ish project that I started on last week. We'll see if I ever complete it.

Sunday, July 25, 2010

Blog<Running> 2 Months Later

I've been running for about 2 months now, so I figured I'd share another update on the little successes (and failures) I've had along the way.

Distance

The distance is coming along slowly. I started with a .5 mile runs, and after about 3 or 4 weeks increased that to 1 mile. Since then, I've generally been trying to stick to the 10% rule (increase distance by no more than 10% every week.) Yesterday, I ran 1.3 miles, so I'm on track to break 2 miles in about a month and a half.

I have to say that the progress at this point is almost unbearably slow, but it's not just the arbitrariness (arbitrarity?) of the 10% rule that I feel is holding me back. Once I reach the 1/2 to 3/4 mile mark I kind of hit a wall where I'm suddenly not having much fun anymore. Part of it is the Dallas summer heat, and part of it is the fact that I'm not a morning person (but I have to get up early to beat the heat). And another part is that I'm just not physically conditioned for running yet. I don't feel in sync when I get to this point, like I can feel all 205 lbs of myself at every step, like some self-conscious, lumbering giant. A giraffe with lead boots. It's a big difference from the stealthy ninja feeling I have at the beginning, and I really have to concentrate to keep it smooth and relaxed.

And now I'm talking about the things I feel for the entire duration of my runs, but I'd rather not be self-conscious the entire time, especially if I ever get the point where I can run for more than 20 minutes. If it's anything like swimming, there's a point where your brain turns off while your body goes through the motions. It's kind of relaxing, almost meditative. If it exists for running, I hope I get there soon.

Barefoot Running

A couple of weeks ago, I decided to take off the VFF's and go for a real barefoot run. I mentioned it a couple of posts ago, as a way to help improve your form. Well, I tried my hand (foot?) at it a one more time since then, and it was a total disaster.

First, I made the mistake of trying it after work one day. The temperature outside was about 95 degrees, and the temperature of the sidewalk was probably 10-15 degrees hotter than that. Second, I made the mistake of only running on the sidewalk (which is a way rougher surface than the road, which I had stuck to on my previous barefoot run). And my last mistake was that I naively thought I could run the same distance as before without any problems, despite the difference in my environment.

I ran about .3 miles when I started getting "hot spots" on the balls of my feet. I pushed through it a little bit, which in retrospect should have been my sign to stop. I ran a little further when I noticed the ball of my left foot felt like it had some kind of air pocket stuck to it. I could feel it squishing a little when I landed on it. Actually, forget that. Sure, there was certainly a squishing feeling, but it was accompanied by its good friend, pain, who managed to deliver a much more intense sensation. So I stopped after only making it .4 miles, and hobbled the short distance back to my house.

The heat and friction of the sidewalk had created a blister from my 2nd to 4th metatarsal on the ball of my left foot. It was like the skin on the sole of my foot had separated from the flesh underneath, and the resulting pocket had been filled with some clear fluid. I made the mistake of popping it and then putting hydrogen peroxide on it. The peroxide actually went inside the blister where it created a layer of tiny popping bubbles, which slowly expanded to fill the void. I could have swore my foot was on fire if not for the fact that there was no accompanying seared flesh smell.

It took 3 days to heal to the point where I could walk normally again. Needless to say, I probably won't be going for any more barefoot runs after work.

Maybe in November.

Improved Form

It's crazy to look back to when I first started out with the forefoot style of running and compare my form then and now. Here's a small list of some of the things I've learned:
  • It's okay to let your heel touch the ground. Actually, the sooner it touches the ground the better, as it means you are spreading the impact across the entire surface area of your foot, and you won't put as much strain on your calf and achilles tendon. I would venture a guess that it's probably better to land on the entire foot simultaneously, but it's really hard to do without hitting heel first.
  • Don't spring off the ground with your toes. This causes a lot of stress (pain) on the top of the foot and in the ankle, and introduces an unwanted up and down motion. Instead, lift the toe and heel off the ground simultaneously. This is actually a pretty difficult motion to learn, and the slight pain in the top of my foot means I'm not good enough at it yet.
  • Focus on moving forward, not up and down. Vertical movement wastes energy. Not only that, but it adds extra stress to your foot landing. Normally, when something starts hurting (like my shins) it can be immediately remedied by minimizing my up and down motion. Bent knees help a lot here. Bend them to the point that it feels almost like you're sitting down.
  • Fast cadence with shorter strides is better. 180 steps per minute (or quicker) is recommended. With my long legs, I find this really difficult, but it does seem to keep my form smoother.
  • Don't try to control the natural inward roll of your foot. As someone with flat feet, I tend to over-pronate. For a while, I tried tensing up my foot and ankle muscles to prevent my foot from rolling inward. This just caused horrible ankle and foot pain, and gave me a bruise on the sole where I was landing. By letting my foot land naturally, I quickly ended the pain.
  • Along the lines of the previous point, don't fight through pain. Pain is there to tell you that you are doing something wrong. Continuing to repeat the painful motion will only make it worse and lead to injury. If it feels like something in your joints or bones, or like your muscle is about to give out, then either something is off in your form (you should change it up so the pain goes away), or you are doing more than your body is ready for (you should stop and build up gradually).
  • Running works your abs like crazy. A few weeks ago, I noticed that I had a mild stomach ache after a run. I thought maybe it was just a cramp, or maybe gas. When it persisted after each run, I thought that maybe my body just wasn't made for running and that my stomach was taking some kind of revenge for shrinking it down to a normal size. Well, it turns out that running with good posture and minimal upper body movement means your core has to do some stabilization, and as a result it gets a great workout. On my last run, I pressed a few fingers to my stomach and felt an almost constant low intensity flex, with a stronger flex on each step. Whatever thoughts I had of moving my ab days to coincide with my running days have now been thrown out the window.
What's next?

As I mentioned in the last post, I want to be able to run 5 miles by the end of the year. If I can keep increasing the distance by 10% every week, I'll be doing 5 mile runs in 16 weeks. However, if my recent running experience has taught me anything, progress will probably be a little slower. In any case there are 23 more weeks left this year, which seems like a reasonable time frame. Feeling motivated!

Saturday, July 17, 2010

Blog<Losing Weight> Goal Achieved!

Success!

Last week I talked about how close I was to achieving my weight loss goal. I normally do my official weigh-ins on Sunday morning, but I was so excited at the prospect of finally getting there, that I couldn't wait. My weight this morning was 205.6 lbs. That's a loss of a little over 60 lbs since January! Here are a few fun facts.
  • Total weight lost: 60 lbs
  • Time taken: 6 and a half months
  • Avg. weight lost per week: 2.14 lbs
  • Total calories burned: 210,000
  • Avg. calories burned per week: 7500
  • Change in BMI: 32.38 - 25.07 = 7.31
  • Change in BMR: 2505 - 2131 = 374 cal
Before and After

My reason for trying to lose weight was because I looked in the mirror and didn't like what I saw. In January, after over-eating at Thanksgiving, Christmas, the New Year, all of that Winter-time hibernation-mode eating, piled on top of a few years of not getting enough exercise and eating fast food all the time... after all that, I looked in the mirror and realized I needed to make a change.

Half a year ago, I used to start breathing heavily while walking up stairs. I used to get a rash from my thighs rubbing together. My feet used to get sore after standing for half an hour. I used to get acid reflux at night. The Texas heat used to bother me more. I used to struggle to lift heavy objects. I couldn't run a mile if my life depended on it. I used to depend on caffeine to get me through the day. The only positive thing about being so overweight and out of shape was that my clothes fit better than they do now.

That's not to say that the past 6 months have been peachy. I've suffered nearly every non-serious injury/malady you can think of while exercising and dieting my way into shape: shin splints, dehydration, friction blisters, runner's trots, pulled muscles, exercise-induced nausea, hyper-extended knees, crazy foot/ankle pain, hunger, caffeine-withdrawal headaches, and more sore joints than you can shake a stick at. But despite the setbacks and minor (sometimes major) discomfort, it was all worth it to get to where I am today.

Now I look in the mirror, and I don't cringe. I'm not completely happy with how I look (yet), but I love how I feel.

The Pictures

Before I started my weight loss plan, I decided to take some pictures so that I could compare my old flabby body with my new toned and firm one. It is with great embarrassment that I am now posting these pictures. Hopefully you don't need me to tell you that "old and flabby" is on the left, and "toned and firm" on the right, but I just did... so there.

Body - Front

Body - Side

Face - Front

Face - Side


What's Next?

As I mentioned earlier, I feel great, but I'm still not completely satisfied with how I look. I still have a roll of fat around my belly that I'd like to get rid of, and I'll be damned if I can't melt it off by the end of the year.

For now, the diet and exercise have become such an integral part of my life that I probably won't change much from what I've been doing. I plan on focusing more on running and generally trying to have fun during my workouts so that I can eventually transition into some kind of weight-maintenance mode.

So, my new goals for second half of the year are not quite as extreme as the first half:
  • Get down to 190 lbs (16 lbs over the next 24 weeks should be easy)
  • Be able to run 5 miles

That's it for now. See you next time!