Software by Tim Green I'm Tim. I make software.

18May/120

Ambient Occlusion without black halos

You all have seen it. The latest and greatest game comes out, you boot it up, set all graphic options to max, and find that everything has this black border around it. Depending on the game/engine, that black border might gradually smear as things move around. This is most likely the result of screen-space ambient occlusion, in one form or another. I have added SSAO to Guess What, You're Dead, but in a much more subtle way. No black smearing messes to be found here! Just a darkening of the ambient light, giving a stronger appearance of depth in dark areas (and to a lesser degree in well-lit areas).

I've posted a new video showing off my SSAO implementation. I think it looks pretty much awesome. Check the video further down. First though, I just want to post some of my thoughts about AO.

14May/120

Uploaded a project from school

I was digging through some of my school stuff today, and dug up one of my projects for a computer modeling class. I've decided to share it, so I added it to the Miscellaneous Projects page here. Go check it out!

Filed under: Uncategorized No Comments
10May/120

Text, coming soon!

I am currently in the process of adding in some text rendering support. XNA comes with some basic support, but it requires me to know ahead of time exactly what fonts and sizes I want, and if I change my mind I need to go in and edit a data file, rebuild, and try again. Also, it seems to be less-than-optimal as far as performance goes (seems to draw each character as a separate draw call and such).

So, I am using the FreeType library to generate fonts at runtime! Had to write a small wrapper around it so I can use it from my C# code, but it's pretty sweet. Each time I request a character for a given font in a given size, a cache is checked to see if that character has already been used. If it has, then no further work needs to be done. If it's not in the cache, then FreeType will render the character into a memory buffer, and then the character is packed into a giant texture containing all cached characters. While it could probably be better, the packing is pretty tight (it's not just based on a fixed size grid) and works plenty well for right now.

I don't have text rendering happening yet, but I did run a test on the cache to see how the packed textures are working. To the left you can see the results. This is every typeable character on my keyboard, in 4 font faces (2 fonts, with one of them having regular/bold/italic styles), sizes 12/15/18/21/24/27/30/33. The order the characters were added is as follows:

  • Each font was processed in a fixed order;
  • For each font, the various sizes were processed in order;
  • For each size, the characters were added in a shuffled order.

I haven't done much testing with different cache orders, but I suspect it may be improved by doing larger fonts first. However, my intention is to just add characters as they are needed, rather than taking a big chunk of time up front populating with characters that may or may not be needed. When building this texture, the rectangles of each character is recorded so that drawing a string of text is as simple as drawing a series of quads, making direct lookups in the font texture. If needed, I may extend the system to allow multiple textures if it fills up. Or, I may allow it to remove characters that have not been used for a while. But, unless I find myself running out of space, it should be fine as-is.

I am planning to allow custom effects to be used when drawing text, with hooks for using more textures and such. This should make for a pretty powerful text rendering system.

If the texture packing system works out well, I am also considering using it (or something like it) to make my sprites a little more manageable. Instead of loading every frame of every animation for every type of sprite into video memory all at once (which is a lot, even using DXT compression), I would keep all that in system memory and then pack just frames I need to draw the scene into one or more (most likely more) dynamic textures. Basically, it would work similar to Virtual Texturing/Mega Textures, except likely simpler. Of course, that depends on how quickly I can copy data into a texture, since it will be happening quite frequently.

5May/120

Portal Culling in GWYD

I finally caved an implemented a basic portal culling system in Guess What, You're Dead. I was originally avoiding it because it requires setting up portals and zones throughout a level to make it work... and I wasn't sure how I could leverage Blender to do that in a reasonable fashion. Certainly didn't want to either switch to a different program for creating the levels (which would require rewriting all my exporters and such), or making a tool for setting up portals.

But, I decided to give it a go! In Blender, I can create "Empties" which are basically a non-object with a transform. I can display them as boxes, sets of axes, cones, spheres, images, whatever. By displaying as a box, I can use an Empty to mark out a rectangular area of space (which I've used for setting initial spawn locations for enemies). This works nicely for setting up the zones for a portal system; it limits each zone to a rectangular shape, but that's not so bad. In addition, I can use Empties to mark portals -- just make them thin. Again, it limits the portals to a rectangular shape, but again not a problem. With a couple custom properties set on each portal, I can have my level all set up for portal culling!

Then, in the game code, it was pretty easy to take those Empty markers, set up the relationships between portals and zones, and do the culling. Drastically lowers the amount of stuff I'm drawing in a frame, without having to go back to the occlusion culling stuff I had before (which didn't work out so hot). So now I can cull objects so less geometry is drawn, as well as lights, so fewer light passes need to be done. Got a pretty nice framerate boost!

I've put up a new video on Youtube showing it off. Check it out below, or on my Youtube channel.

25Apr/120

“Guess What, You’re Dead!” Updated!

Finally, I've put up a new version of "Guess What, You're Dead!" There's several new things happening in the game:

  1. Handy-dandy installer for the game. Run it and it should install everything you need (DirectX, .NET 4, XNA 4, etc).
  2. New enemy. This is the subject of my most recent video.
  3. Improved performance. I've made several large steps towards better performance in the game. Still not where I want it, and it uses a ridiculous amount of video memory, but it's getting better!
  4. Yeah, that's about it... for now!

So, head over to the Guess What, You're Dead project page, and download the game!

Filed under: Uncategorized No Comments
17Apr/120

Forget Occlusion Culling! — or, how I made GWYD faster

In this post, I will discuss some recent work I have done in Guess What, You're Dead! to get it running faster. The gist of it is that I got rid of most of the occlusion culling I had added, and I switched to a deferred renderer.

27Mar/120

New “Guess What, You’re Dead!” Video

Been doing some work on Guess What, You're Dead! lately. Ideally, I'd like to see it as a full game, instead of a single-level demo type thing. Some of the things I'm working on (either currently, or planned in the near future): improved performance; more enemies; more weapons; more levels; possibly even more story-oriented gameplay!

There's a new GWYD video up on Youtube, showing off the walk cycle for a new enemy I'm working on. The footage for the enemy is already recorded, but I still have the tedious task of splitting out each different animation, making them loop, removing backgrounds, etc.

Also featured in the video, is a quick look at the occlusion culling system I am using for determining potentially visible objects and reducing the amount of geometry I send for rendering. If I can find some, I'd like to write up some articles here about some of the techniques I'm using for various things.

12Mar/120

Guess What, You’re Dead! on Youtube

While developing "Guess What, You're Dead!" I posted several videos onto Facebook, showing the game at various stages of development. Today I found out how to get those video files back onto my computer, and have posted them to Youtube. Check out my new channel here!

Filed under: General, Windows No Comments
11Feb/120

Goodbye, iPhone!

Okay, I guess this post is a little bit late. Like, a year late or something. I stopped renewing my developer status for the iPhone App Store some time ago, so my iPhone games are no longer available on the App Store.

At this time I have no plans to renew and get back into iPhone development, so those projects are probably dead. But, if people really want to see them again, I might be persuaded to re-make them for PC/Mac. Otherwise, I think I'm working on better games now, so I'll stick with those.

Tagged as: , No Comments
9Feb/120

Spam == Boring

I was just about to sort through my endless list of new spam comments, and decided I'm thoroughly bored of my Spam Comments page. So it's gone now. Much easier to just hit Delete than to censor URLs and such.