Duality Dev Update

It’s about time to put another Duality development writeup out there, and with this one I want to try a slightly different form. Getting away from the giant forum thread, we’re back to the blog.

With the recently started Duality v3.0 dev branch and continuous updates to the stable v2.x versions, there’s a lot of progress both visible and invisible to people following the binary release chain. The purpose of this split in two different versions is to reconcile the two conflicting goals of backwards compatibility and forward progress: Updating the Duality version behind a game or plugin project shouldn’t break it, so while fixing and adding features is fine, removing or changing them is not. However, as the project evolves, the requirement to maintain the same facade and feature set adds up to a constant maintenance cost that makes some things harder and pushes others beyond the threshold of viability. Old code just needs to be cleaned up once in a while, polished and streamlined – and that is exactly what v3.0 is for.

Don’t expect tons of big new features, but an improved API and the groundwork for future improvements on a more fundamental scale. That said, I’m (on a nerdy programmer-think basis) pretty excited about the things to come. You can find the full list of v3.0 issues here, and an overview on what has already been done below.

Read more …

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 …

Asset Management Improvements

I must preface this progress report with an apology: Doing PR work isn’t exactly my greatest strength and sometimes that means skipping it for a while and keeping the public out of the development loop. Sorry everyone! Here it is: A quick update.

Read more …

Duality v2.0 Changelog

Duality v2.0 is now feature-complete and, until more testing has been done, awaiting its binary release. This posting contains the full changelog since the previous v1.x release.

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 …