Friday, September 25, 2015

After the Darkness

It's been a while since my last blog post, and that's because I've been pushing myself hard. After the release of our first commercial game, Deity Quest, in 2014, we've been moving full steam ahead releasing our next two commercial projects, ADventure Lib and I Can't Escape: Darkness. I've also had to balance that with freelance work on the side.

So, you might be wondering how things are going with Fancy Fish Games? It's definitely been a roller-coaster of ups and downs, and despite having released two new commercial games, we're still in as uncertain of a position as we were in the last blog post. Financially, we've been making enough in sales to cover costs and distribute some well deserved revenue share to all team members. However, we're no closer to being the full time studio we dream of, and I won't even mention how low our hourly rate comes out to be (based on hours spent and revenue received). A huge thank you to all team members for sticking with me despite that!

Projects Completed

Our latest release, I Can't Escape: Darkness, has been doing decently. Financially, it's not an out of the park success, but it's currently our best seller and will surpass my pessimistic minimum revenue (if not my optimistic maximum). Additionally, 91% of the game's Steam reviews are positive, and fans seem to really like the game, which in my book makes a successful game even if it's not a financial success. Someone even posted this discussion which really made me feel like the game was worth it despite some very uncomplimentary press reviews.

We've definitely gotten a lot of negative press reviews, which is strange given how much the players seem to love the game. It's definitely been affecting my confidence, with reviews ranging from simply negative to downright nasty (not to say that there aren't positive reviews, but the majority of them are negative). I think part of the problem with the press reviews is that they are playing specifically to review the game, and so are not really letting themselves get immersed. Several of the reviews even mention how they liked the atmosphere of the game (which is definitely the core), but then give a bad score because of things they didn't like that were more secondary.

Honestly it's more important that players like the game than press - but perhaps more players would know about the game if we had some strong reviews. Maybe it's just a bad idea to put a number on something as subjective as a game in the first place?

ADventure Lib, our small side project, was also greenlit and released on steam this year. After getting greenlit, we polished and finished up the game, and then added voice acting (which I believe adds a lot of hilarity). Since it was a small project and the game only takes about a half hour to beat, we released it for $2 on Steam - which got it a lot of players. It didn't do great financially, but many people had tons of fun with the game and even took advantage of the workshop to add their own personalized objects. For a small side project, that is about as much of a success as I could hope for, and I am definitely thinking about doing the campaign editor update so players can add their own stories and campaigns.

Projects Dropped

Some of you might have seen this coming, given the continued delays, but Havencall has been put on indefinite hold. The design still needs some work and has some rough edges, and the project is simply too big for a single artist to complete. One day, when we're a full time studio and have a budget, we hope to come back and finish this game, but until then, there are other game designs that we want to work on that are more reasonable given our team and skillset. If you want to read more about this decision, check out this IndieDB Aritcle.

What's Next?

That's an interesting question for us. At some lower moments recently, I was considering taking time off game dev and working only on projects that actually paid the bills. However, fans and friends have made it clear to me that I still do want to make games, and still love it when people enjoy playing my games. I have to finish up some other work this month, but I already have several game design documents prepared and will hopefully start one come October. I haven't decided exactly which game I will be making next, but it will likely be one of the most ambitious I've done yet. While it might not be the smartest idea to work on a big project when we're still trying to find a footing, I want to make something special, something that will stand out as a great game even among all the other great indie games that are constantly releasing. We may not be able to work full time, but we have a lot of skill and as long as we are cognizant of our strengths and weaknesses as a team when planning our projects, I think a larger project is definitely doable.

Look forward to another blog post announcing what our next game is!

Friday, January 2, 2015

A Year In Review - 2014

It's tough to believe it's already 2015! It's been a crazy year, with good times, tough times, and as always new projects. I went from overly optimistic at the end of 2013, to feeling like a complete failure in the middle of last year, and now I don't know what's going to happen, but that's what will make 2015 so exciting and is why I think looking back on this past year is a good idea.

Projects Completed in 2014

Deity Quest, my first commercial game, was released to very mixed reviews. I was definitely experimenting with interesting gameplay mechanics for this game, and sometimes they worked brilliantly and were a lot of fun. However, the game definitely has kinks - partly because the design was an experiment, and partly because I certainly didn't do enough playtesting. This caused some duller moments during combat and even stalemates that contributed to the feeling some players had that the game had a lot of grinding. Additionally, there is definitely a learning curve to the game, and a lot of players didn't learn enough of the mechanics to reach those "brilliantly fun" moments.

The content and areas definitely could have used more love as well. One thing I learned from this project is that procedural generation is not a valid replacement for hand-crafted content unless it is very thoughtfully put together (like I am attempting for I Can't Escape: Darkness) - in which case it actually takes a lot more time to develop than doing the content by hand. Procedural generation is NOT (and should not be seen as) an easy way out of designing content. Because of the very simple generation algorithms in Deity Quest, a lot of the areas seemed repetitive and featureless which was the second big reason that some players felt the game was a grind.

It was after the release and rough start of Deity Quest that I got kind of disillusioned with game development and posted this: . However, I certainly learned a lot from this project, and it was from Deity Quest that I realized my mistakes and designed more interesting procedural generation algorithms for I Can't Escape: Darkness. Deity Quest has also just gotten greenlit on steam, so perhaps that will bring a second life to the game: . I've been doing some fixes, tweaks and balance changes to the game, and I'll have another blog post when I get it up on Steam (which will hopefully be this month)!

ADventure Lib is a smaller game that I finished as a side project late in 2014. ADventure Lib's name is a pun on ad lib - it's a parody point & click style game where most of the characters, items and objects have been swapped with each other. It gets pretty ridiculous when you have to do things like defeat the fire-breathing pants, save your beloved toilet and find the potato of legend. I have yet to release ADventure Lib, mainly because I'm still trying to figure out what the best way to release it is (I have a feeling it is a fairly niche game), but this game will definitely be released in the near future (and if you're interested in playtesting, feel free to e-mail me and I may send you a beta copy).

If you're wondering why I do side-projects, I find it helps to refresh my mind, and the side projects often help me with the larger projects as well. For example I added controller support to ADventure Lib, which is being re-used to add controller support for I Can't Escape: Darkness. My favorite author, Brandon Sanderson, knows this phenomenon very well too - in his end of the year blog post he revealed that he wrote the sequel of Shadows of Self to get back on track to finishing Shadows of Self.

Ongoing Projects

I Can't Escape: Darkness is my next big project, and I am currently hoping to release a closed alpha this month. I was originally planning on releasing the full game this month, but after some playtests we discovered pacing issues that needed to be worked out, causing a minor setback. While Darkness is procedurally generated and different every playthrough, the generator is a lot more intelligent than in Deity Quest, and it can be tweaked to modify the pacing and game flow. It also has procedurally placed static event areas that have interesting art and mechanics. I know a lot of you are curious exactly what the mechanics and gameplay of I Can't Escape: Darkness will be like, but telling you too much would spoil it, as it is meant to break expectations.

What I can tell you, however, is the following:

  • There will be combat.
  • There will be puzzles.
  • Light plays an important part in the game.
  • There will be MANY tricks and traps.
  • There is a legitimate game path to escape (unlike the original where the escape was more of a hidden easter egg).
  • I still do not expect many players to escape.

Another year, and Havencall is still not done huh? Well, we did finally finish a playable version of the first third of the game in June of 2014, and submitted it to IndieCade. However, from playtests and comments from this version, it became clear that a lot of the story of the game was not coming across well - and the story is by far the best part of this game. So we've been redesigning parts of the game and focusing a lot more on how to get the story across. This means that Havencall is once again postponed, but the good news is that the game should be a LOT better when we finally finish it!


This month, I'll be finishing up some changes to Deity Quest and releasing it on Steam, and also releasing a closed alpha for I Can't Escape: Darkness. If you wish to participate in the closed alpha, simply send me an e-mail ( Relatively early this year, I also plan to release ADventure Lib, so there will be several fancy fish titles coming out one after another. I Can't Escape: Darkness will certainly be released in time for Halloween of 2015, and there should be a revised Havencall playable build this year as well.

I'll likely be getting a full time job this year, as my part time endeavors and games simply aren't making much money. However, I still plan to make games and even a 40 hour work week leaves plenty of time for that. Honestly, it will be good to have financial security and be able to work on games without worrying too much about how well they sell.

What other projects do I plan to start this year? Well, I will certainly start one of the sci-fi game projects I've been wanting to make for a while (and spaceships are Matt's specialty, so you know they will look good). I've also started creating a voxel engine using I Can't Escape: Darkness's direct/indirect lighting. The lighting is very impressive, efficient and so well suited to voxel-style games that I could not resist. I'm not spending a lot of time on the voxel engine, so it could be a while before you see it or any voxel games from fancy fish games, but I do have lots of ideas, so that may be a direction I head in the not-so-near future.

2015 is already off to a good start, and I have a feeling it could be the biggest year for Fancy Fish Games yet! Look forward to future blog posts!

Tuesday, September 30, 2014

Unit Tests - A Cautionary Tale

I'll start by saying I'm not a big fan of unit tests. I've been forced to write them before, and I always find them tedious and seldom useful. However, there are cases where unit tests are useful and can save a lot of time, headache and debugging. So even if you're like me, you should still consider when it might be a good idea to add unit tests.

First off, what are unit tests? Unit tests are where you literally write code to test a section or function of your code. As a quick example, the following function:
function square(x){return x*x;}
Might have the following unit tests:
assert square(5) == 25; //Normal case, 5 squared should be 25.
assert square(-4) == 16; //Negatives, -4 squared should be 16.
assert square(0) == 0; //Edge case, 0 squared should be 0.
This tests the function with a few inputs to ensure it has the right output. If all of the unit tests are successful, than you can assume the function is more or less correct. Later on in development, you can run the tests again to make sure that it is still correct (and that nobody messed up that bit of code).

Now you might see why I hate unit tests. They can be very tedious, and typically only work for small, deterministic functions where it's pretty obvious that it works anyways. However, the idea of using a bit of code to test a much larger and more complex section of code is pretty appealing. Instead of having to test and debug output by hand countless times to make sure it's not broken or to track down a bug, you can simply run the test and hopefully find bugs before you even release the game to testers.

Of course, as I hate unit tests, I didn't originally write any for my current game, I Can't Escape: Darkness. However, a month or so ago I made a small change to the procedural generation code of the game to add a new feature. The change was small and I didn't think it would affect any of the other code. Checking the procedurally generated layout by hand many times, everything seemed to be in working order. But that's one of the downsides of procedural generation - since it is random, there can be bugs that don't appear in the majority of generations. This is exactly what that small change did - it broke an assumption from an earlier bit of the generation code that, in a very rare case, would allow a section of the map that should've been reachable to be attached to an unreachable section (instead of attaching it to a reachable section so that the player could actually get there). A month later, a team member was playing the game, and noticed that he couldn't find an essential button he needed to progress in the game. He was stuck, and looking at the generated layout, it turned out that the button could not be pressed as it was spawned down an unreachable corridor. Oops!

I'm sure you've all encountered problems and bugs like this, and some of them can be very game-breaking like this one was. Worried that other game-breaking bugs might exist and tired of manually checking generated layouts by hand, I finally decided to add a unit test. However, I didn't add small unit tests checking each function to make sure that all the parts of the whole work. What I did was one large unit test that checked the integrity of the procedural generation as a whole (and the procedural generation section in I Can't Escape: Darkness is big - about 40 classes and 200 functions). That is the kind of unit test I view as beneficial in game development - one that checks a large section that IS changed a lot, and takes less time to code than to manually check.

The unit test I have now does higher level checks like this:
assert canEnter("vwm", "lr3"); //You should be able to enter vwm from lr3.
assert canEnter ("cr3", "vwm"); //You should be able to enter cr3 from vwm.
assert !canEnter ("cr3", "lr3"); //You should NOT be able to enter cr3 from lr3 without first going through vwm.
Where cr3, lr3 and vwm are codenames for rooms, events and areas that are generated (which I will not explain so as not to spoil what you can find in I Can't Escape: Darkness).

These checks use basic pathfinding, and there are a lot of them that do the same kinds of checks I would do by eye. It ensures that all of the buttons, events and rooms are reachable, and that there are no holes in the maze that let you reach sections that you shouldn't be able to reach (without first hitting a button to open a door or exiting an event). Yes, this took some time to write and is more complex than "normal" unit tests, but it is infinitely more useful. Now, I can run this test 1,000 times or 10,000 times, and even though some bugs may be rare with procedural generation, this test has a much higher chance to catch bugs than I do by hand. This does what unit tests were really meant to - ensure that everything is working properly and saving time.

As a quick caution, I'll mention that you should be careful your unit testing code is simple to limit the chance that it itself has bugs. There's nothing more useless than a buggy unit test that misses errors, and nothing sillier than having to write unit tests for your unit tests! The test I wrote uses hand-written checks that only relies on a pathfinder that I've used many times before and am very confident that it works without bugs. Don't write a unit test that is so complex it breaks more often than it correctly checks your code.

To conclude, I think that you should start considering where in your code a unit test would be beneficial, preferably before someone else finds a game breaking bug. You'll still need to do plenty of testing and debugging by hand, but a good unit test can save you (and others) a lot of time and headache. Whenever you find yourself having to check something often (like the generated map layouts in I Can't Escape: Darkness), ask yourself whether you could automate the process with a unit test. If you can automate it, it's not too complex and it will save you time, then it might be a good idea to write a unit test. Unit tests can be useful - just don't waste your time writing unit tests for functions like square!

Saturday, August 23, 2014

Don't Get Caught in the "Last 10%" Trap!

You may have heard the expression "the last 10% of development takes 50% of the time" or some variant of it, and while in a sense it is true, in my opinion this belief is one of the biggest problems in current game development. As a game developer, this phrase makes a lot of sense to me - I am well acquainted with the last little bit taking a lot more time than expected. However, the question really is: why do I believe that polish, testing and details are "the last little bit" of development? Why do so many people value half of a game's development time as only 10% of the project? I myself have been caught up in this common misconception, and I'm writing this blog post partially as a reminder to myself that the "last little bit" is NOT little, it is as important as the rest of game development, maybe even more so.

First off, what is this "last 10%" that is so under-valued? While this varies from developer to developer, for me, I like to think of "feature-complete" (meaning all of the features are in, and the game runs) as "almost done." This leaves polishing, tweaking, balancing, play-testing and minor details to that final 10% phase. However, from experience, I am starting to realize that this "last little bit" is actually the MOST important part of a game, and certainly worth half the development time, if not more. Thinking of it as "little" not only makes me underestimate how much work is left on a project, but it also makes me frustrated at my progress near the end and even encourages me to rush that final phase of development. But this is a dangerous trap, because no matter how much potential a game has, if this essential last phase is rushed, the game will likely turn out poorly.

A good example I saw a while ago about the importance of polishing games is Juice it or lose it: . While this video focuses more on the visual side of polishing, all of the details added in the final phase of development help make a game feel alive. Every little nuance and special touch makes a difference, even the ones that you think most people won't notice or care about. And without thorough testing and revision, you can't know how players will react to the game - where they get stuck, what parts are too easy or boring, what parts they miss or don't learn, what parts are exploitable or even buggy. No matter how good the game's mechanics are, without multiple cycles of testing and revision, players won't understand them or won't care. And no matter how amazing and original the core concept of the game is, if it's not polished and revised, it won't shine through. The "last 10%" is what brings a game to life, making it immersive and fun.

An example of a game that worked well because of the polish is Antichamber. It's mechanics, art and music are (in my opinion) very simple. I'm usually not even a fan of that style of gameplay. And yet, the game drew me in and had me playing for hours. A lot of attention to detail, content and great pacing made the game enjoyable. And, watching this video: , I realized just how much effort was put into the fine-tuning of the game. It's really telling how with every conference the developer went to, the average play time increased, from five minutes to over an hour. The game took seven years to release, but that was because he didn't stop at feature complete. He kept fixing, tweaking and improving the game until it really shined. And that's what I think made Antichamber the success it was.

Quite a few games I've played recently have had an interesting concept and a lot of potential, but fall flat somewhere due to lack of polish, often causing me to lose interest half-way through (or in some cases, not really getting started at all). This is also a major flaw with my most recent game, Deity Quest. While it has interesting mechanics and many people enjoyed it, "minor" elements kept it from really shining. Elements like the lack of animations, poor progression within locations and a complicated UI that was not very intuitive. Even though the core of Deity Quest was complete, the game was lacking the "small" elements necessary to make it completely immersive. Almost unanimously players felt that Deity Quest had a lot of "grinding" (even those who enjoyed the game). But it was not a grind because the game had particularly more battles or repetitive events than other games - it was because the pacing and progression wasn't well tested and revised, so the players weren't fully immersed in what they were doing (and without immersion, any task can become a grind). The "last 10%" can seem like just icing on the cake, but it's that icing that can make or break an entire gaming experience.

Even some of my all-time favorite games have similar problems. I recently played Lands of Lore: the Throne of Chaos, and the first half of the game was very immersive, with lots of minor details, great balancing and pacing, and it was as fun as I remembered. However, the second half started to lose that polish - even though it still had interesting puzzles and combat, the pacing and balance were off, and those minor details started disappearing (to the point where there wasn't any flavor text at all in the final dungeon). While I still completed and enjoyed the game, it definitely started to lose that magic towards the end that made it one of my favorite games. While I'm sure there were deadlines or crunching that made the developers of LoL focus on the first half (first impressions are important, after all), I would say that it's better to make a game that is well polished throughout, but only half the length.

Realizing the importance of this "last little bit," and how long it takes, will help developers (myself included) design their games and budget their time wisely so they CAN add those all important details throughout the game. Do you really want to put so much time and passion into the game's mechanics, art and music, only to skimp on a part of development that is just as vital? In fact, a part that could have more impact than any other on whether players love your game or not?

The last thing I'll mention is that the "last 10%" doesn't actually have to be the last thing you do. During development it can be nice to switch between tasks so that you don't get tired of doing the same thing every day. Polishing, tweaking and adding details is not as onerous when interspersed with other elements of development - instead it can become a fun change of pace. In my current project, I Can't Escape: Darkness, even though I'm early in development, I've already added flavor text and small details like screen shakes or wall eyes squinting when you throw a mushroom at them. Additionally, getting testing and feedback early can be very beneficial; the earlier you notice changes that need to be made, the easier it is to make those tweaks. For example, even though I know the location pacing is a major flaw in Deity Quest now, at this point it would require a large effort to fix it - I'd need to restructure and perhaps completely rewrite the location API. If I had gotten this feedback during early development, it would have been much simpler to modify.

  • Polishing, tweaking, balancing and play-testing are not little in terms of amount of work OR impact on the quality of your final game. Get that idea out of your head if it's there.
  • Believing the above are "minor" creates misconceptions that are detrimental to game development.
  • It is better to make a smaller, well polished game than a larger, poorly polished game that has trouble immersing players.
  • Polishing your game does not have to be put off to the end, it can be done during development as well. In fact, it is beneficial to get feedback and revise as early as possible (instead of just focusing on 'getting the game done' in a mad rush).
In short, a "feature complete" game is only half the battle - don't fall into the trap of underestimating or undervaluing the other half. No matter how much potential a game has or how much passion you put into it, it will fall flat without polish, like a sketch that could've been amazing if only it had been finished.

Saturday, July 19, 2014

Indirect Lighting in I Can't Escape: Darkness

In I Can't Escape: Darkness (ICED), lighting plays an important role in the gameplay. I had several game-specific requirements I needed to meet, however the resulting algorithm could easily have wider applications. In this post I'll go into some detail about my lighting approach, the steps I took to reach it, and how to implement it.

So here's the problem I faced: I won't explain the game mechanics (no spoilers!), but some areas of the map needed to be pitch black (no ambient light) for the game to work. However, direct lighting alone wouldn't be enough, as that would make the levels too dark (everything not directly lit would be pure black). Additionally, adding ambient light in an area of effect around light sources would lead to the light bleeding through walls (which would break gameplay, lighting areas that should be pitch black). 

Obviously, I needed something like global illumination with visibility, but for those of you who have done any graphics research, you'd know that this is an open problem, with lots of research and very few algorithms that would work in this case (without requiring high end graphics card). Lightmapping also doesn't work, as some of the light sources are dynamic (like the flashlight).

Knowing that true global illumination is expensive to render, I decided to use a physically inspired, but not physically accurate approach. For those hoping for an accurate, real time (even on integrated cards) global illumination algorithm, I'm sorry, I'm not a magician. However, this approach is very useful, especially for 2D games or cell based games (like ICED or Minecraft). In fact, while I don't know exactly what Minecraft does, their approach looks visually similar to mine (light does not bleed through blocks, but doesn't appear to correctly bounce off walls).

Final direct+indirect lighting in I Can't Escape: Darkness.

The Idea

The idea is actually inspired by heat transfer. Instead of bouncing light off walls in a very complicated computation, heat transfer distributes heat along a surface in an embarrassingly parallel way (well suited for graphics cards). From the heating elements (the light sources), heat spreads and attenuates over distance like light, and by varying the conduction along the surface, we can make blockers (walls) that the heat has to travel around instead of through, satisfying my "no bleeding through walls" requirement. Lets look at an image of this in action:

The top left image is the conduction of my map, where white is open space, and black is walls. I also removed a one pixel border around the walls so that the walls could receive indirect light. Gray pixels could be added to have semi-transparent cells (like partially open doors or windows). This is in 2D as I didn't care about light transfer between levels, but in a Minecraft style game, you could easily augment this algorithm as a 3D volume instead of a 2D texture.

After the conduction mask is created, I place the lights as points, shown in the top middle image. Then, by iteratively spreading out the heat using the conduction mask to block heat transfer through walls (I'll show the algorithm for this later), you get the top right image after 5 iterations, the bottom left image after 10 iterations, and the bottom right image after 20 iterations. 20 iterations was enough for my purposes, and given how fast each iteration is and how small the map is, this renders realtime even on integrated graphics cards. The bottom middle image is also 20 iterations, but has a door closed so you can see how light is blocked from the bottom left room when the door is closed, and can enter when the door opens. Note that this image has been brightened so that you can see the transfer more clearly.

If your game is 2D, simply use the resulting texture (bottom right) as the indirect lighting. Blocking cells won't allow light to leak through, and indirect light will spread throughout your scene. In ICE, by indexing this texture using the x/y coordinates of the geometry, I can get the indirect light at any given point. This is why the 1 pixel border around the walls is needed (otherwise, walls would index a blocker pixel and have no indirect lighting. Since the walls have thickness despite the border, they still correctly block light and stop bleeding). The result is as follows:

With both indirect and direct lighting. There are strong shadows from direct lighting, but instead of being pitch black, there is a little indirect light to lighten the scene. This image has been brightened to make it clearer.

With only indirect illumination. The light appears to come out of the gap, and the right wall is very dark despite the torch being towards the right (you can see the torch position from the previous image with direct lighting) . This has also been brightened.

Here is direct lighting only - as you can see, the walls and room outside are pure black, and there is a pure black shadow where the wall's corner blocks the light. The direct lighting includes dust, another lighting element of ICED that is not mentioned in this blog post. This scene has also been brightened.

As for how realistic this approach is, the answer is not very. It doesn't take height into account at all (although you could with a 3D volume texture), and the walls facing the camera are brighter than they should be, as they would only receive minor illumination from the floor and ceiling. However, it is similar to indirect illumination, and it meets all of my criteria (attenuating as it travels away from the light source, and not able to bleed through walls, it has to wrap around them).

Some interesting notes about this algorithm: in 2D, it's about as close of an approximation you can get to indirect lighting without some knowledge of the depth of the scene (as there's no way to know how light would bounce). Also, this can be extended into a pathfinding algorithm: by "hill climbing" (always traveling to the brightest cell), you could cheaply get a horde of units to travel around walls and reach the closest point (within the number of iterations).

The Implementation

Hopefully you understand the idea at this point and have a vague idea of how it works (and whether you'd want to add it to your game). Obviously, any games with complex geometry that can't be well defined in a 2D or 3D grid for the conduction mask wont work, but for blocky tile-based games, this works very well and even runs realtime on a seven year old computer (with an Nvidia GeForce 9200M GS graphics card, so not top of the line even during it's time)!

The first step is to create the conduction mask. This can be done on the CPU if the scene is relatively static, or by rendering simplified geometry to the texture. In ICED, the conduction mask is four times the size of the levels (so 128x128 for a 32x32 tile level) to allow me to remove a 1 pixel border while still having at least a 2 pixel thickness to the walls.

Next, create two floating point textures of the same size as the conduction mask - the front and back indirect lighting buffers. Render the lights as points to the front buffer (with additive blending enabled in case two points overlap). I actually rendered each light as four points, so that if a light was between cells, it would still add the correct amount of light to nearest four cells. This is the only step that is dependent on the number of lights, so even if your scene has THOUSANDS of lights, rendering thousands of points is no trouble at all (even for old computers), so this algorithm runs quickly almost regardless of how many lights in your scene. Hint: this works well with deferred rendering, as that allows you to add many direct light sources, and all you need to do is render the indirect lighting with additive blending to the direct lighting.

Finally, for each iteration, first swap the front/back buffers. Then render into the front buffer the weighted average of all adjacent pixels. This is similar to a 1 pixel radius gaussian blur, except the pixels have to also be weighted by the conduction mask to determine if light can transfer between the two pixels. Also note that this is NOT a separable kernel, because of the conduction mask. Here is the GLSL shader I wrote that computes each iteration:

The shader adds the weighted pixels from the previous pass (and keeps track of the weights), then divides by the sum of the weights. Yes, this could've been done with a double for loop, but I unrolled it by hand (uglier, but faster).

For those who like terminology, this is the laplace operator that computes the heat transfer. When your last iteration is done, the front buffer texture contains the indirect lighting that you can index by position to get the indirect light for that point in your scene! Pretty easy huh? You can also modify the weights to determine how the light spreads (in the above shader, I gave higher weights to points further from the center to get it to spread more with fewer iterations - you wouldn't want to do this if your applications was pathfinding). You can also take the square root of the indirect lighting value to slow its dropoff. But, this is the basic algorithm, and you can tweak it to work for your setup.

Side Note: Direct Lighting

I just thought I'd make a brief mention of direct lighting, since in ICED it actually uses the conduction mask for visibility! The direct lighting is pretty standard deferred rendering, but I didn't want to render a shadow map for each light source (would be slow). Instead, to compute visibility, I decided to raytrace through the conduction map since it already tells me the scene's (simplified) visibility! All I did was multiply the direct lighting by eight evenly spaced pixels in the conduction mask between the light position and the scene position. Depending on the size of each pixel in the mask, eight is probably enough to ensure that the samples will not miss a wall until the direct lighting is dark enough that visibility doesn't matter. Not a bad way to add visibility to all light sources for only eight texture reads, huh?

Saturday, May 10, 2014

Deity Quest, Havencall and the future of Fancy Fish Games

So, Deity Quest has been out for a little over a week, and it's been a bit of a slow start. We've had some sales and press, but it's definitely been a lot slower than I had hoped. Part of that was because this was my first commercial game release, and I made some mistakes with the launch (like not giving storefronts enough time to approve Deity Quest before release). But, things are just getting started - we're getting new press articles and are scheduled to release on Desura tomorrow. It's been a rough road, but now we're finally almost launched on all our storefronts. You can already buy Deity Quest on Desura using this widget:

Hopefully, as Deity Quest continues to get in the hands of players and they (hopefully) enjoy the game, word of Deity Quest will spread and we'll do a little better. However, as we start to run out of funds, and I calculate what kind of sales we'd need to stay afloat, I can't help but get a little depressed. For a first release, I should be happy for the sales and positive feedback I've already gotten and am still likely to get, but I've also finally realized that even a good number of sales isn't enough to live off of, and that I'll likely never make enough on games to make Fancy Fish Games my full time job (a dream I've had for a while now). Perhaps it would be possible if I made different kinds of games, or simple games like match 3, but I'm not willing to compromise there - if I'm not making what I want, then it's truly a job and I'd be better off working elsewhere where I'd make a lot more for my efforts.

So where does that leave Fancy Fish Games? A part-time job that doesn't bring in much money? A hobby which is subsidized by a full time job? Honestly, I don't know - the only thing I know for certain is that I'm going to finish the projects I've already started - as it'd leave a bad taste if I quit halfway. This means yes, I'm going to finish Havencall and the new space game (Codename: Pioneer). I may even make I Can't Escape: Darkness, even though I've only written a design document for it so far. But all my other great ideas? Especially These Falling Stars which I've been mulling over for years but have never had the resources to really start? Honestly, I don't know. Maybe if I get lucky, or if I save up enough from a full time job, I'll consider doing Fancy Fish Games full time in the future.

As for Havencall, we're planning to release late this year, and are working hard to complete the first world in time to submit it to the late submission deadline of IndieCade. We've been working on Havencall for a while now, and we've both improved a lot - as you can easily see from Natalie's art:

Havencall may be one of our last games, which is pretty sad, but we're going to do it right, not cutting any corners. Even if game development has to take a back seat for me in the future, I want to be able to look back on what I accomplished with pride.

On my side of Havencall, I've been setting up the scenes (the hometown and space time ruins are almost done), and adding in the UI and Dialogue systems. Havencall is definitely more of an artist's game than a programmer's game, but there's still plenty to do - especially with some features like the boss battles. I've also been working on tools that make integrating art and setting up scenes a lot easier - so that will speed up production of the second and third worlds.

Well, we'll see how things turn out - and I doubt I'm going to stop making games, although I may slow down or work on smaller games if I end up with less time for game development. While this is kind of sad - I'm happy with the games I was able to create. If Fancy Fish fails, it's not due to lack of quality, it's just that it's so hard to get noticed and succeed in today's world.

As a side note, I am now considering doing freelance work for game development. While I'm not sure I'll be able to make enough as a freelancer, I'm certainly open to offers if you like my work. And, at the end of the day, I'd prefer working on games than something else, even if the pay is less, as long as it's livable.

Wednesday, April 16, 2014

Deity Quest Complete!

It's been quite the year finishing up Deity Quest. I posted that Deity Quest was feature-complete Feb 28 of this year, and since then while the game was "done" and playable, there was so much to do. Polishing, debugging, balancing, the BETA test, marketing and tying up loose ends. I've been on that final stretch for months, and it's been rough, but the end is finally in sight! Last year, when I posted the IndieDB page for Deity Quest, I made an estimate that the release would be May 1st - which was my expected date of completion plus two months padding. It turns out I needed those two months padding, but the good news is that we're on schedule to release the game to the public on May 1st!

Whatever happens after the release date, Deity Quest has been a great experience. As my first commercial game, I had to do a lot of research and figure out things like payment processing and even entered the game for Steam Greenlight, which you can view (and vote for) here:

I also created a much improved trailer for the game, using Adobe After Effects instead of Windows Movie Maker, so I had a lot of new options to make it much better than the old trailer (like zoom, pan, etc):

Right now, I'm finishing up multiplayer battles, which was something I had contemplated adding for a while. This has really been a great learning experience for me, and should help a lot with my future commercial games, like Havencall!

Speaking of Havencall, those who have been hoping for news about Havencall for a while will be glad to hear that we are only about a month away from finishing the first world of the game. Havencall is broken up into three worlds, so that means we'll be 100% done with the first third of the game, and we already have a lot of assets for the second and third world. The expected release date for Havencall (with padding) is now October of this year - over a year beyond our initial release date, but at least we're getting there!

As for other projects I have planned to start this year, I have one pretty epic first person, 3D space game. I already have a team on board for it, but because of the scope, I'll probably end up trying to run a Kickstarter for it. It'll have great graphics, so look forward to that!

I also have plans for a sequel to I Can't Escape - so those of you who like horror and the style of I Can't Escape should look forward to that! While the game will have a similar atmosphere and mood, it will have a bunch new features, and of course many new twists & tricks. Those of you who played the original I Can't Escape should still be quite surprised!

I'll keep you posted on updates of all my projects, and get ready for the release of Deity Quest! It's been a crazy road finishing Deity Quest, and there were times I wanted to hit myself for trying a project so ambitious after only a few One Game a Months, but now that it's almost over, I feel quite satisfied, and am ready for new projects - perhaps even more ambitious in scale, more awesome and more of a challenge!