Even the best ideas…

Brian Hook, founder of the independent game company Pyrogon, posted A Pyrogon Postmortem, an article of the reasons he believed his company failed. Read the article, it is a very interesting read.

Here are some highlights that I’ve experienced myself over the years in one way or another and echo so true with my own productions, attempts, and otherwise crap that I call software.

Publishers Never Say No, They Just Stop Answering E-Mails

Publishers will always act interested and will never say “No, we’re gonna pass”. Disinterest pulls a publisher out of the loop, which could put them at a competitive disadvantage, and saying “No” is a bridge that few publishers want to burn even with relative nobodies.

A Good Demo Is Not Enough — It Must Be Jaw Dropping

You need a killer demo, not just a good one. Talk is cheap, and a 300 page design doc, presentation, and even a team “on paper” won’t get you a deal. You have to spend time and effort putting together something that is so mind blowing the execs are flat out scared you might sign with someone else. It’s the difference between a pretty girl smiling at you and a naked pretty girl straddling your lap and licking her phone number onto your face. Publishers need to feel like the latter if you want to get a deal.

Bottom line, think small and grow. Baby steps. Don’t try building the next killer Doom 3 because you’ll still be sitting there years from now trying to catch up with hardware. There’s a reason why Valve, iD Software and other companies make the games they do. They throw millions of dollars of research into building a robust engine they can market. Doom 3. Half-Life 2. Unreal Tournament. They’re just window dressing for the real kill. The marketing and sale of the engine (and the royalties through licensing that come with them).

The guys over at GarageGames have it right. They took a AAA engine and sell it for $99. Yup, for less than a C-Note you can get a full featured engine, source code, tools, and support and build yourself a professional quality game like Tribes and Tribes 2 (which was built using the Torque engine). Will it compete with Doom 3, HL2 and others? In certain areas yes, in others no, still others it will kick ass (like the terrain engine which lets you build almost limitless sized worlds with no degradation on performance).

Grant you, combine some of the features of all of these and you would have a beast not to be reckoned with. The vast terrain engine of Torque, the seamless integration of worlds from Dungeon Siege, the dynamic physics of Half-Life 2 and the on-the-fly level compiling power of Doom 3 and you can write your own cheques.

Posted in CDX

Multiple inheritance in C#

Can you inherit from multiple classes in C#? No, the language doesn’t support it however there are ways around it.

From a design perspective you have to ask yourself, Will a Class fully represent an object? Meaning that, if we have a base class with abstract methods designed for a particular application and we know that the inheriting object will only need the methods defined in that class. We now have a valid design pattern here.

The Vehicle Car Object

Lets say we have an abstract class called “Vehicle” as well as another class called “ConstructionVehicle”. The vehicle class has methods such as Accelerate() , Stop(), and the “ConstructionVehicle” class has methods such as ExecuteDump() and TurnOnBackUpSound(). If we were only going to build a Car object and know we would only use those methods from the “Automobile” class this would be fine.

The DumpTruck Object

Now we want to create another object called “DumpTruck”. We could inherit from the Automobile class but that class does not have the methods that we need called ExecuteDump() and TurnOnBackUpSound(). If we were using a language such as C++ we could easily inherit from both classes using multiple inheritance. However, seeing C# is our language of choice, multiple inheritance is not an option, you may only inherit from one Base Class.

From Abstract Classes to Interfaces

From a design perspective we must choose a different design. C# supports what is called “Multiple Implementation”, which is to says a class can implement more than one interface. Our design now changes the “Vehicle” class and the “ConstructionVehicle” class into interfaces. Below we have

defined the two interfaces with their very simplistic methods:


interface IConstructionVehicle
{
void ExecuteDump();
void TurnOnBackUpSound();
}
interface IVehicle
{
void Accelerate();
void Stop();
void TurnOnBackUpSound();
}

If we built a class that inherited from these two interfaces we would be able to do so spanning multiple inherited interfaces. Design problem solved!

Or is it?

Explicit Interface Implementation

If you look at both interfaces defined above you’ll notice that they share in common a method of the same name “TurnOnBackUpSound()”. Problem? No, in fact C# supports what is known as “Explicit Interface Implementation”, which allows the programmer to specify which member of

which interface they want to use. Putting the Interface name in front of the member name allows this to happen as shown below.


public class DumpTruck: IEngine, IBody
{
void IEngine.Test()
{
Console.WriteLine("This is the Engine TEst");
}
void IBody.Test()
{
Console.WriteLine("This is the Body TEst");
}
}

Implementation Hiding

Another benefit to this technique is something called “Implementation Hiding”. Implementation Hiding allows the methods from the implemented interface to be hidden from the derived class unless the developer explicitly calls the interface. This technique obviously reduces the clutter for a developer.

From a theoratical point of view MI has it’s place. In many situations we need to make a decision whether to define an interface or an abstract class with same signatures. An interface and abstract class are exactly the samething except abstract class would allow some non-abstract members which can act as shared common code plus it can have protected overridable members. If MI is not supported then I have to really think whether to put my signatures in interface or an abstract class and decision would be based on limited knowledge whether client classes could have been already been derived from other class.

Microsoft says:

1. The number of places where MI is truly appropriate is actually quite small. In many cases, multiple interface inheritance can get the job done instead. In other cases, you may be able to use encapsulation and delegation.

2. Multiple implementation inheritance injects a lot of complexity into the implementation. This complexity impacts casting, layout, dispatch, field access, serialization, identity comparisons, verifiability, reflection, generics, and probably lots of other places.

So in nutshell, there’s no simple answer. If there is no MI, your ability to share common code along with abstract members might be limited but you might want to first consider refactoring your code and design before blaming the limitations of a language.

Posted in CDX

More MVP info

I received my MVP package from Microsoft and spent the better part of the weekend just reading all the NDAs and such that came with it. The MVP program is great but as with anything, it comes at a price. I’m still trying to figure out of this NDA overrides, compliments, or replaces the one we have at work with Microsoft. Can I access MVP type information for my day job or is that information I would obtain under the MVP NDA and not our corporate one. Sigh.

The MVP Global Summit for 2004 just passed so I missed out on it. I’m assuming I’ll be invited to next years because my acceptance came just after the summit. The summit is under pretty tight wraps, even by Microsoft’s standards. No reporters were allowed to listen to speeches and nobody was allowed to bring laptops or recording devices to the presentations (with a keynote speech by CEO Steve Ballmer and Windows Group VP Jim Allchin). Some MVPs did post what they could on their blogs so you can check out what little details there were here:

MVPs at the Summit – Betsy Aoki

MVP Summit – James Curran

MVP Summit – Sander Gerz

Musing from the MVP Summit – Bill Graziano

Summit Day 3 – Ambrose Little

The really interesting thing about the MVP program is that they have now launched a pilot where MVP partners will be allowed to add to the Microsoft official Knowledge Base. This is the first time people outside of MS have been allowd to add to the KB so it’s very exciting. Called the “Community Solutions Content Program for Microsoft Knowledge Base,” the inaugural program allows the company’s certified MVPs to add content to the company’s database of technical and how-to articles that fuels its online customer support system.

It seems to me that Microsoft might be walking a PR tightrope with this move. On the one hand, it’s good that they’re recognizing the efforts of independent developers to work around bugs and find innovative ways to use Microsoft products. On the other hand, isn’t that what we depend on the manufacturer for? What does it say about Microsoft to discover that they couldn’t get around to documenting some critical feature, and couldn’t even be bothered to pay an employee to do the documentation after the fact?

As a working developer, you’ve got better things to do than worry about the political implications of KB article authorship. No matter who writes them, the articles are one of the best resources around for making use of Microsoft products, and you’d be silly to ignore some or all of them just because of who wrote them.

Posted in MVP

Hurray for me

I was told (by a third party rather than Microsoft, guess they haven’t got to me yet) that I’m now the proud recipient of the 2004 MVP Award in the Microsoft SharePoint Portal Server 2003 space.

The MVP Award, which stands for “Most Valuable Professional” is an annual award given to outstanding members of Microsoft’s peer-to-peer communities (Microsoft’s words, not mine). What it really means is that I can put [MVP] after my name when posting to SharePoint newsgroups and there’s a nifty logo I can put on my website and not have the Microsoft lawyers come banging on my door.

You can view the full list of SharePoint MVPs here (Alphabetical order by first name so I’m on top, sweet).

Posted in MVP

You guys are the best

First off I really want to thank everyone for sending in emails and commenting on my last news post. I’m very happy to see there’s someone out there (I was beginning to wonder) and that in some capacity my work is useful to you.

For me it was the age old question. If you write a piece of software and nobody uses it, is it really there? Also not being able to actively participate in any chats or online discussions (time just prevents it for me) lets me know what’s working and what isn’t. I’ve learned in the past while that the only successful software created is one written with the user in mind and created using their input. Anyways, enough of the soapbox.

Over the next few weeks I’ll be cleaning up the website and trying to get the backlog of technical papers and information posted that has sat far too long on my hard drive. I’ll be doing a pretty final pass on most of the tools, specifically SimExplorer, and getting those done. I’ll also end these news posts as I don’t consider the site live anymore and will just post updates in the forums or something. Having a blog like this is great, but if there’s nothing to say for weeks on end then it’s not adding much value.

So stuff will be here, stuff will grow, and hopefully we’ll see some interesting things happen with Sims 2 and what others are doing with it. Back in a few weeks with a final news post for this site.

Posted in CDX

Microsoft and the Open Source prediction

A long time ago, in a blog far, far away a prediction was made. Microsoft would be writing programs for Linux in 2004. Maybe today we’re one step closer to that vision.

Microsoft released the source code for the Windows Installer XML (WiX) developer tool to SourceForge under the IBM Common Public License or CPL. The WiX project is the first Shared Source Initiative to go “public” on Source Forge rather than a Microsoft site. It is also the first to use an externally created Open Source license. Microsoft supports the idea that a software developer should be free to choose how they license their work and for the goals of WiX, the CPL was the right fit. This does open up the creation of MSI type install packages and possibly will bridge the problem of cross-platform tools that need to install on Linux, Windows, and Mac. All someone has to do now is write an MSI installer for the “other” platforms and they’ll be a tool to build the installation package from a single XML file spec. Nice and slick and makes for installing software a breeze (especially if you count the cost of a package like Wise or InstallShield that Open Source projects can’t afford).

An interesting quote from the lead developer, Rob Mensching’s blog: “Today, via WiX on SourceForge, you get to see the results of many people’s efforts to improve Microsoft from the inside out. I’m not exactly sure what is going to happen next but I’m sure there are quite a few people who are interested to see where this leads.”

Much more detailed information available at MSDN.

Posted in CDX