Home » Archives for Paul Scharf

Author Archives: Paul Scharf

Paul is a self-publishing game developer. He believes that C# will play an ever growing role in the future of his industry. Next to working on a variety of projects he writes weekly technical blog posts on C#, graphics, and game development in general.

LINQ – Methods returning single values

Over the last few weeks I have been writing about the basics of LINQ, and how we can use it to organize collections of items. Today I would like to take a look at a special class of LINQ methods: those returning single elements or values, instead of an entire collection. If you are interested in more of my thoughts ...

Read More »

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 »

Using arrays to speed up static tree traversal

Over the last two weeks I wrote about how to construct and query a string prefix-trie. We used the data structure to quickly find all strings with a given prefix, and to find the longest common prefix in that list. Today we will take a look at how we can use arrays to improve performance even further. We will also ...

Read More »

Matching string prefixes using a prefix-trie 2

After discussion the general problem of matching string prefixes two weeks ago, we starting on the implementation of a prefix-trie to solve the problem efficiently last week. Our implementation so far is able to quickly construct a prefix-trie from a list of strings. What is still missing is any kind of functionality to query the data structure for information. Today ...

Read More »

Matching string prefixes using a prefix-trie

Last week we discussed the problem of matching string prefixes and designed algorithms on the basis of a sorted list of strings. Our solutions had good runtimes given the constraint, however we can do much better by using a specialised data structure instead. The data structure in question is a trie, also called radix tree or prefix tree. Today we ...

Read More »