Oh lord. It looks like I’ve caused a bit of a stir in the Day of Defeat:Source Modelling forums this past week – custom player models that actually work on-line.

Back in the days of Day of Defeat on the Goldsrc engine, we had a really busy custom player model scene. People were producing models for different countries, armies, regiments, units, etc. There were lots to choose from and customising DoD to your liking was a big thing.

When Valve released Day of Defeat:Source they implemented a file consistency checking system which is designed to prevent people from cheating by using heavily modified models that might give an advantage on-line. This consistency check, in it’s earliest incarnation, pretty much blocked all custom player models and led to a lot of talented character modellers quitting the scene. Why waste all those man hours making a kick ass player model if no-one can ever use it?

HL2 NPC in  Day of Defeat:Source

Test 1 – HL2 NPC in DoD:S

A little later, Valve released an addition to the consistency check called pure servers which in theory allowed server admins to permit custom player models or force the player to use the defaults from the GCF file. This is all well and good, but the consistency check is still invoked and your custom model can still fail at that!

Well I love a challenge and seeing people struggle to make even the smallest of edits to the default player models I figured I’d have a go at solving this mystery once and for all.

Modified default player model in  Day of Defeat:Source

Test 2 – Modified player model.

I’m lucky because I have a reasonably good relationship with some of the guys at Valve so Matt Boone, DoD’s main coder, gave me some of the numbers specifc to DoD and Mike Durand was kind enough to show me the source code for the entire consistency check function. Pure gold when it comes to figuring this stuff out and what exactly is making these models fail.

My test case, which proved successful, was to compile one of the default HL2 NPC characters from the Source SDK to work on-line with DoD:S. It worked, but took a fair bit of hacking and experiementation to not trip the check. From that experiment came a simple “proper” hack – replace the steel helmet on the German assualt class with a M43 field cap – a throw back to the DoD 1.3 days.

Highly customised German player model

It didn’t take long for customisation to begin…

After posting a breakdown of how the consistency check works and then a kit of files for correctly compiling custom models so that they pass the check, things have started to take off again. Already people have started re-skinning and improving my cap model, people are starting to suggest other modifications to the player models and a few have actually started re-working and customising new ones.

I really hope this sees a resurgence in the custom player model scene of old and gives DoD:S a healthy shot in the arm.

I posted full details on the consistency check on the Day of Defeat:Source forums, but for those that want to know, heres a brief summary of how the consistency check works:

  • Models are CRC checked against those on the server. This is skipped though when pure servers allow custom models.
  • Models have their bounds checked against a pre-defined set of ranges. These bounds are calculated when the model is compiled and represent the absolute limit that any part of the models mesh reaches during any animation sequence. These limits can be represented as a bounding box, which is compared against a bounding box defined in game. If any part of your models bounds exceed the game’s, it fails.
  • All materials used on the model must be “simple” – i.e. they use only the VertexLitGeneric shader, a diffuse, normal and phong maps. Certain other paramters are allowed but anything else results in the material being rejects and the model failing.

I believe all the current Valve Source based multiplayer games use this check so it may prove useful for CS:S and HL2:DM too.

So I took my first tentative steps at programming the Vista shell today. Oh sweet lord what have I gotten myself into…

First up was the problem of actually getting Vista set-up so I could work with it. As I’m going to need 32-bit and 64-bit versions for development I ended up using VMWare Workstation 6 and installing a virtual machine for each version. I must admit I’m impressed with VMWare, especially the fact it lets me run a 64-bit virtual machine on a 32-bit host OS. How it does it I do not know but anything that saves me having to re-partition my hard disk to run a new OS for development is just fine by me!

So my first task was to look at updating my VTF Shell Extensions for Vista. The old versions did work but need to be installed under compatibility mode. If I’m going to port them to 64-bit versions I also need to move them from Visual Studio 2003 to 2005. The Visual Studio upgrade was pretty flawless and I only had to change a couple of small things codewise to get it to compile.

VTF Thumbnails in Vista

Holy crap! It works in Vista!

I’d been considering looking at the new IThumbnailProvider interface that Microsoft provides specifically for Vista but I decided to stick with IExtractImage. Vista still supports this interface and testing the plug-in, it still works as expected and the thumbnails are drawn to my liking. I do have to say, I love the way you can scale up the size of the thumbnails – very handy when you’re trying to find a texture.

Since the last version of my VTF shell extensions, I’ve been added a few more functions to it to try and make it as useful as possible. Things like more informative tool-tips, better column info support and possible a properties sheet with all the data on the texture. Some of these functions came about for a “special” version (1.0.4) which I wrote for Valve to use in-house.

What has thrown a spanner in the works for me is that Vista no longer supports some of the interfaces I was using for these extras. IColumnProvider which I was using for the extra info columns in detail view has gone and been replaced by Property Handlers. I’m still chewing through the documentation for these and trying to get the SDK sample to work but it seems I’m not the only one having issues.

So at this point it time it seems that the next release, 1.0.5, will be the updated extensions for W2k/XP, Thumbnail view only for Vista and hopefully 32-bit and 64-bit versions. Oh and maybe an installer which doesn’t make Vista light up like a christmas tree.

In the meantime, if anyones had any luck with property handlers with Vista, let me know.