Tag Archives: XNA

Deferred lighting.

My forward rendered lighting setup almost suited my purposes, but it turned out that the limitations of the XBOX CPU limited me to far too few terrain chunks, and therefore far too few lights. To this end, I’ve been exploring … Continue reading


“Game3″ post-mortem. (Or how I learned to stop worrying and love development outside of the DBP competition.)

This game was called “Game3″ just because this is the 3rd XNA project I’ve opened on this computer, and that was the default name. I’ve put in somewhere between 500-900 hours into this project (schoolwork being mixed in there makes … Continue reading


Physics engine integrated, and sphere-terrain collision done.

Terrain collision was a little harder than I thought it would be. This is owing to the fact that the terrain is a concave body, and many contacts are possible with a single sphere and the terrain. Contrast this with … Continue reading


The physics engine (made from scratch!).

In the last few days I wrote a physics engine from scratch using a technique that no other 3D XNA physics engine (that I know of) uses yet: Speculative contact continuous collision detection. I’ve been looking for a good physics … Continue reading


Terrain changes (and the first video capture).

If you’re like me then you’re tired of seeing the terrain, and you want to see the gameplay. Sure, I want to work on nothing but the gameplay at this point. However, the gameplay takes place at night — and … Continue reading


VS2010 corruption woes and a new GPU.

I bought a new GPU today, and after installing it and restarting, visual studio decided to stop working, producing random errors (e.g. “Unable to start program. Cannot find file specified.” when trying to run the project). After wasting an hour … Continue reading

1 Comment

Status update: Point light stress testing.

Yesterday I added over 1000 (one thousand) moving point lights to the terrain. On the PC this was fine. The scene partitioning used by my forward rendering setup uses a lot of CPU time though, so on the XBOX this … Continue reading


Slope based terrain texturing.

Today I worked on getting the terrain texturing to match the new procedurally created level from yesterday. In the image above, a dead grass texture is applied to flat portions of terrain, a green texture on the edges at intermediate … Continue reading


Optimizing terrain culling.

The code that culls terrain chunks was using a 3D bounding box vs camera frustum test for each terrain chunk, which was incredibly slow. On the XBOX 360 this was taking about 4ms for ~200 intersection tests. At 60FPS you … Continue reading


Dozens of point lights with forward rendering.

I’ve spent the last few days working on spatial partitioning, object pooling code (and fighting with stackoverflow about it), and other necessary performance optimization code. Most AAA titles seem to support something like 5-6 dynamic lights. I’m sure you’ve noticed … Continue reading


Avoiding garbage collections on the compact CLR.

I haven’t posted in a few days because I’ve been working on almost purely programming related tasks, which don’t lead to pretty screenshots. I’ve been improving the efficiency of the spatial partitioning scheme, and terrain draw args sorting. Today though, … Continue reading

Posted in Coding, DBP2011, XNA | Tagged , , , | 3 Comments

Erratic development speed.

I have a priority queue of game features that need to be completed. E.g.: [-3] Pure black rolling fog to simplify fog shader. [4] Dual paraboid point light shadow map implementation [2] Terrain diffuse lighting based lightning effect. [6] Moon … Continue reading


Sky effect and bloom filter.

I’ve added a bloom filter, which every big title seems to use these days. The bloom filter takes the brightest parts of the image, blurs them, and mixes the result back into the scene. This makes lights glow, softens bright … Continue reading


Terrain point light progress.

I’ve built a GGR (Geographical Grid Registration) component for the terrain, which will permit better draw call arrangement and in particular, better effect state management when drawing many point lights — which is a goal. Since the terrain is arranged … Continue reading


Terrain lighting progress.

In order to light the terrain, normals must be generated from which we can measure the angle of a light ray’s incidence with the terrain geometry, so that we can decide how bright a terrain triangle will be. For the … Continue reading


Fixing up cracks in the terrain.

Since the terrain is made up of varying level of detail chunks, when two chunks of different detail levels meet, their edges do not match up perfectly. This results in gaps/cracks in the terrain. To fix this, I’ve created a … Continue reading


The CPU vs GPU XBOX360 speed disparity.

Today and yesterday I mostly worked on class work. Actually I mostly worked on a single assignment :/ However, I did find time to write the terrain chunk drawing loop, which implicitly builds a quadtree and tests at each recursive … Continue reading

1 Comment

Terrain started, and quadtree vs. block based LOD.

I put pathfinding on hold because when implementing a hexagonal coordinate based path finding algorithm, I realized that there would be various difficulties with dealing with constructs imposed on the world such as the terrain grid or quadtree and any … Continue reading


Path finding: What would Kirk do?

In my previous post about the challenge of path finding on the XBOX with XNA, my A* algorithm benchmarks were abysmally slow. Recall from my previous post that pathfinding was done in 3D, including diagonal movement, allowing 26 possible directions … Continue reading


The Challenge of Efficient Path Finding on the XBOX360

Yesterday, a friend taking an AI course showed me his midterm exam, and I noticed that there was an A* related question. This got me thinking about A* and after 6 hours of (trying to) make an SMT solver for … Continue reading


GUI Elements: Bars and Notifications.

Today I made a notification manager and some notifiers. This allows the game to intelligently queue notifications like notifying the user that she has a new ability or that an event is about to occur. There are now notifications at … Continue reading


HUD GUI: Health/Energy orbs.

I created the 2D overlay, the 3D holder tentacles, and I diverged somewhat from the draft designs seen in my previous post. The orb contents swirls and is composed of multiple layers — I’ve made numerous optimizations to make this … Continue reading

1 Comment

HUD GUI: Health & Energy Indicators

I actually have several possible indicators drawn out including bars, circular/spherical orbs and diegetic displays. The diegetic display would be a glowing bar drawn on the character in the game world, visible only if a 3rd person camera is always … Continue reading


Menu system started.

I’ve done a menu in XNA before, so working from that code and the gamestate management sample as examples of how to proceed, I built the following menu. Getting all of the animations and transitions right was a surprisingly long … Continue reading


DBP 2011 Entry Started

For the past two years I’ve been writing down specific ideas about a game that I’ve wanted to play for years, but no one has ever made. I have documented everything from user interface design to various algorithms to network … Continue reading


Fields vs. properties performance on the Xbox 360.

I took Sam Allen’s performance test and ran a similar test (below) on the Xbox 360 with XNA. static string _backing; // Backing store for property static string Property // Getter and setter { get { return _backing; } set … Continue reading

Posted in Coding, XNA | Tagged , , | 5 Comments

Foreach through non-primitive types creates garbage.

Time and again I have seen code like this used in XNA tutorials. effectDrawBlock.Begin(); foreach (EffectPass pass in effectDrawBlock.CurrentTechnique.Passes) { pass.Begin(); gd.DrawIndexedPrimitives(PrimitiveType.TriangleStrip, 0, 0, 35, 0, 70); pass.End(); } effectDrawBlock.End(); When you use a foreach over an array of ints … Continue reading

Posted in Coding, XNA | Tagged , | 4 Comments

ToString Garbage Creation in C#

I profiled my XNA game project today using the XNA Framework Remote Perf Monitor and discovered that I was generating about 8000 more manage objects per second than I was expecting to. It turns out that this code was generating … Continue reading

Posted in Coding, XNA | Tagged , , | 4 Comments

Convert greyscale images to Alpha8 format with a Custom Content Processor in XNA 3.1.

I noticed that at least two terrain engine examples in XNA are reading heightmap images into 4 channel textures instead of single channel textures. To create a custom content processor that will permit you to convert any Texture2D compatible input … Continue reading

Posted in Coding, XNA | Tagged , , , | 2 Comments