I'm a software engineer who works on game development part time. I teach game development (on gamedev.stackexchange.com and lynda.com). I'm always working on something, and I'll post updates here. Let me know if there's a game development topic you want to know more about, I probably know the answer, or at least where to get one.

Wednesday, June 29, 2011


I’ve been working on Age of Goblins meta data, I created a wiki. Sort of like documenting my code, but in a more useful manner. Additionally it gives me a big picture view, and helps organize my thoughts. I don’t know if wikis are usually created before the game is complete, but it seems like it’ll save a lot of time later. I’ll continue to update that as development progresses. The wiki can be found at: wiki.ageofgoblins.com

Maybe someday I’ll have some devoted fans that can help me fill it out, ‘till then only I get to edit!

Now, to get flow working well enough to make a video!

Saturday, June 18, 2011

Behind the scenes

This week I’ve been working on some behind the scenes code changes. The user can now cycle through maps freely. There’s a button in the UI that will generate a new map. This means you can generate a map, look around to see if you like it, keep it or generate a new one right then.

Yes, that means that the maps are finite. Not the infinite world of Minecraft. I thought about making it an infinite world, even went so far as to prototype it. The problem is, that unlike Minecraft, it matters what’s happening “off screen”. I can’t just write all the chunks the camera isn’t near to disk. Do the goblins just stop working when you’re off looking at some other part of the infinite world? Of course not.

This weekend I’ll be working on smoothing unit movements with cubic splines. That means setting up some generic animation type stuff. I’m creating a class that can take the path I find with A* and use those as key frames to generate smooth movement along a cubic spline. Also I plan on getting some proper unit physics to allow for unexpected events in a path. I imagine I’ll use AABBs (axis-aligned bounding box), which should be pretty fast.

Also, stairs and ramps are in game now. The code that generates the faces for the stairs takes the number of steps as a parameter, so I can easily change the size of the steps if it works better for the goblins. I need to clean up textures on the stairs and ramps to make them not look so squished/stretched. Perhaps I’ll tackle that this weekend too.

Thursday, June 9, 2011

A light post

A light post
Lighting is at a pretty good place right now. It hasn't gone through a bunch of optimization, but it’s pretty fast. It works sort of like flow. Say we have a situation like this with a light inside a little tunnel:
The flow starts at the position of the light (of course).

The light flows through cubes that are light transparent and touches the faces of cubes that are not, and sets their color along the way.

The “flow” distance is limited by the falloff of the light. For each face the “flow” touches, I calculate the distance and the intensity, the dot product of the light vector and the normal of the face. This means that if light isn't “pointed toward” the face, it doesn't get lit. This alone works OK, but doesn't take into account solid objects, like walls.

If shadows are enabled, then before we set a face light, we check to make sure it has line-of-sight with the source. This is a bit more processing intensive. However, what’s cool is we only have to do it once! We only have to compute it again if a cube in range of the light is added or removed. Otherwise the light is “baked” into the texture of the cube. Plus I already had solid picking code, and can use it here too.

This is actually really fast, considering. The lighting is done without noticeable delay. Check out the screenshots of it in game on the gallery page. The shadows produced are a bit chunky, since it’s a per face lighting, not even per vertex or per pixel. But it’s fast and it works for me!
Perhaps later I’ll do something nifty like Minecraft and have smooth lighting.
Also, who doesn’t love SketchUp?

Wednesday, June 1, 2011

That's the name of the game

The votes are in! The name of the game is Age of Goblins. I purchased ageofgoblins.com. It will be the future domain of the game page, but for now it just points to this blog.

Additionally, I’ve posted the first video of the game. The video shows off the slice feature and unit jobs in action. You can find the video on my YouTube channel.