Monday, August 30, 2010

Blog<?> Running and Game Update


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.


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.