Saturday, August 31, 2013

The blimp game: now with blimps


There was so much more that I had in mind for this, like missiles.

But hey, it's got blimps. Plural. The end.

August Game: now with planes


So, I haven't posted here in a while. I've found this one game a month thing can take a lot out of a guy, especially when I find a game I like, and then I'll potentially burn out in that month. In months past, I've felt OK with taking a light game design to help recharge my batteries.

I thought that I was doing that this month, but maybe I ended up needing to go even lighter - I didn't finish anywhere near as much as I wanted to (it's summertime, other distractions showed up). Even so, there are elements that I really like in what I'm calling my August game. I've still got 15 hours of August, so it's not really done. And, if I held myself to the rules of the One Game A Month website, there's a little bit of leeway (96 hours! Luxury!) after the end of the month to squeak in. So, maybe I'll address some of the issues I have with the game.

Things that work:
  • Mouse steering arcade flight mechanics - I intended to do a full on flight sim flight model, but that was too much work. So, mouse up points your nose down, mouse left banks left. Simple.
  • Fullscreen - This makes a difference.
  • Quaternions, rather than a single heading angle - this took a lot of work, but it's largely working.
  • Simpler AI - I ripped out a lot of special-case AI, and the enemy planes feel about as good as before, perhaps largely due to the smooth steering.
  • Collisions deal damage - important when you're near the ground.
Things that need improvement:
  • The name of the game is "Blimp Patrol", or some such, and there aren't any blimps in the game yet.
  • Leftover art: title screen
  • Leftover art: tank damage display
  • The AI isn't great about avoiding collisions
  • The AI doesn't really take 3d into account, at all
  • The radar display should be based on 2d positions, but when you bank, the display becomes squished. This makes sense, but is weird.
  • Controls (player and AI) cause an immediate effect in plane orientation - you can bank from full left to full right in a single frame. That's not realistic. This isn't a game about realism, but still.
  • Code cleanup: there's a bunch of stuff carried forward from several games ago - including code that isn't even being used. Also, the plane logic is in a file called "tank.js".
  • The whole world is comically small. Distances were built for the tank game, and I simply reused them, even with faster moving objects.
I thought that going from 2d to 3d gameplay was going to be relatively easy, but there's a lot to think about there. In the end, I backed off a lot from most of that, just to get the game minimally playable by the end of the month. I'd still like to do a full flight sim with six degrees of freedom and a somewhat realistic aerodynamic model, but that's not this month's project, and probably not anything in 2013.

All that said, here's a URL:

And now, I'm going outside for some fresh air.




Friday, August 2, 2013

And now, Blimps.


I was mostly just screwing around in Blender, and next thing I knew, I had a blimp. Also, a low-poly fighter plane (not pictured).

I think the next game may very well be a dogfight game. Or a plane racing game. Or a blimp hunting game. Maybe all of these.

It sure would be nice if the GamePad API had better support on Linux.


I've done a little bit of investigation into aerodynamics, and the math for a simple sim seems pretty easy - you've got the force of gravity (which I understand pretty well) and one or more control surfaces (flaps, rudder, etc) that are represented by a tensor - a 3x3 matrix, which gets multiplied by the relative wind vector to create a force vector that you apply to the craft. Maybe for my game, I have two flaps (one on each wing), each of which can be in one of three positions, call them -1, 0, and 1. For each of those positions, I'll make a tensor. Because of symmetry, that's really just one set of tensors, which I use twice.

So, if both flaps are up (1, 1), the force would be pushing back (drag) and pitch the nose up. If both flaps are down (-1, -1), the force would push back (drag again) and pitch the nose down. With no flaps (0, 0), there's less drag, and less pitch. With one flap up, one flap down (1, -1), the forces on the two wings would be unequal, and the craft would be inclined to roll.

Hm, we're getting pretty close to dealing with moments of inertia, which was more math than I planned to do.