Nov 01
Today, my trusty Windows XP nuked itself, literally. I’m currently working on a small game for which I decided to post regular progress reports on my XNA developer community site (www.nuclex.org). While uploading a screenshot for todays entry via WebDAV, Windows complained about a missing DLL
I rebooted. From there on, Windows bluescreened on each boot. Using the “last known working configuration” option, windows then decided chkdsk needed to be run. When chkdsk was done, my boot partition was free of errors. Free of all data as well…
So I decided to give Windows Vista RC2 (Build 5744) a go. XNA is not officially working on Windows Vista yet, but there were people in the Microsoft XNA forums that had managed to make it run. So here’s how I did it:
- Install Windows Vista RC2
- Install Visual C# Express
- Install Visual Game Studio Express Beta 1
- Install the DirectX SDK October 2006
The Visual Game Studio Express Beta 1 will have problems registering the XNA wizards in the Visual C# Express IDE and stop with an error just before finishing the setup assistant. The assistant will not perform a rollback, however, and XNA will be usable. You just won’t have the project and class assistants available.
Also, without the DirectX SDK, Visual Game Studio Express will compile XNA applications just fine, but when you run those applications, you will get an obscure Exception from the EnsureDevice() method in the Game class’ constructor that you can’t do anything about.
Oct 16
It is done!
For the past months, I’ve secretly been working on an all-new and improved website to supersede www.lunaticsystems.com, the game programming site I built on Xaraya back in 2001.
Whilst Xaraya provided everything I ever needed, I never had the nerve to delve into Xaraya theme development to create an inviting site that didn’t cause visitors to run away screaming.
This time, things were different. The new site uses Drupal, which has a much more fluid user experience to begin with. Some modules needed minor customizations and I spent some design work changing the forum to look more like other forum systems my visitors may be accustomed to. But in overall, the decision to use Drupal saved me a lot of effort. As a result, I had much more time available to fill the site with content.
The new site now focuses on game programming in C# using the Microsoft XNA framework (successor to Managed DirectX). The new programming environment is much more productive than the C++ toolchain and I feel that the C# community in overall is also more enthusiastic.
I’d love to welcome you on my site. If you’re a fellow game programmer, you will surely find something of interest there!
Jul 02
If you haven’t realized yet, Microsoft has published free, trimmed-down versions of the Visual Studio 2005 IDE. These versions are tightly bound to one language, currently available are Visual C# Express, Visual C++ Express and (damn!) Visual Basic Express. As much as I would want to recommend SharpDevelop at the moment the Visual Studio IDE is just far more productive.
So what means trimmed down? Is it cripple-ware? Not at all! I have worked with the full Visual Studio 2005 and most of the time, I don’t even notice the difference. Some advanced enterprise tools are gone, but if you need those, you also have the money to buy the Professional Edition.
Also gone is the UML class designer. This is a bit sad, but there are free tools you can use as a replacement. Check out UML Sculptor which is really great for quick drafts.
What annoyed me a bit, thought, was that the default setup doesn’t let you switch between ‘Debug’ and ‘Release’ mode (debug mode creates unoptimized binaries suitable for debugging and release mode creates lean, fast binaries suitable for distribution to the end-user). The Express Editions do it like this: A release build is done when you press Ctrl+F5 (run without debugging) and a debug build is done when you press F5 (run in debugger).
You can, however, make the Express Editions behave like the big Visual Studio by opening the ‘Extras’ menu, choosing ‘Options’, then navigating to ‘Projects and Solutions’ where you enable ‘Show advanced build configurations’ (make sure ’show all settings’ is selected):

This also allows you to set the working directory to use when the program is launched without debugging (Ctrl+F5).
Jun 30
I took another go at CeGui# and got most of the basic stuff working again. Basic stuff means text rendering, clickable buttons and resizable windows. The more advanced widgets seem to still have some minor problems.
Rob Loach, one of the project managers, has granted me developer access to the subversion repository of this project, so I was able to merge my fork back into the main source tree. I even created a new theme from Mohsin Naqi’s SuaveOS which looks quite nice, imho:

Quite an improvement from the first screenshot I made 
Jun 21
First physics, now GUIs. CeGui is a well known GUI system for rendered GUIs, which makes it ideal for in-game display of dialogs containing buttons, checkboxes, sliders and even complex stuff like lists and combo boxes. Some time ago, the CeGui# project has ported this library to C#.
Sadly, with the fall of Realmforge, like so many other .NET game development projects, this library seems to have not been updated for quite some time. Plus the latest sources didn’t work for me. So I tried my best to get it to compile and then to work again:

Oh, well, isn’t it… uhm… fascinating?
I’ll try to fix the font rendering code next, hopfefully something useful will come out of it. Otherwise I might try porting my GUI system from the Nuclex Game Engine to .NET. It’s a bit cleaner than CeGui, but not nearly as powerful because I didn’t bother creating all the widgets. Besides, CeGui would be nicer due to its widespread use.
Want to try it for yourself?
Sure, just grab the April 2006 release of Managed DirectX (anything earlier won’t work, sorry!) and download this:
Download CeGuiSharp example application
Jun 18
Microsoft sure fucked up this one. Back in good old C++, you could decide whether you need value semantics or reference semantics right where you needed it: When the class or structure was used. In .NET, your entire data type is a so called “value type” or a “reference type”.
I don’t know what the guys were smoking when they came up with this “simplification”, but in the end, it doesn’t have a single advantage and causes loads of trouble. For example in object comparison: In C++, you had to override a single operator and you absolutely knew that this operator had to compare the values of the instances, not the object identity. That was clear, precise and implementation took only 5 lines at most.
Now .NET has “improved” upon this: You have object.Equals() and operator == and operator !=. To barely avoid code duplication is hard enough already. But then one still doesn’t know, as the user of an object, whether the object’s comparison operators will perform an object identity comparison or a value comparison, because its implementors are free to decide that on a case-by-case basis. All in all that takes you a good 20 lines of code on average - just to provide safe object comparison while you co-worker will still not know what kind of comparison is done.
And what happens if you assign one variable to another is no longer as clear and simple as it was in C++. Depending on whether you’ve got a value type or a reference type, the assignment might create a deep copy of the object or just reuse the reference. You can only be sure that a deep copy is made by explicitely calling the copy constructor — if the implementor has provided one. Again, there’s ICloneable to make it even worse. That interface is something like a brain misfire because it works for simple classes but will become utterly useless once you try it on derived classes.
Oh, and before I forget, there’s also IComparable, the ‘ref’ keyword which gives limited reference semantics to value types and from .NET 2.0 onwards also the generic version of IComparable…
Jun 15
This week I had a real motivation drive and ported most of the Opal sources to C#. What’s not yet working are joints and sensors, because my primary motivation had been to get the “simple” example from the samples folder to work. And so I did.

Oh well, it’s not like it is perfect. Imaging dropping a coin upright on a table. It would probably tumble and come to rest on its flat side. Not so in my example! Even if you dropped it so it landed on its flat side, it would magically roll around and come to rest in an upright position.
And boxes, oh, well, they land, come to rest, then start shaking like crazy only to launch themselfes skywards like grasshoppers soon after. Not really realistic, if you ask me…
I don’t really know anything about the complex math involved with physics, so if someone has an idea why this is happening (I have yet to check out if the original Opal library and native Ode do the same) and can give me any clues I’d be very grateful
In case you want to try it for yourself, you can download a binary below. The example requires the absolute latest and greatest version of managed DirectX to run. Anything earlier than MDX 2.0 from DirectX 9.0c in the April 2006 release won’t do, sorry.
Download Opal .NET example application
Press the space bar to make a random object drop from the sky!
Jun 08
For some time now I’ve been toying with physics simulation under C#. There are quite a number of good physics engines available in the C++ world like Havok, PhysX, Newton, Bullet and ODE.
My first attempt was to re-wrap Tao.ODE (which wraps native ODE as closely as possible) for my own purposes with a more .NET-like interface. This attempt was crowned with success after a mere few hours. But designing a good object model that could be used for other physics engines proved to be a lot of work…
So why not make the one definite 100% .NET physics engine by porting ODE to C#. Oh well, the basic stuff ported quite well and I tried to keep myself from modernizing the code as I progressed to obtain a 1:1 port first, then I could still turn things upside down. But I nearly went insane when porting ODE’s integrator math, so…
I decided to set my target a little lower and build my own physics engine that offered a nice object model but only basic features for the first version. Maybe I could attract some of the people that actually understand the more complicated stuff and collaboratively expand this engine. First I needed a strong library for the core math and geometrical stuff. This step is done, the fruits of this work are now available in Form of the two assemblies Nuclex.Math and Nuclex.Geometry. Still…
Writing a physics engine on top of that is still an idea that I’d like to follow through, only that I’ll take months before anything useful will surface. That’s why I’m now back to Tao.ODE and my original re-wrapper. It’ll give me results quickly and not compromise portability to mono.
Recent Comments