Monday, May 25, 2009

I'd have 15 cents...

If I had a nickel for each time I've written a Direct3D rendering state manager.  See how I worked today's number in there?  Pretty slick.

Anyway, the new terrain renderer is SO COOL I don't know what I can say about it.  It's coming soon and supports a ton of features, and I've finally solved some problems that I had been ignoring (point-light effects being one of them).  I'm integrating it with the other components and I'm unifying all my D3D rendering code in the process.  New (very simple) component I'm just about to write handles lights on the map.  This will essentially "allocate" lights for effects.  Since D3D can only handle 8 enabled lights at a time and the lights have to be repositioned based on the camera's location (the world moves around the camera, not the camera through the world...weird, yes), this manager will let other classes allocate and free lighting structures so that magic effects can illuminate the world.  Groovy.

Also, found a memory leak bug in the client's actor effect binding allocator.  Uploading quick update to fix that.  That reminds me, I should mention that I'm adding another new effect binding type:  scenery binding.  This will let scenery have special effects attached, so swords can have sparkles and glow.  To create the special effects for weapon attacks might be a bit difficult. Right now when an actor gets hit, it just sets a "blood" flag in the update packet.  It doesn't specify the actor that hit it, since it's obvious to a player watching and was (up till now) immaterial to the game client.  However, if a fire-sword bursts into flame when it hits a monster...that means the sword needs to register a hit or the monster needs to say who hit it. AH!  The former is much more simple to do, since landing a hit is always recorded on the server.  I can add a "special hit effect" to weapons and pass the sfx id into the attack structure, then just generate the sfx if valid when registering damage.  Piece of cake.

Ok, finished compiling back to code!

No comments: