Saturday, 18 April 2009

BreakOut clone updated

Although I am working on one or two other ideas, I figured I should not let my first (and only) completed XNA game rust away. So, I picked up ye old shovel and upgraded some code to VS2008 and XNA 3.0. The upgrade process was quite painless - apart from an issue I picked up with XACT.

In fact XACT does not seem to be working on my machine at all. Even the XACT tool fails to play any media. I googled a bit for an answer, but could not find any good reasons for this behaviour. Luck was on my side: XNA 3.0 offers an alternative to XACT for audio processing. The game is quite simple, so it was easy to remove XACT from the code, and plug in the new pieces.

I do not know what advantage XACT has for a simple game like this one. XACT took a bit of figuring out; while the new method is very straight forward. My crystal ball says most new developers will sidestep XACT while they can.

Anyways if you are interested in trying out this very basic clone, get the zip from the release on codeplex. But calm down those high expectations -- I suspect reading the code is more interesting than playing the game :).

Sunday, 1 February 2009

Teaming Up

It is clear that collaboration does not come free. Compared to the work of a solo developer, there is definitely additional effort required to start and maintain a successful collaborative project. Collaboration is driven by the need to be part of something great, something cool, or even something profitable. Even though total satisfaction is not guaranteed, one thing cannot be denied: the team is stronger than the individual.
A few days ago, I posed a question at SA game dev to get some thoughts on the team issue. The feedback was very interesting. Here are some of the key points that were highlighted.

A "main dude" is needed for success.
* This is the guy with the full picture in his mind. He defines the project, sets it up and invites other to join. He is possibly the key contributor, and he directs and controls the work done by other (possibly part-time) contributors.
* If you want to be this dude, your attitude is important. Setup you collaborative site, but assume that you will do all the work yourself. The success of the project hinges not on the contributions of others, but on your ability to see it through.

Your idea must be pragmatic.
* The game idea must be clear. You must know how to implement the idea. Think about breaking down the idea into small milestones so that each can be reached relatively quickly.
* An alternative is to start with a small idea and finish it with some collaboration. Then come up with a more complex idea that will take the willing participants to the next level. Finish that as well. Gradually gaining collaborative momentum.

Consider the team issues before you start.
* Make sure you ideas and plans are communicated clearly. The team will function properly only if they work from the same knowledge base.
* Think about how team members will participate. Perhaps a person can choose which discipline he wants to be involved with. Maybe the idea lends itself to episodes or mini-games - giving your team members more autonomy.
* Choose tools that promotes collaboration amongst developers and also amongst artists.
* Keep in mind that some potential team members are less technical, and they may need custom written tools before they will help you. For instance, an artist might become more interested when he can view his creation in a setting that resembles the game in some way.

Saturday, 3 January 2009

Those jagged edges

After patching together the crater (described previously), I noticed a deformation at the edges of the crater's upturn. Initially, I gave it little thought and blamed it on a side-effect associated with terrains with sharp edges.

However, the subconscious mind is apparently very persistent, and a possible fix dawned on me. The four vertexes used to create the two triangles for the terrain do not (in all likelihood) line up to form a plane. The quadrilateral create by the points A,B,C and D is divided into two triangles using either the diagonal AC or the diagonal BD. In the terrain construction, the same diagonal is always chosen. The picture above illustrates the consequence -- the edges of the crater is very jagged.

Instead of a fixed choice, a better result is obtained when the diagonal is chosen with more care. Here is the rule I applied: take the diagonal that is the highest. This means that the quadrilateral will be always be convex (as seen from the outside) -- and some concave aspects of the generated terrain will disappear. In other words the terrain will have less jagged edges. To compute the highest diagonal I take the diagonal that has the largest sum of the Y component of its vertexes. Other methods also seem reasonable: for instance take the diagonal with the highest Y.

The second picture shows the same view as the first using the largest sum method. Definitely a noticeable improvement.

Thursday, 1 January 2009

Riemers Components 1.1.0

A little bit of functionality has been added since the last time I published the code, and time for a version update has arrived.

The new stuff in Version 1.1.0 is briefly described in related blog entries:
  1. The terrain weights are adjusted not only based on height, based also on the normal.
  2. A new class was added to generate heightmaps using Perlin Noise.
  3. The ability to create a larger heightmap from a small one through tiling was added.
  4. Placing volcanoes and craters on the heightmap is also possible.

If you would like to use these components in your own game, I suspect the best way is to copy code from my project to your project, and make changes to the classes as you see fit. The components were not created to be generic or to be a reusable library of sorts. It simply presents you with an approach to combine the various aspects of creating a terrain into a reasonable set of classes.

The interesting thing about class design is that it is a little bit of an artform. Like other art, not everybody like what they see, but the artist is likely to stay true to himself. Sometimes, the artist might even cut off his ear.

However, class design can also be a little bit of a science form. There is a lot to learn, and I need my ear for that, thank you very much. You may have better ideas on the class composition I did here and I invite you to share your ideas and feedback with me if you get some time.

I published the code in a zip file that can be downloaded here.