Thursday, April 30, 2009

Thursday, April 23, 2009

Crunch Time

I am officially in crunch time.  I only have 1 more week to work.  This is a real deadline too; if I go past the time, I can't submit my game.  I've taken a lot of steps to ensure I finish my game in time:
- I set my alarm to 9:30AM.  I'm going to be working on this from morning to late night each day.
- I deleted all of my fun bookmarks.  No distractions!  I saved my bookmarks somewhere, so I'll import them again when I'm done.
- I changed my Steam password to something I don't remember (I wrote it down).  No distractions!  not even a new Left 4 Dead update will stop me from finishing this.
- Schoolwork has been bumped from low priority to really low priority.  I have an exam Monday?  Oh well.

By the end of Thursday, I should have the whole framework of the game done, minus 2 of the 3 features (rain and lightning).  That means everything except those 2 features, aesthetics and level design.  That leaves me 1 day for lightning, 1 day for rain (which is going to be really hard), 1 day for items in the game (like puzzle elements), 2 days for Aesthetics, 1 day for making levels, and 0.5 days for testing.

I really wish I planned this out a bit earlier.

Tuesday, April 21, 2009

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

So I spent tonight working on the WindManager for my game.  From 12am -4am I was trying to debug this problem where the top left of my screen was a lot more resistant to wind movement than the bottom right, meaning that the position of the fluid cell was affecting it's properties.  I spent hours looking through the low-level fluid code, trying to find where x and y were getting multiplied wrong.  It turns out that the error was in one of my top-level WindManager functions the whole time.  I hastily wrote that simple function and didn't notice a tiny copy-paste error.   It was under my nose the whole time.   I just used up a lot of hours on something trivial.

The moral of the story is: when debugging, check your code top-down, not bottom-up.  This is usually not a problem because you should be walking through it with a debugger anyways, but my bug was not something that could be solved that way (or so I thought).  I wrongly convinced myself that the problem was in the complex fluid code, not in the function calling it.

Friday, April 17, 2009

I'm getting there

Whew.  I got a big chunk of work done today.  Now the wind automatically collides with the environment, and can push the balls around.  It's a pretty fun toy to play with so far, but I still have a long way to go to make it into a real game.

Working with dynamic fluids is really difficult; it's a pretty complex system, so any tiny error you have gets magnified and quickly evolves into a gigantic game-crashing spectacle.  One time it looked like a multi-colored infectious disease spread over my screen.  Another time it went out of control and started a huge tornado-like velocity storm.  The most common problem I'm having (not 100% resolved) is that sometimes everything just goes crazy and artifacts appear all over the screen and starts pushing the balls at the blazing speed of NaN.  Fortunately this seems to only happen when I set the velocity decay to something quite high (which would be ideal, but I can work with it). 

I'm a bit worried about performance.  The fluid system is basically calculating everything pixel by pixel.  It's iterating through a size-10,000 array about 2 dozen times every frame.  It's in it's own thread, so it runs fine, although I'm not sure if a single-core system could handle it.  I guess standard pixel shaders do that same amout of work though, so it shouldn't be too big of a problem.

Thursday, April 16, 2009

Slow

Aaaah, I'm working so slow.  The old due date passed a few days ago, and I'm not that far in.  I've just been really busy with schoolwork.  I'll have the whole day/weekend today to work on it though, so I should get a lot done in the next few days.

Saturday, April 11, 2009

Progress Z

Yay collision!  The fluid now collides with the world.  Now I have to make it push stuff around.

Wednesday, April 8, 2009

Day X+Y Progress

Progress is slow; I have a busy academic life this quarter.  One of my classes is a game class, where the whole quarter is devoted to creating a single game with a group of students.

I'm really glad for that time extension now.  Anyways, today I messed around with some fluid dynamics.   I used some code from here.  I ended up with the ability to add some very fluid looking smoke-like trails.  The goal is to use that to calculate the wind.  This is probably more complicated than necessary (I could just do simple vector calculations), but I really want the player to be able to blow wind through channels and have it intuitively push the balls around.  This enables much deeper gameplay than push-left-or-right.  Plus it looks really nice.  I need to add collision for the smoke, so it wraps around the geometry.

Friday, April 3, 2009

Day X Progress

Oops, I haven't really kept track of my progress as much as I did for my previous game.  I'm sort of just throwing things together.  Anyways, here's a screenshot:


The nice debug view, with the text overlay and bounding boxes, are already part of the Farseer Physics Engine.  So far I've been setting up the framework of the game.  I still have a lot to go.

The game is basically: move the balls to the goal using lightning, wind, and rain.  Each element will interact with different kind of balls differently, in addition charging them up for special powers.

Yellow balls get charged up by lightning.  Special power: blow up, breaking down barricades.
Green balls get charged up by wind.  Special power: pop in a puff of air, pushing stuff around.
Blue balls get charged up by rain.  Special power: turn into water, filling up gaps and flowing to hard-to-reach places (fluid dynamics is going to be a pain).

It'll basically a physics based puzzle game, somewhat reminiscent of Lemmings.

EDIT: Apparently, the contest deadline is extended for 2 weeks, to April 30th.  That's double the development time.  However, I'm going to try to finish by my original schedule, and devote the extra 2 weeks to polish.