Mad Props!

Omniscience is just a Google-search away.

Login

You're reading Mabsterama, the weblog of Matt Hamilton. Enjoy your stay.

Next Generation Animation Engine

Check this out. LucasArts are working on an engine that blends artificial intelligence with ragdoll physics, so you can let your characters interact with the environment as if they were living people, rather than just dead bodies.

No new videos in that article, but some older ones that are pretty amazing.

I'm sure it won't be long before we see games on the Xbox 360 featuring this sort of technology - it certainly has power enough for it.

Smart Paster Visual Studio Addin

Pete and I were working on a project this afternoon, and it involved building queries in Sql Server Query Analyzer, then copying them over into our code.

As you can imagine, the process of pasting a multi-line query into our code then converting it to a multi-line literal string was quite a chore, so I decided to go looking for a way to speed it up.

Before long I found Alex Papadimoulis' Smart Paster addin for Visual Studio. It lets you paste the clipboard contents in a variety of formats, including a literal string. You can even define whether you want carriage returns and indentation preserved in the string! This was a real time saver, so go grab it if you find yourself repeating that tiresome "insert quotes and plus-signs" chore.

One addition I'd like to see: The ability to specify whether the plus-signs appear at the end or beginning of the lines. Alex seems to prefer that they appear at the end, whereas I like 'em at the begining of the subsequent line.

Service Factory Blogcast

Don Smith is releasing a series of blogcasts (part one, part two) about the "Service Factory" project he's working on.

I don't know if I'll get any use out of it in the foreseeable future, but the videos themselves are interesting as an insight into creating WCF services, so go take a look.

Feature Requests you Never Want to Hear

Remember the days back in DOS when the only sound you could make was a system beep, which came through the PC's speaker?

We're currently rewriting a decades-old DOS program in .NET 2.0, bringing it well-and-truly up to date, and today we received this feature request from a user:

The old program used to make a "ding" sound when I did something wrong, even if my sound was turned off. This one should too.

Make a sound even when your sound is turned off ... the first in what might be a series of feature requests you never want to hear.

Don't Subscribe to Your Own Events?

Help me out here, guys.

A long while back I remember reading an article about designing controls in .NET, and one of the guidelines the author put forward was, "don't subscribe to your own events."

Basically he was saying that a control shouldn't make use of its own public events. For example, if your have a Click event, and you need to take some custom action when the user clicks on your control, you shouldn't handle your own Click event. Instead you should put your custom code in the OnClick protected virtual method.

Does this ring a bell to anyone out there? Where would I have read this?

I've started taking this on board with Form events. I try not to handle Form.Load any more: instead I override the protected OnLoad method. That way I'm not using the event subscription mechanism to call my code, and it also makes it really easy to remove the code (since there's no extra bits in Form1.Designer.cs to worry about).

Big Cheese of the South Seas

All right! Just completed Hexic HD for the first time, receiving the "Big Cheese of the South Seas" badge!

Only two more achievements to go (one of which looks next to impossible).

Xbox 360 Goings-On

Ghost Recon: Advanced WarfighterThis weekend I finished Ghost Recon: Advanced Warfighter on normal difficulty. Y'know, a few days after buying this I was seriously considering returning it. I didn't think I'd enjoy it as much as I did. It turned out to be a really fun (if not a little stressful) game. When I finally get my RGB SCART cable for the 360, and therefore have 5.1 surround sound, I'll restart it on the "hard" difficulty level and see how I go.

Geometry WarsSince I'm waiting for that, I thought I'd charge up my Xbox Live Marketplace account with some gamer credits, and purchased Geometry Wars for around $7 Aus. This is one frantic game! Things going on all over the shop. Think of it as Asteroids taken to the next level. Oh ... and if you're the sort of person who buys or hires 360 games just to get more achievements (and therefore gamer-points), don't worry about Geometry Wars. The achievements are just crazy! I've managed to score 100,000 points, which was the first achievement, and it only got me 5 gamer points.

While we're on the topic of all-things-Xbox-360: I have jumped ship and started using Transcode360 to watch DivX movies. It was worth changing from the product I was using ... T360 allows you to pause, fast-forward, rewind etc without having to back out into the Media Center interface. It's seamless, which is great.

InitializeComponent() ... Again

Wow. I just tracked down a bug that has been pwning me for some time.

We had some UserControls in our application whose "tab" behaviour was really weird. Some controls you could tab from one to the next without any difficulties, others required two presses of the Tab key. You'd hit Tab once, and focus would seem to disappear, then hitting Tab again would bring focus to the next control.

On top of that, there were one or two UserControls where you could sometimes see a button underneath (and slightly to the left of) another button. Clicking on this "phantom button" had no effect, but it was ugly and needed to be removed.

These UserControls are all inherited from a common ancestor, who in turn inherits from another UserControl, so it was a bit of a pain to debug where these tab problems and phantom buttons were coming from, but I finally worked it out today.

It turns out that we had overloaded the constructor of one of the ancestor UserControls, to do this:

 public GridControlPage(AgentBase a): this() { InitializeComponent(); agent = a; } 

See the problem? Well, it's not immediately obvious until you remember that the default constructor for a UserControl already calls InitializeComponent!!!

So when our UserControl was constructed, it would add all of its controls to itself, then add them all a second time! The fact that certain controls were disabled by default meant that not every control was part of the tab order, and since they were all being placed in exactly the same spot the second time around, they were, for the most part, completely hidden from view.

So anyway ... the moral of the story is to watch for duplicate calls to InitializeComponent. It kind of makes me wish that InitializeComponent was a virtual protected method that was called from System.Windows.Forms.ContainerControl's constructor, so derived forms didn't have to worry about calling it.

Reset IIS on a Remote Server

A little tip I learned today.

By now a lot of people are aware of the command-line utility "iisreset", which can be used to stop, then restart all the IIS services on your PC. This command is really handy if you quickly need to restart IIS to get a web application working.

What I discovered today is that this utility takes a machine name as a parameter. So if you have IIS running on another machine, and you have administrative rights to that machine, you can drop to DOS on your workstation and type:

iisreset computername

... and IIS will get restarted on that remote server. Nice!

Conditions in Comicster

Last night I bowed to popular demand and added "condition" as a field for issues in Comicster.

Hardcore collectors like to maintain the condition of each issue they own (mint, very good, poor etc). I've never bothered with that, since my comics aren't really worth anything to anyone else. (Many of my older comics were bought in a news agency and have the price written on the cover in biro!)

I try to resist the urge to add too much to the issue data-entry form. I don't want Comicster to stray too far from my original vision of a program that's really only there to count your comics, and have a fun browse around your collection. I mean, I could add all sorts of garbage to it, but ... well, check this out:

Here's a screenshot of Comicster's Issue form:

Comicster's Issue Form

And here's a screenshot of the first tab of the corresponding form in collectorz.com's Comic Collector (a commercial product). Click on it to see it full-sized:

Comic Collector's Issue Form

Which one do you think looks easier to use?