Subscribe
Email Updates

Introducing Overgrowth!
Coming soon... Overgrowth Now available for preorder!

Wolfire Games develops innovative, independent games for Mac OS, Windows, and Linux. It was started by David Rosen in 2003 to organize his open source video game contest entries. After graduating college in 2008, he was joined by his twin brother and three friends and Wolfire Games officially dove into the independent game industry!


We have finished our first shareware game, Lugaru. Please check it out here! We are currently hard at work on the sequel, Overgrowth, and you can follow our progress on the Wolfire Blog.

Wolfire’s Indie Independence Day

36 comments July 5th, 2009 by John

Today we celebrated the 4th of July with a sailing trip and a BBQ. Our journey took us under the Golden Gate Bridge, around Alcatraz and through Raccoon Strait. We saw some dolphins, seals, sea lions and other wild life. We also reflected fondly on this nautical themed SNL song. Here is one of our best shots of the Golden Gate Bridge:

I am happy to report that no men were lost at sea and when we got back, my parents presented us with a special Wolfire cake. Notice the savvy use of the internet expression FTW! We were pretty impressed.

I know not everyone who views this blog is American (Google says that only about 40% of our site traffic come from the US) but did anyone else do anything exciting for the 4th of July?

Wolfire Answers Community Questions

36 comments July 4th, 2009 by John

Everyone already knows that if they want to ask us questions, they can find us in the Public Wolfire IRC channel or on our live chat widget. However, a couple of weeks ago we announced that we would host a Q and A using fan questions on the blog. Unfortunately people asked us so many good questions that we can’t possibly fit them all into one post. But as promised, here are the answers to the top 10 most liked questions as well as a few bonus questions that grabbed our attention.

Question 1 (14 Likes)

Zacqary asks “How is Overgrowth different from other games out there today? Please answer in the form of interpretive dance.” Jo-Shadow adds that “the interpretive dance must be performed by john… in his kilt.”

You guys will be sorry you asked for this. Here it is: Watch it in HD at your own risk.

Question 2 (13 Likes)

Deor craftily submitted two questions. He asks “Do you plan to have cut-scenes in the game or will you go with the dialog system Lugaru had?” and “Are you planing on making it compatible with a gamepad?”

1. Lugaru technically had cut scenes but it sounds like you are talking about animated cut scenes. Looking at the big picture, we will probably focus first on actual gameplay elements like combat before worrying too much about cut scenes. However, we may be able to implement animated cut scenes as well.

2. We are designing Overgrowth using a keyboard and mouse but gamepad support probably won’t be too problematic. The Phoenix Engine used to support game pads, thanks to some code by Henry Kropf (who is working on the netcode) and it will likely be coming back. We agree that the Overgrowth control scheme would mesh nicely with a gamepad and for this reason we may have to see if consoles are a possibility for Overgrowth later on.

Question 3 (13 Likes)

Mickyan asks “Will there be some kind of free-roaming between missions or will it be a linear series of fighting?”

Overgrowth will be fairly linear like Lugaru. We don’t want the player to end up roaming the countryside without a clear purpose. The open-ended aspects of Overgrowth will occur during individual levels where the player will be presented with a set of objectives and have a lot of freedom to determine how best to complete those objectives (stealth vs. attacking from the front, brutality vs. non-lethal takedowns, etc.)

Question 4 (12 Likes)

Sargon asks “Do you think OG will turn out to be exactly as you planned/imagined/dreamed it will be or does its shape change as you build it?”

David and Aubrey have been thinking about Overgrowth (formerly Lugaru 2) since Lugaru came out. While we have a lot of ideas that we think will work really well, we’ve done our best not to declare concrete design decisions from a position of ignorance before we can actually playtest them in the engine. One of the nice things about being indie, is that we don’t have to commit to a rigid plan way in advance in order to satisfy investors or coordinate a bureaucratic army of developers. We can adapt to what’s working while cutting out and changing what isn’t.

Question 5 (11 likes)

Merfnad asks “Will the story be linear like Lugaru or have multiple paths?”

The story will mainly be linear because we’re just too small to be able to support an intricately branching decision tree. However we would like to include one or two decision nodes for key moments in the narrative if possible.

Also I don’t see any reason why there couldn’t be an awesome non-linear mod if fans get together and each link their mods together as different branches of one mega campaign.

Question 6 (10 likes)

Wouterken asks “Will Wolfire grow in the future, hire new staff etc. or are you guys happy with it as is?”

Figuring out how to grow will be a good problem to have because it is only something we’ll have to think about if Overgrowth is really successful. If everything goes very well, I could see us looking to grab one or two more people.

Question 7 (9 likes)

George asks “What specific tech features will Overgrowth have that almost no other modern mainstream games have and why don’t you think the mainstream games have them? What makes Overgrowth technologically unique? It would be nice to have a list even though some of these things would have inevitably been mentioned in blog posts.”

That’s a a very good question. We’re not claiming to be able to win an arms race with the mainstream market. However, while a lot of games tend to focus on one or two features to do really well, Overgrowth will be unique in the way it combines many different high-end features in one, user-friendly, moddable bundle. We will definitely want to formalize a feature list later on but for now here are the major features we are likely to brag about:

- Brutal physics-based combat (procedural animations and ragdoll phsyics)
- Streamlined and intuitive, context-based combat controls
- Levels with multiple solutions
- User-friendly level editor
- Built-in physics editor and animation editor
- Awesomium GUI system
- OffTheGrid terrain system
- Realistic lighting (fast-updating direct lighting and ambient occlusion)
- Realistic blood effects
- Integrated sky-box-dependent cubemapping and atmospheric haze

Question 8 (9 likes)

Swordarm not one question but 3, perhaps he should be disqualified.
1. Game structure? We know it will be a mostly linear level progression but what about the levels themselves? Just arena fight after arena fight or will you go for a more cinematic exp, with levels taking place in towns and cities and levels without fights? Hopefully the later.

1. In Lugaru there was only one mission structure: Kill Everyone. In Overgrowth we want to add a few more mission types. Things we are considering are: reconnaissance (obtain information/object x and bring it back), stealth (get from point A to point B without being seen), escape (get from point A to point B without getting captured/killed), race (get from point A to point B before the other guy or in a certain amount of time), assassination (kill a chosen few enemies on the map), survival (stay alive for X amount of time). Rather than try to commit to a concrete narrative this early, we’d prefer to design a story that smoothly connects the dots between the best gameplay opportunities.

2. How do you guys actually work together? How do you organize your day? Is David a benevolant dictator telling everybody what to do after breakfast or does he whip you into working before you even get the chance to have breakfast? :-)

2. We often start our day with a meeting. Once we check in to see what everyone is doing, we get to work. Our fearless leader David is indeed very benovelent. Regarding breakfast, some of us trade our morning meal for a midnight snack so that our eating habits match standard programmer waking hours which seem to be from roughly 10am to 2am.

3. First game, global recession and ridiculous high goals. How are you holding up? Do you feel the necessity to cut some of the intended features and streamline your planned game? For example the better-than-Assassin’s-Creed-and-inFamous-FreeRunning part ?

3. We’re doing fine. Thanks to Lugaru sales, preorders and personal savings we are able to make decisions based on what what we think will make Overgrowth the best game rather than worrying about what will generate the most cash the fastest. We have a prioritized list of features we want to add. We are still planning on adding the climbing system however it is lower on the list than, for instance, the fighting system.

Question 9 (9 likes)

Spinnacre asks “Do you plan to make the game free roaming? I noticed your article on non-linear gaming a while back, so will the world be bigger with the game more like an RPG or like the original Lugaru. Either way, we won’t mind, because lugaru is one hell of a game and something similar will be excellent!”

This is similar to Question 3 from Mickyan. Overgrowth will not be free roaming but will present the player with mission objectives that can be fulfilled in multiple ways.

Question 10 (9 likes)

Sparrow15 asks “With respect to Lugaru, you’ve said that the modding community has produced better content than the original game. Are you expecting the same with Overgrowth, and how does that affect how you’re building it?”

We think we’re going to be able to make the core Overgrowth campaign pretty awesome. However, in the wake of Lugaru, it’s been impossible to ignore how creative and talented the Wolfire community is. We’re still amazed that so many cool mods were made for Lugaru despite the fact that there was almost no mod support at all. For Overgrowth we want to make building , browsing and playing mods as easy as we can. One of the benefits of our open development is that we’ve been able to show people our modding tools early and gather some good feedback on what’s working and what’s not. If fans can use our tools to make a campaign that is more fun than the one we build internally, we will definitely wear that as a badge of honor.

Bonus Round

Lhorkan: Will they let you keep your beard, John?

No. When the fighting system gets linked to the animation editor so that combatants can transition seamlessly to flailing ragdolls when KOed, I promised David I would shave.

GirlFlash: how am I going to feel when playing overgrowth?

Like the hunter or the hunted.

Skofo: Will there be genitals?

*Headdesk* NO!

Wath20: Why are you guys so awesome? When did you become awesome? How can I become as awesome as you?

That’s a great question. We’re not awesome — you’re awesome. But thanks for the question, that’s definitely one of our favorites.

hymerman: When are you going to make it a game rather than an engine?

I’m not sure I like your tone Hymerman. Why can’t you be more like Wath20? :) David has already put in some fighting prototyping and more will follow soon. Right now we need finish off our physics editor and animation editor and then we should have all the core tech we need to build the game.

skraeling: On a scale of 1.7 to “OMG you’re a time traveling robot!” how awesome will Overgrowth be?

Somewhere between 42 and a whale man with a chainsaw.

Omar Balbuena: Will ninja rabbits ever wear ninja outfits?

Aubrey may design an outfit to look like something the stereo-typical ninja would wear. However, given that Overgrowth will be outdoors, it might be cool to play around with some camouflage ideas as well.

mightywarriorex : If I came to California (or happened to be there for w/e) could we go get Subway together and have a slumber party at your place?

Subway is a definite YES. Slumber party…eh…maybe not?

bobmanbob: What are your main influences for Overgrowth, any format whether it be other games, films or books?

Redwall, Watership Down, Kung Fu movies, Spaghetti Westerns, classic action films. Pretty much any game or bit of media we encounter tends to provoke a conversation about Overgrowth.

HaloFan: I’m happy to see you’ve decided to continue work on Overgrowth, but will you still be releasing Small Tank first? I’m looking forward to that one more.

We were shocked at how well the concept of Small Tank was received on April 1st. However, Overgrowth will remain our primary focus until we finish it.

Linear algebra for game developers ~ part 2

25 comments July 3rd, 2009 by David

Now that I’ve introduced vectors in Part 1, we need to look at some of the fundamental tools for working with them. The most important tools to understand are length, normalization, distance, the dot product, and the cross product. Once you wrap your mind around these concepts, and write functions to use them, you can solve most vector problems you might encounter.

Length

If we have a ship with velocity vector V (4,3), we might also want to know how fast it is going, in order to calculate how much the screen should shake or how much fuel it should use. To do that, we need to find the length (or magnitude) of vector V. The length of a vector is often written using || for short, so the length of V is |V|.

We can think of V as a right triangle with sides 4 and 3, and use the Pythagorean theorem to find the hypotenuse: x2 + y2 = h2. That is, the length of a vector H with components (x,y) is sqrt(x2+y2). So, to calculate the speed of our ship, we just use:

|V| = sqrt(42+32) = sqrt(25) = 5

Pythagorean theorem

This works with 3D vectors as well — the length of a vector with components (x,y,z) is sqrt(x2+y2+z2).

Distance

If the player P is at (3,3) and there is an explosion E at (1,2), we need to find the distance between them to see how much damage the player takes. This is easy to find by combining two tools we have already gone over: subtraction and length. We subtract P-E to get the vector between them, and then find the length of this vector to get the distance between them. The order doesn’t matter here, |E-P| will give us the same result.

Distance = |P-E| = |(3,3)-(1,2)| = |(2,1)| = sqrt(22+12) = sqrt(5) = 2.23

Distance

Normalization

When we are dealing with directions (as opposed to positions or velocities), it is important that they have unit length (length of 1). This makes life a lot easier for us. For example, let’s say there is a gun pointing in the direction of (1,0) that shoots a bullet at 20 m/s. What is the velocity of the bullet? Since the direction has length 1, we can just multiply the direction and the bullet speed to get the bullet velocity: (20,0). If the direction vector had any other length, we couldn’t do this — the bullet would be too fast or too slow.

So how do we normalize a vector? Easy, we divide each component by the vector’s length. If we want to normalize vector V with components (3,4), we just divide each component by its length, 5, to get (3/5, 4/5). Now we can use the pythagorean theorem to prove that it has length 1:

(3/5)2 + (4/5)2 = 9/25 + 16/25 = 25/25 = 1

Dot product

What is the dot product (written •)? Let’s hold off on that for a second, and look at how we calculate it. To get the dot product of two vectors, we multiply the components, and then add them together.

(a1,a2)•(b1,b2) = a1b1 + a2b2

For example, (3,2)•(1,4) = 3*1 + 2*4 = 11. This seems kind of useless at first, but lets look at a few examples:

Dot products

Here, we can see that when the vectors are pointing the same direction, the dot product is positive. When they are perpendicular, the dot product is zero, and when they point in opposite directions, it is negative. Basically, it is proportional to how much the vectors are pointing in the same direction. This is a small taste of the power of the dot product, and it’s already pretty useful!

Let’s say we have a guard at position G (1,3) facing in the direction D (1,1), with a 180° field of view. We have a hero sneaking by at position H (3,2). Is he in the guard’s field of view? We can find out by checking the sign of the dotproduct of D and V (the vector from the guard to the hero). This gives us:

V = H-G = (3,2)-(1,3) = (3-1,2-3) = (2,-1)
D•V = (1,1)•(2,-1) = 1*2+1*-1 = 2-1 = 1

Since 1 is positive, the hero is in the guard’s field of view!

Sneaking

We know that the dot product is related to the extent to which the vectors are pointing in the same direction, but what is the exact relation? It turns out that the exact equation for the dot product is:

A•B = |A||B|cosΘ

Where Θ is the angle between A and B. This allows us to solve for Θ if we want to find out the angle:

Θ = acos([A•B]/[|A||B|]).

As I mentioned before, normalizing vectors makes our life easier! If A and B are normalized, then the equation is simply:

Θ = acos(A•B)

Let’s revisit the guard scenario above, except the guard’s field of view is only 120°. First, we get the normalized vectors for the direction the guard is facing (D’), and the direction from the guard to the hero (V’). Then, we check the angle between them. If it is greater than 60° (half of the field of view), then the hero is not seen.

D’ = D/|D| = (1,1)/sqrt(12+12) = (1,1)/sqrt(2) = (0.71,0.71)
V’ = V/|V| = (2,-1)/sqrt(22+(-1)2) = (2,-1)/sqrt(5) = (0.89,-0.45)

Θ = acos(D’•V’) = acos(0.71*0.89 + 0.71*(-0.45)) = acos(0.31) = 72°

The angle between the center of the guard’s vision and the hero is 72°, so the guard does not see him!

Sneaking

I know this looks like a lot of work, and it is, because I’m doing it by hand. However, in a program, this is pretty simple. Here is what this would like in Overgrowth using the C++ vector libraries I wrote (inspired by GLSL syntax).

//Initialize starting vectors
vec2 guard_pos = vec2(1,3);
vec2 guard_facing = vec2(1,1);
vec2 hero_pos = vec2(3,2);

//Prepare normalized vectors
vec2 guard_facing_n = normalize(guard_facing);
vec2 guard_to_hero = normalize(hero_pos - guard_pos);

//Check angle
float angle = acos(dot(guard_facing_n, guard_to_hero));

Cross Product

Let’s say you have a boat that has cannons that fire to the left and right. Given that the boat is facing along the direction vector (2,1), in which directions do the cannons fire? This is easy in 2D: to rotate 90 degrees clockwise, just flip the two vector components, and then switch the sign of the second component. (a,b) becomes (b,-a). So, if the boat is facing along (2,1), the right-facing cannons fire towards (1,-2). The left-facing cannons fire in the opposite direction, so we flip both signs to get: (-1,2).

Boat

So, what if we want to do this in 3D? Let’s revisit our sailing ship. We have a vector for the direction of the mast M, going straight up (0,1,0), and the direction of the north-north-east wind W (1,0,2), and we want to find the direction the sail S should stick out in order to best catch the wind. The sail has to be perpendicular to the mast, and also perpendicular to the wind. To solve this, we can use the cross product: S = M x W.

Boat

The cross product of A(a1,a2,a3)) and B(b1,b2,b3)) is:

(a2b3-a3b2, a3b1-a1b3, a1b2-a2b1)

So now we can plug in our numbers and solve our problem:

S = MxW = (0,1,0)x(1,0,2) = ([1*2-0*0], [0*1-0*2], [0*0-1*1]) = (2,0,-1)

This is pretty ugly to do by hand. For most graphics and game work I would recommend just encapsulating it in a function like the one below, and never thinking about the details again.

vec3 cross(vec3 a, vec3 b) {
    vec3 result;
    result[0] = a[1] * b[2] - a[2] * b[1];
    result[1] = a[2] * b[0] - a[0] * b[2];
    result[2] = a[0] * b[1] - a[1] * b[0];
    return result;
}

Another common use for the cross product in games is to find surface normals — the direction that a surface is facing. For example, let’s take a triangle with vertex vectors A, B and C. How do we find the direction that the triangle is facing? It seems tricky, but we have the tools to do it now. We can use subtraction to get the direction from A to C (C-A) ‘Edge 1′ and A to B (B-A) ‘Edge 2′, and then use the cross product to find a new vector N perpendicular to both of them… the surface normal.

Triangle normal

Here is what that would like in code:

vec3 GetTriangleNormal(vec3 a, vec3 b, vec3 c) {
    vec3 edge1 = b-a;
    vec3 edge2 = c-a;
    vec3 normal = cross(edge1,edge2);
    return normal;
}

Fun fact: the basic expression for lighting in games is just N•L, where N is the surface normal, and L is the normalized light direction. This is what makes surfaces bright when they face towards the light, and dark when they don’t.

Next time

We covered what vectors are in Part 1, and now we have a solid toolbox for working with them. Next, I would like to talk about vector spaces and matrix transformations.

This post was a lot more complicated than the last one — is there anything confusing here that you have questions about?

Starting Grass

66 comments July 2nd, 2009 by Aubrey

We have started some very early groundwork for grass in Overgrowth. The first step is making a grass object so we can test out what things look like with basic object shading — next, we can figure out how to improve it!

Here is my first test asset for grass. It looks black because you are actually looking at the back facing triangles in 3DS Max. I offset the triangles facing in opposite directions so that the grass looks like it has a little thickness even when viewed on-end.

This is what the grass looks like in the engine. One of the nice things about the grass is that it gives a much better sense of scale right away. We know how tall grass is, so when we see it next to these objects, we can guess how tall they are as well.

There are still a lot of problems — for example, the black shading on the back. Real grass is translucent, and actually looks even greener when light is passing through it from the other side. It is also pretty obvious that it is the same grass object repeated over and over again, which won’t be a problem when we have more different grass objects and random orientations.

We have heard some great ideas already for grass (my personal favorite: grass waving in the breeze), but is there anything else we can do to make our grass extra cool?

Linear algebra for game developers ~ part 1

57 comments July 1st, 2009 by David

When I posted about decals last week, a number of readers commented that they would be interested in posts about linear algebra as it applies to game development. I decided if I’m going to write about that, I might as well start at the beginning! This will be review to many of you who have written games before or taken classes in kinematic physics, so please bear with me for this introductory post — I will get to more advanced topics later.

Why do we care about linear algebra?

Linear algebra is the study of vectors. If your game involves the position of an on-screen button, the direction of a camera, or the velocity of a race car, you will have to use vectors. The better you understand linear algebra, the more control you will have over the behavior of these vectors.

What is a vector?

In games, vectors are used to store positions, directions, and velocities. Here are some 2-Dimensional examples:

Grid

The position vector indicates that the man is standing two meters east of the origin, and one meter north. The velocity vector shows that in one minute, the plane moves three kilometers up, and two to the left. The direction vector tells us that the pistol is pointing to the right.

As you can see, a vector by itself is just a set of numbers — it is only given meaning by its context. For example, the vector (1,0) could be the direction for the gun as shown, but it could also be the position of a building one mile to the east of your current position, or the velocity of a snail moving right at a speed of 1 mph.

For this reason, it’s important to keep track of your units. Let’s say we have a vector V (3,5,2). This doesn’t mean much by itself. Three what? Five what? In Overgrowth, positions are always given in meters, and velocities in meters per second. The first number is east, the second is up, and the third is north. Negative numbers represent the opposite directions: west, down, and south. The position represented by (3,5,2) is 3 meters east, 5 meters up, and 2 meters north, as shown here:

3D

Now that we’ve gone over the basics of vectors, we need to know how to use them.

Vector addition

To add vectors together, you just add each component together separately. For example:

(0,1,4) + (3,-2,5) = (0+3, 1-2, 4+5) = (3,-1,9)

Why do we want to add vectors together? One of the most common applications in games for vector addition is physics integration. Any physically-based object will likely have vectors for position, velocity, and acceleration. For every frame (usually 1/60th of a second), we have to integrate these vectors — that is, add the velocity to the position, and the acceleration to the velocity.

Let’s consider the example of Mario jumping. He starts at position (0,0). As he starts the jump, his velocity is (1,3) — he is moving upwards quickly, but also to the right. His acceleration throughout is (0,-1), because gravity is pulling him downwards. Here is what his jump looks like over the course of seven more frames. The black text specifies his velocity for each frame.

Parabola

We can walk through the first couple frames by hand to see how this works.

For the first frame, we add his velocity (1,3) to his position (0,0) to get his new position (1,3). Then, we add his acceleration (0,-1) to his velocity (1,3) to get his new velocity (1,2).

We do it again for the second frame. We add his velocity (1,2) to his position (1,3) to get (2,5). Then, we add his acceleration (0,-1) to his velocity (1,2) to get (1,1).

Usually in games the player controls a character’s acceleration with the keyboard or gamepad, and the game calculates the new velocity and position using physics integration (via vector addition). Fun fact: this is the same kind of integration problem that you solve using integral calculus - we are just using an approximate brute-force approach. I found it much easier to pay attention to calculus classes by thinking about physical applications like this.

Vector subtraction

Subtraction works in the same way as addition — subtracting one component at a time. Vector subtraction is useful for getting a vector that points from one position to another. For example, let’s say the player is standing at (1,2) with a laser rifle, and an enemy robot is at (4,3). To get the vector that the laser must travel to hit the robot, you can subtract the player’s position from the robot’s position. This gives us:

(4,3)-(1,2) = (4-1, 3-2) = (3,1).

Laser

Scalar-vector multiplication

When we talk about vectors, we refer to individual numbers as scalars. For example, (3,4) is a vector, 5 is a scalar. In games, it is often useful to multiply a vector by a scalar. For example, we can simulate basic air resistance by multiplying the player’s velocity by 0.9 every frame. To do this, we just multiply each component of the vector by the scalar. If the player’s velocity is (10,20), the new velocity is:

0.9*(10,20) = (0.9*10, 0.9*20) = (9,18).

Next time

That is all anyone needs to know about vectors to make something like Mario, Pong, or Space Invaders, but there is still a lot left! For part two I would like to get to dot products, cross products, normalization, and reflection, and then part three can be about transformations and vector spaces. Does this make sense so far? Am I going too slow?