Breakout Progress

It’s been a while since I’ve written about my game project (or anything), but I am still managing to get bits of work done on it now and then.

I’ve added displaying of the level and number of lives, although it’s only with text so far and no fancy images.

I am currently working on refactoring the rendering system as the original drawing code had some problems. I spotted this when I tried increasing the number of bricks in the level and watched the frame-rate plummet as a result. By doing a quick test of commenting out first the drawing and then the physics code I was able to work out that the drawing code was responsible for the slow down.

Technical details below the fold if you’re interested in how I’m fixing this.

The original drawing code was quite naive and based around everything on the screen being made from a quad. Each wall was a quad and each brick was made up from 6 quads. Each quad was responsible for drawing itself and as a result each had its own Effect object which it used for drawing. This meant there were a lot of Effect objects and each one was being used each frame.

Switching between all these Effect objects led to a large amount of state change on the graphics card and therefore the drop in frame-rate. The primary goal of the refactored render system is to use as few Effect objects as possible to keep graphics state changes to a minimum. This will make it possible to draw many more objects on the screen without hurting the frame-rate much.

Hopefully, I’ll have these changes finished soon and will be able to work on adding some of the planned features.

Advertisement

Tags: , ,


Follow

Get every new post delivered to your Inbox.