Home » Game Development

Tag Archives: Game Development

LINQ: from IEnumerable to concrete collections

I my recent posts introducing LINQ from a game developers point of view, I mentioned several times how the many LINQ methods returning sequences of the IEnumerable<T> type do not actually return an actual collection. Instead they return a query that can be executed any number of time on the given input collection. Of course, there comes a point at ...

Read More »

Sorting and Grouping – organizing data with LINQ

Last week I introduced LINQ from the perspective of a C# game developer completely unfamiliar with the framework. Today I would like to continue exploration of LINQ by focussing on a particular set of its functionality: methods to arrange and organize data. In particular we will look into how we can sort and group our collections of items. Sorting with ...

Read More »

LINQ – a game development focused introduction

I was recently asked for some pointers on how to get started with LINQ – and to maybe write a post about that. Using LINQ virtually every day I have to admit that it had not occurred to me that a C# programmer may not be familiar with it. LINQ is a big topic, but this post is the first ...

Read More »

Optimising animation based collision volumes

Last time we talked about how we can approximate objects with complex shapes using simpler ones for our game’s physics simulation. Further, we saw how we can use an often already existing feature: a skeleton for animating sprites – or vertices of a 3d-mesh – to make our collision shapes change position, and even size, as our object deforms. Today ...

Read More »

Animation based collision volumes

There is hardly a single game that does not need some form of collision between game objects. In many cases it is enough to approximate the shape of an object by a simpler one to simplify and speed up collision detection. It is for example very common – especially in 2D games – to use circles or boxes as colliding ...

Read More »

Design patterns in game development: parsing OBJ files

Today we will take a look at a common task in game development: parsing asset files – from a code design standpoint. Using the example of Wavefront OBJ files, we will explore the usefulness of thinking about our code using design patterns. Our goal will not be to use design patterns to create code. Instead, I would like to highlight ...

Read More »

Snake. Smooth and accurate following behaviour

Following another object is one of the most basic movement behaviours an item can exhibit – both in the real world, and in games. There are many different ways in which objects can follow each other, and depending on the circumstances, different kinds of movement may be appropriate. Today we will look at one particular kind: A number of objects ...

Read More »

Automating object pooling using IDisposable and finalizers

Last week we looked into the concept of object pooling, and how it can be used to increase performance by reusing objects that are expensive to create. We also implemented a generic static class to make using object pools as simple as possible. Today I want to expand on the topic by showing how we can go even further and ...

Read More »

Reusing objects with generic object pooling

Over the last couple of months I’ve been working a lot with WPF (Windows Presentation Foundation), the popular user interface framework by Microsoft. Something that I noticed quite quickly is how expensive it can be to create WPF controls in code. It could take up to several milliseconds to create a new interface element – even simple ones. The interface ...

Read More »

Localised Crepuscular Rays

Crepuscular rays, volumetric rays, or god rays have become a common effect in games. They are used especially in first and third person games – where the player can easily look at the sky – to give the sun, moon, or other bright light sources additional impact and create atmosphere. Depending on how the effect is used it can emphasize ...

Read More »