C# Collection Initializers via Extension Methods

An interesting C# feature that I just stumbled across by accident: You can provide a custom collection initializer for any IEnumerable<T> using an extension method. It allows you to turn something like this:

into this:

by simply providing the Add method that is required for collection initializers as an extension method:

Definitely not something for everyday use, but I can imagine it could clean up some data-heavy bits of code a lot. It appears that this was introduced in C# 6.0, along with indexer initializers.

Read more …

Project Summary: “Shopfloor”

Shopfloor2Shopfloor was a small project from the “Serious Games” category that was developed for Infineon Technologies. Designed as a casual interlude in scheduled in-house trainings for employees, the goal was to create a game that would be engaging and fun to play, while at the same time providing a platform for reflecting the lessons from their everyday work.

Read more …

Conditional Details

If you’ve programmed in C# for a while, you’ve probably stumbled upon the Conditional attribute. It allows you to specify that a certain method will only be called when a certain compilation symbol is defined. Let’s check the details of that.

Read more …

Ownership Inversion in Delegates

As you probably know, I’m currently busy rewriting the Cloning system in Duality. While you can read most of my experiences doing so in my last blog entry, there is a peculiar little problem case that revealed itself just recently. It should be solved by now, but I thought it might be interesting enough for its own followup entry. Let’s call it Ownership Inversion in Delegates.

Read more …

How to Clone an Object

Making an exact copy of an object isn’t an everyday use case for most programming APIs, but there are certain tasks where the ability to do so is vital. It’s not an easy task per se, and it requires a lot of thought when executed on a larger scale. When designing a modular framework like Duality, where every user can easily add custom classes into the realm of conveniently automated behavior, things get even worse. Fingers crossed, I might finally have found a solution.

Read more …

Hats and Terrain Rendering

I’m still figuring out how many hats a single guy can wear at once. So far, my personal hat count is something around “four”, counting two jobs, studying and personal life. As it turns out, I appear to have reached a limit for now. When this semesters courses began in October, the free amount of time at my disposal once again vanished, and so did the unsteady stream of content for this blog. This is just a faint sign of life, but hey – at least I’ve got some pictures.

MateTerrainThe first one is a screenshot from job #2, where I’m developing a game that will be used in a medical context. It’s called MATE and aims at motivating young patients in doing their physical exercise using a training device – which is basically used as a custom game controller. It has one degree of freedom and the target audience is not what you’d call a “gamer”, so I’m keeping the game itself small and simple: You’re maneuvering a paper plane through a dynamically generated landscape, collect gold coins and try not to hit anything. There also is a highscore at the end of each level and a set of ghost players from previous records.

Read more …

Random Gamedesign Memo

Do you know that famous Game Designer Peter Molydeux? No, not Molyneux, silly. The oher one. He’s constantly posting game design ideas on Twitter. Most of them appear to be some kind of hilarious intellectual fall-out, but in all this crazyness, there is a creative genius hidden somewhere. If you haven’t yet, you should definitely read his tweets. Doing so for quite a while now has inspired me to write down some thoughts myself. I’d love to experiment with them, but it seems like I’m pretty occupied with Duality now, so I guess the best thing I can still do is share them.

Read more …

Bachelor Thesis

Three months and countless caffeinated drinks later, it’s finally done: My bachelor thesis has been graded and I’m back to normal life again. Since a large portion of my thesis deals with the inner workings and design descisions of Duality, it might be worth reading for anyone who is interested in the project. You can read it here. Only available in german, though.

Read more …