Thursday, October 28, 2010

Sprite Batch Optimizations

At this point of the process, with all the game play testing going on, I’m scanning the game for signs of things that make the frame rate hiccup. And at the same time I’m actually trying to break it with some of the test levels.

The good news is there’s just a few places where I’m seeing the frames skip a beat. So I headed over to the XNA….sorry…the “App Hub” boards and browse for optimization tips.

Turns out it’s best to keep a minimum number of sprite batch begin() and end() calls, as each one hits the performance a little. Good to know.

However, the bad news is, as far as I can tell. Certain things require new sprite batch calls to be executed and are unavoidable. Things like a change in the blend mode, or a pixel shader that uses a render to texture effect for an effect on the entire screen.

So, I spent some time last night scanning through all the draw statements and looking for ways to cut corners. I did catch one spot where I ended up drawing two copies of all the projectiles on top of themselves….which I wouldn’t recommend. And I think I caught one or two other places where I could merge a couple of sprite batches. But all-in-all, things were pretty tight.

I guess I’ll have to look somewhere else to untie my little performance knots.

Anyway….I just wanted to note. Since I misunderstood some earlier statements about sprite batches. Not only to you want to keep the number of sprite batches to a minimum, it’s ALSO the begin() and end() calls that slow things down a bit.

Monday, September 13, 2010

New Enemy Tests

I’m very pleased to say I’ve got the initial tests for a new enemy type in the game. It’s an enemy that turns the color of the water, making it virtually invisible. That is until you shot him at which point he “decloaks”.

This will make the “shotgun” firing mode much more effective/essential when facing levels with a lot of these creatures.

The cool thing is I was able to pull of the cloaking/decloaking effect with pixel shaders.

So far it’s turned out very well, hopefully I’ll be able to post some video soon.

Monday, September 6, 2010

Video Intro Test - *Check*

It’s a long weekend, Labor Day. And it’s been a pretty productive one.  You may even say I’ve been “on a roll” (I should probably find some wood to knock on).

Load/Save
I’ve created a custom data class for save game data and successfully saved the data with an initial “hit S to save” test. Obviously, not the final method but still…a good first test.

Video Playback
This one actually went a lot smoother than I’d ever imagined given the amount of steps and specifics of it. Anyhow, I created a test video several seconds long, exported it, imported into Deep Blue and even hooked up inputs for a smooth audio and video fade to black when the player ‘skips’ the video.

I think I’ll probably still have to tweek the code so it doesn’t stretch when going to alternate resolutions (right now it’s filling the screen by grabbing the dimensions of the viewport), but that shouldn’t cause any problems.

New Enemy Attack Effect
The storyline of Deep Blue has these gigantic jellyfish that are electrically charged. The warnings are that coming into contact with said jellyfish could potentially short out the MANTA.

So, now when the player’s ship hits a jellyfish the player loses the ability to control his ship for 5 seconds. This is indicated visually by the lights on the ship going out.

It seems to have worked out pretty well and definitely is a hazard for the player.

Play, Play, Play
The core game mechanics are all in now and (it seems) working properly. So now it’s time to play. Serious game play testing has begun time to see how people react, how the play feels and adjust the overall game attributes and see if there’s too little, or too much.

Saturday, August 7, 2010

Marine Superpower Poll

Time for a quick poll. There are so many crazy abilities that deep sea creatures have...if you had a wish, which ability would you want?


Tuesday, August 3, 2010

Interpolation Success!

I’m VERY HAPPY to say, especially after this weekend’s problems that I seem to be getting the hang of this basic Interpolator class stuff.

It’s working like a charm for the logo and splash pages and really makes a big difference in the presentation. I never did have the intro screens working quite right and now things are looking pretty sharp.

It’s too late here to keep moving forward tonight so I’m off to bed, but hopefully tomorrow I’ll be able to finish up the screen interpolations and hopefully start diving into the timer upgrade throughout the rest of the game.

On a minor note, I’ve also been chipping away at the new game art and UI.

Monday, August 2, 2010

Much Calmer Now

Ok, after saying “To heck with it!”, and '”it” being Visual Studio 2008, 2010, and any kind of converter, and any way to create a new project…I gave creating a new project one last shot which resulted in the same apparent lock up as all the other attempts before. The difference is, this time I was so frustrated I left it ‘locked up’ and walked away to do something else on another computer.

Wouldn’t you know 3 minutes later Visual Studio 2008 decided it had thought long enough about creating a new project and…did. So I saved out that new project as a timer and interpolator test project to play around with and got back to important stuff…like playing Starcraft II.

So I had plenty of time to cool down after the 2 hours or so of completely wasted time earlier today, and I was able to go through Nick G’s tutorial in a breeze.

I’m pretty sure that system is the better way to go so the next step is to go back and try implementing it again in “Deep Blue”.

The bad news is the real possibility that I could be in serious trouble if I HAVE to upgrade “Deep Blue” to a Visual Studio 2010 project…since still, only one file successfully converted.

Hopefully I can finish it before the Visual Studio 2010 project becomes a requirement.

Sunday, August 1, 2010

Full Circle

Super. The good news I guess is that I didn’t lose any code for Deep Blue in all that conversion/backup nonsense. The bad news is that I’ve now come full circle and am now where I was a few hours ago. VS 2008 opens and runs Deep Blue, and I’m unable to create a new project.

Awesome. 

I think I’m done for a while. Enough wasted time.