All posts by onlyconnect

Amazon S3 sample update

When I added background threading to my Delphi S3 sample, I inadvertently broke the ability to connect with SSL. I’ve fixed the problem, and included the necessary openssl DLLs in the download, so you can run this even if you don’t have Delphi. I use it to backup my own files.

Amazon S3 is a web service for storing files on the internet. It works well and is good value compared to most online storage services.

The distinctive features of this sample are first, that it is Delphi, and second, that it is native Win32. Most of the samples out there are for Java, .NET or scripting languages.

Technorati tags: , ,

Farewell to consistent UI on Windows

Dare Obesanjo says 2006 is the year Microsoft gave up on consistent UI. It’s a follow-up to a post by Mike Torres in which he identifies inconsistencies in various new apps from Microsoft this year. One thing they all have in common is that traditional menus are deprecated, either hidden by default (IE7, Windows Media Player 11) or not available at all (Office 2007).

The reason this is happening is the influence of the Web. The Web gives designers a lot of freedom over how applications are designed, especially in conjunction with Flash. The Web also forces app developers to find some alternative to the traditional menu bar, since it has a page model rather than a window model. Standard desktop apps with File and Edit menus now look dated.

Microsoft has embraced the new designer religion, with the innovative Office 2007 UI, the Expression range of designer-oriented tools, and the Windows Presentation Foundation which gives far more freedom to UI designers.

Nevertheless, Microsoft has slipped up here. The differences that Torres identifies are bewildering to users. I predict that the company will settle on some specific approach (probably the Office ribbon) and try to enforce it throughout. Visual Studio with a ribbon UI?

It means developers have a tricky choice to make with new applications. Broadly:

  1. Stick with tried and tested menus and toolbars until things settle down.
  2. Adopt the ribbon, facing the sign-or-don’t-sign dilemma.
  3. Do your own thing, after all everyone else does.

For an in-house app I’d suggest (1). Menus and toolbars work pretty well, everyone knows how to use them, and most important, it is a lot less work. Further, when non-designers try to take a design-centric approach, the results are invariably ugly.

Technorati tags: , , ,

Why does Vista think my documents are music?

One especially memorable Microsoft bug was in Word 97. You would be typing away, and then Clippy popped up with a balloon saying “It looks like you’re writing a letter.” Invariably you were not. The phrase is referenced over 9,000 times on the Internet according to Google, proving that this blunder has indeed passed into tech folklore.

I guess some team put considerable effort into Clippy and thought it was making life easier for non-technical users.

I was reminded of this when I noticed Vista had decided that my Documents folder contained music. I’ve fixed this folder now, but I found another one to illustrate this blog. I promise I did not configure this manually; Vista did it all on its own:

As you can see, Vista’s Explorer is presenting a folder which happens to contain some Java code as if it were a music folder. There are options to play the files, or burn them to a CD, though I don’t suggest you try. It is actually fairly annoying. When I first hit this problem, I wanted to see the file sizes and dates. I realized it was a View problem, so I hit the View dropdown. I set it to Details, no joy. I tried Organize – Folder and Search options. Lots of options, none any use. The solution is to right-click one of the files and choose Customize this folder. Then you get a dropdown where you can set the folder type. All Items works fine for me.

Just an annoyance, no big deal. It’s disappointing though. Two obvious questions:

  • Why is Vista automatically setting folders as Music when they don’t contain any playable files?
  • Why doesn’t the View menu help me to view the files differently?

It reminds me of Clippy because it is another example of software trying to be over-helpful, and ending up obstructing rather than improving the user experience.

In closing, let me say that I prefer Vista to XP for all sorts of reasons, and software compatibility is proving less of a problem than I’d expected. And good user interface design is very, very difficult. So take this in that context.

Technorati tags: , ,

Bugs in IE7 RSS platform?

I welcome the introduction of the RSS platform in IE7; I think a central repository for RSS feeds is a great idea, even though Outlook’s RSS integration strikes me as totally broken

But is it reliable? I was using it to browse Jensen Harris’s excellent blog and noticed that the entries were from somebody else. A look at the feed properties reveals all:

It appears that the RSS store had somehow zapped the blog, but kept its title attached to a different feed, Bruce Schneier’s security blog as it happens.

I don’t think I have much hope of discovering why this bug occurred, unless someone from the team would care to comment, but it does cast doubt on the RSS store’s reliablity. Or could it be a problem with my blogreader app? The only time this writes to the store is when it marks a feeditem as read, which it does by setting the IsRead property on a FeedItem reference. Strange.

Technorati tags: ,

Free preview chapter of Adam Nathan’s WPF book

Some of you will know Microsoft’s Adam Nathan as the author of .NET and COM, still the best book available for drilling deep into the way .NET interops with native code. He’s now written a guide to the Windows Presentation Foundation, one of the key components of the new Windows API. I’ll be reviewing the book in due course, but in the meantime the publishers have kindly given permission for me to offer a free chapter to readers of this blog.

Download Chapter 3, Important New Concepts in WPF [PDF].

Chapter 3 covers WPF logical trees, dependency properties, routed events, commands, and the overall class hierarchy.

If you like the book, you can order it here:

Nathan: Windows Presentation Foundation (US customers)

Nathan: Windows Presentation Foundation (UK customers)

Technorati tags:

Hey, Microsoft! What happened to XBox 360 backwards compatibility?

Christmas is coming and thoughts turn to games. A year after the release of XBox 360, can you retire the old black XBox and play your XBox games on the new console? Unlikely. Here’s the list of compatible games, which looks impressive, until you consider that only around half of the games released for XBox are covered. In other words, the list of games NOT compatible is just as long. Notable ones include:

  • Blinx and Blinx 2
  • Burnout and Burnout 2
  • Dead or Alive Xtreme Beach Volleyball
  • Disney’s Extreme Skate Adventure
  • FIFA Soccer 2005
  • Galleon
  • Jet Set Radio Future
  • Midtown Madness 3
  • Oddworld: Munch’s Oddysee
  • Outrun 2
  • Panzer Dragoon ORTA
  • Pirates
  • Rallisport Challenge 2
  • Rayman 3
  • Rollercoaster Tycoon
  • SSX Tricky
  • The Chronicles of Riddick
  • The Elder Scrolls: Morrowind
  • Top Spin
  • Wallace and Gromit
  • Worms 3D

 I realize that any backward compatibility on the 360 is a technical miracle; but even so, this is disappointing on the year-old 360 and raises doubts that these games will ever be supported.

 

Technorati tags: , ,

 

XNA, XBox 360 and the decline of computer science

I promised some more comment on the conference on XNA game development last week. It was a fascinating event, not so much because of sparkling content (though it was good), but because of the underlying themes. This conference was for the academic community, both students and lecturers. The idea was to promote the adoption of XNA on computer science courses. Presenters included members of Microsoft’s XNA team, Nick Burton who is a graphics programmer from Rare, and Peter Molyneux from Lionhead.

XNA is Microsoft’s new framework for games development. It is a .NET wrapper for DirectX, and a replacement for the earlier Managed DirectX libraries. You can create games for both Windows and XBox 360. The initial target is student and hobbyist developers, and the development kit is free except that to deploy to an XBox 360 you have to join the XNA Creator’s Club, for a modest subscription fee. Even then, you cannot distribute your 360 game except as source code to other club members; you would need to find a publisher or get the game on XBox Live Arcade. A future XNA studio product is planned which will target professional developers.

There is an obvious benefit to Microsoft if it can establish XNA in universities. It gets students familiar with the Visual Studio/Windows platform and helps foster the next generation of Windows and XBox 360 game developers. But what’s in it for the universities?

Here the context is important. There is a crisis in computer science, with dramatic falls in the numbers of students applying for courses. I spoke to Rob Miles, lecturer in computer science at the University of Hull. “The number of people applying to courses across the country has dropped by something like 40% over the last few years,” he told me. Including games programming in the syllabus is a bit of sugar to attract new students. “It will help me motivate students to want to learn to program,” said Miles.

Microsoft says XNA will help to address another crisis, this time in the games industry itself. Developing a game has become extraordinarily expensive. The industry has moved towards the Hollywood model of big-budget titles that can make or break their publishers. Gamers on the other hand complain of too many sequels, lack of innovation, and poor gameplay. Microsoft likes to talk up XNA as the future YouTube of games, recovering the community and excitement that was around thirty years ago, in the days of the BBC micro and other home computers.

Here XNA is competing with Flash, which already has a considerable community of game developers. XNA is vastly more powerful than Flash, but for small, easily deployed games Flash has many advantages including cross-platform support and browser integration.

Is XNA just another hobbyist game programming tool, likes others including AMOS and STOS (for the Amiga and Atari ST), or more recently DarkBASIC? There is a range of opinions here. Peter Molyneux enthused to me about XNA, saying it is “a fast, efficient, better language” than earlier more compromised tools, and “built with ambition in mind,” so that XNA programmers can create the next Populous (the game which made Molyneux his fortune).

On the other hand, Molyneux undermined his evangelism by also stating that C++ remains the language of choice for professional development. If this is the case, then XNA will always be a hobbyist niche, which implies that serious students of game programming should not waste too much time on it.

Not everyone takes this line. The Rare team has spent time with XNA and appears genuinely impressed with its capabilities. Nick Burton showed us both the dramatic reduction in code and the impressive performance of XNA code. While Rare is not yet using XNA commercially, it does expect to do so in a few year’s time. This might be some sort of mixed code, using XNA for game logic and C++ for graphics heavy lifting, or might be pure XNA. A factor for Rare and any professional game studio is the extensive C++ code library which it has built up over the years, which makes any quick move to another platform out of the question.

My view is that the productivity win makes XNA or something like it inevitable in games development at every level. Timing is another matter, and C++ will be hard to shift.

Finally, a couple of hot snippets of game gossip. One is that Rare is working on a Live Arcade title. I got the impression that it is fairly well advanced, though nothing is yet formally announced.

The other is that Molyneux talked up innovation in Fable 2. He told me that it has an unique and surprising feature which he had to fight to include, and which will be unveiled in March at the Game Developers Conference in San Francisco.

Microsoft’s XNA site is here. Note that if you want to develop in XNA, you are well-advised to get hold of the wired XBox 360 controller. It is a decent controller and works nicely with XNA both on Windows and 360.

Technorati tags: , , , , , ,

XNA up and running

My install of XNA on Vista is up and running; here is the demo game I did for PCW Hands On:

In this exciting game, the magazine logo swings back and forth. Your task is to hammer the space bar at exactly the moment the logo is over the up arrow. Your score varies from 0 to 20 depending on how close the logo is to the up arrow.

Before you laugh uncontrollably at this hopelessly crude example, listen to my apologia. I set out to write a short printed article that showed how to create a working game in XNA. The XNA install comes with an example game called Spacewar, but even spacewar is too long and complex for a short article. My example has all the code in one file, the Game1.cs which is created by the project wizard. It is a real game, with a moving sprite, keyboard handler and scoring mechanism. The idea is that once you grasp how Stop the Logo works, you can easily move on to greater things.

The simplicity was a little spoilt by a silly problem: displaying the help text and score. There is no easy way in XNA to write text to the screen; at least, there wasn’t in the beta, and on a quick look there isn’t in the final release either. I used Gary Kacmarcik’s BitmapFont class; I notice he has posted some more resources since the beta so check out his blog.

 

Technorati tags:

Installing XNA Game Studio Express on Vista

Yesterday I attended a conference on XNA game development. More on that soon; but first a quick note on what happened when, fired with enthusiasm for XNA, I installed the release build of XNA Game Studio Express on Vista.

At least I tried. You have to install Visual C# Express first (since for some reason XNA does not work with the grown-up Visual Studio 2005). That’s OK since it works side-by-side. Visual C# Express went on OK, but setup for XNA Game Studio Express failed towards the end of the install with an error about a file that could not be run. The install then rolls back completely leaving you with nothing.

I ran msiexec with logging to see more detail. Here it is:

Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: RegisterWithCSExpress, location: E:\, command: “C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\VCSExpress.exe” /installvstemplates

It occurred to me that even an install without the templates might be of some use, or perhaps I could manually install the templates. So I ran up Orca (MSI editor), opened the InstallExecuteSequence table, and deleted the RegisterWithCSExpress action (yes, I’ve wrestled with MSI before).

The hacked install ran OK, and to my surprise the templates were present. This might be because of the earlier failed install, or because I also ran:

VCSExpress.exe /installvstemplates

from the command line. This command, which tells VC# Express to refresh its template cache, is the one that fails. On my system it causes VC# Express to crash, which is why it trips up the XNA install, but it appears to install the templates before it crashes so it is kinda OK.

My official advice therefore is not to try and install XNA on Vista, but the above may help if you are determined.

Microsoft knows about problems with Visual Studio on Vista; we are promised a “Vista Support Update” next year. In the meantime it does mostly work if you run it with elevated permissions.

I noticed that the Microsoft folk were running XNA on Vista yesterday.