• entries
732
1562
• views
494295

161 views

Stuff I wot done:
• Shaders are back in the game engine as a material. I'm thus sitting in Rendermonkey figuring out some new cool shaders to show off. I do, however, have per-pixel lighting as well as some other cool effects. Look below.
• Material "stacks" are implemented, so you can apply many materials to a single entity in stack order. This is actually remarkably powerful, and bypasses a lot of things that I would otherwise have to use a scene graph for.
• I really should've used a scene graph with signals and slots. This is insane.
• About six assignments in a week. Yeah, I know. I hate university.
• Started work on the Amaranth project, which is a significantly less brain-damaged Propane Injector available for .NET (and with tools making it easy to port your Amaranth application to OS X!) It uses 4.7MB Mini-Mono on OS X.
• Control "feel" is seriously tightened up. Playing with an Xbox360 pad makes it feel like a console game with smooth-as-hell input and a really satisfying sense of flight. Now the keyboard+mouse mode feels like shit, so I'll have to make the mouse control better.
• Novarunner now suspends a large amount of its state successfully to and from XML (including input bindings, global configuration options, and starmap data). Eventually I'll get saved game state going.
• Coming up soon: Radar, and system "jump" features. Exciting.

As promised, here is the screenshot:
I promise some actual gameplay achievements soon.

Sexiness.

But I may be biased, seeing as I have a massive hard-on for space games in general.

Incidentally, I can sympathize with the control situation - analog controllers are just so much nicer to code flight physics for. There's always something vaguely eurgh about the keyboard, probably because it's digital, and the mouse just acts weird. I don't think I've ever done any mouse control work I really liked, and there's only one bit of keyboard flight code I've done that I can say I really enjoy using.

I really like the X3 feel, except that you guys have too many keyboard shortcuts going on. Ships seem to have the "right" amount of inertia, but nothing feels super-nimble in the X universe.

I'm definitely thinking of a mouse control scheme similar to Freelancer.

I wish I knew how to generate an infinite "dust" effect like is in X3.

Yep... getting the keyboard flight the way it was (particularly the strafing/drifting stuff) was... politically interesting. It took some hard arguing on my part but it ended up shipping in the game (in place of another, very not-fun implementation), and I'm still a tiny bit proud of it [smile]

The dust effect is really simple. There's basically a 3D cloud of billboarded particles, one quad per dust particle. The cloud is treated as a single 3D mesh object, i.e. a large set of particles moves as a unit, more or less. The actual number of billboarded thingies per cloud is rather arbitrary; experiment to get good visual results. I believe there were a few different variant clouds used to make the effect look a bit more random and less obviously repeating.

These meshes are arranged in a 3D grid of a certain size, in virtual space - NOT the same as your actual worldspace. The worldspace camera position is then used to offset the grid; basically, you do a modulus of the camera's world coordinates to find the virtual coordinates in the grid. You then render the dust particles (with only world transform, no view transform), and voila.

The only real voodoo is the stretchy effect that reflects your movement speed. The calculation goes basically like this:

Vector camera_pos_delta = [difference in camera position since last frame];
Vector v = virtual_dust_position - virtual_camera_position - camera_pos_delta;
if(v.length() > some_magic_threshold) // I don't understand this value, sorry - experiment!
{
// particle has jumped due to the modulus stuff and virtual coordinates
// reset the rotation to 0
}
else
{
// convert camera_pos_delta to a yaw and pitch rotation angle
// set particle cloud's rotation to the computed angles
// (this is a common idiom in our 3D library; I can provide code if needed)
}

particle_scale_x = Lerp(0, 100, 1.0, 0.5, v.length());
particle_scale_y = Lerp(0, 100, 1.0, 0.5, v.length());
particle_scale_z = Lerp(0, 100, 1.7, 30.0, v.length());


Most of the numbers here are total magic and found (apparently) by trial and error. Your own coordinate systems and so on will affect the optimal numbers. But that's pretty much all there is to it.

Hope that made some sense [smile]

## Create an account

Register a new account