Your netcasts are missing something

June 17th, 2009

Note: I started writing this a few months ago, and since then TED’s video player has changed. The chapter feature I mention appears to be gone. I tried to find out what happened, but all I could find is a blog post from when the player with chapters was launched.

(There’s another, more popular, term for “netcast”, but I refuse to use it because it is wrong. You can’t just go around calling things by names that they aren’t. Words have meanings. And netcasts are what I’m talking about so “netcasts” are what I’m calling them.)

TED has one of the best Flash video players around. In addition to the usual features - it’s fast, it’s easy to use, and it just works - it has something I haven’t seen anywhere else: chapters. Similar to DVDs, the videos can be split into sections you can jump to, skip over, or replay.

Chapters in the TED talk 'Robert Lang folds way-new origami'

Did a particular section of that video stand out? Watch it again with a click. Is the presenter on a long-winded aside you don’t care about? Skip ahead. Did you get interrupted half-way through the video last time and forget where the presenter left off? Glance at the chapter names for a reminder of what was going on.

I listen to a handful of netcasts, mostly about software development and gaming. Most of them are at least an hour long and some can be more than 3 hours, and I rarely listen to them all the way through without a break. Sometimes I won’t get back to to one for a few days, and it’s easy to forget where I left off. Were they doing “What are you playing?” or “State of the industry” or “News” or “Emails”? Sure, my Zune lets me resume where I stopped listening, but I sometimes have to rewind for a reminder. And sometimes the gaming netcasts talk about games I don’t care about, or spoil games I do care about, that I would like to skip.

Or maybe there’s a radio show or something you only listen to for one good segment in the middle, and you have to skip around to find the beginning every time.

Wouldn’t it be great if your media player showed chapters like the TED player? If it showed you a list of segments when you started playing. If it let you jump between them with the left and right buttons.

Of course, it’s not as simple as just saying, “Hey, let’s add chapters to these audio-thingys and make everyone happier”. First, you need a format that actually supports chapters. As far as I know, none of the popular (MP3) or less popular (WMA, OGG, AAC) formats have anything like this. You might have to use a separate file that contains the chapter information or cram it into an ID3 tag (either of these would be preferable to creating a new format, which would break compatibility with all current players).

Then you need to get the media players to actually use the chapters. If Apple were to add the functionality to iPods through a firmware update, we’d be golden. But unless that happens, widespread support is a long way off.

And finally you need the content creators to start using chapters, which means more work for the producers. Some might be up to the task, but some would resist, because the less time you spend skipping through a netcast looking for what you want, the less time you spend accidentally listening to ads. This is somewhere that the idea of using a separate file or an ID3 tag for the chapter information would be good: third parties could do the chapterizing and make the information available without the need for reencoding the audio.

Controlling a character with the mouse in Silverlight

May 28th, 2009

Here’s a problem I had recently with a Silverlight game I’m developing. It’s a top-down 2D game, and I want the character to be controlled by the mouse, and I want it to be rotated to face the direction the mouse is moving.

Moving the character it easy. Just create a MouseMove event handler and set the position of the character object.

Rotating the character is a little trickier. The obvious solution is to just take the vector between the new position and the previous position, and use atan to get the angle.

The problem here is that dx and dy are usually very small, especially when the mouse is accelerating, which causes the character to end up facing in only a few directions. And there’s no smooth turning motion. If the mouse moves by (1, 0) one frame and (0, 1) the next, the character suddenly changes from facing straight right to straight down.

Another solution is to change the angle by only a certain amount each frame.

But I don’t like that. It just looks ugly, with all the ifs, and having to handle wrapping around from 360 to 0. Plus it’s still not very smooth when the mouse moves slowly.

My final solution was to create an “anchor” point behind the character, and use that to determine the rotation. The new angle will be based on the vector to the mouse position from the anchor point, instead of from the character position.

Controlling a character with the mouse in Silverlight

With a few tweaks to AnchorDistance, this worked perfectly. In the screenshot you can see the history as the blue polygon turned while it moved from left to right (with a ghost of the character added every 5 frames). The anchor is the green square at the back of the character.

You can get the Silverlight 3 project for Visual Studio 2008 here.

Of HTML, tables, CSS, and more

February 15th, 2009

Here are a few quick thoughts about the sad state of modern web development and design.

The tables vs. CSS false dichotomy

Tables and CSS are not alternatives. They are not different technologies to solve a single problem. Tables are used to organize content into rows and columns. CSS is used to control how the content looks. CSS can by applied to other HTML elements do the work of tables, but it usually takes some extra markup and non-intuitive styles (like negative margins). If you want something with rows or columns, a table might be the best way to go, even if you’re not working with tabular data.

Separation of content and presentation is not enough

Despite what the mantra will lead you to believe, there are actualy three components to a web page: content, layout, and style. With just HTML and CSS, there’s no way to cleanly separate them. Layout always ends up in both the HTML and the CSS.

CSS, not CLS

CSS is for style. It’s good for things like colors, fonts, and decorations.

CSS is not for layout. Sure, it has position and float, and with enough markup you can make a page dynamic enough that the header, navigation, footer, and content can all be moved anywhere on the page. But that’s all very hacky. CSS has no concept of columns or rows, which make up the basic layouts for a lot of pages. There’s no simple or obvious way to make the vertical navigation and the content the same height.

Don’t write blog posts in HTML

Chances are you write content in one of a few ways. You either use a WYSIWYG editor that spits out HTML, or you write the raw HTML yourself, or you use something like markdown that gets converted into HTML. None of those ways get it right though, for a simple reason: content is not HTML. HTML is just one possible format the content can be in, and it’s a pretty bad format for what out content needs to do.

It’s better to use something else, like XML. Make up your own tags and define them how you want. So instead of <div class="aside">, you just have <aside>. And you can have <quote>, <thumbnail>, <spoiler>, and <subheader>.

XSLT is the way to go

I’ve never understood why XSLT, or something similar, never took off. It’s the perfect solution to a problem everyone has: how to make a website where the 3 facets - content, layout, and style - are truly separated.

The content is in the XML. The layout is in the XSL. And the style is in the CSS.

Do as I say, not as I do

This blog runs on Wordpress. I have the WYSIWYG editor turned off, so I write the post HTML by hand, and every time I do one like this I have to double-check whether I need to use <h3> or <h4> for the small section titles.

My theme template is about as ugly as it gets, with PHP and HTML alternating almost every line. It doesn’t use tables and I had to use trial-and-error to get the header off to the side like that, without any space above the post content. It was worse back when the navigation had a black background, and I had to use the border-color and negative margin trick to make sure the entire navigation column gets the background color.

Unfortunately, I haven’t seen a blogging engine that would let me use XML and XSLT instead of HTML templates.

You can’t view the GAC over a network with Explorer

February 4th, 2009

I don’t know if this is “common knowledge”, but it can be very confusing if you don’t know what’s going on. If you try to browse to another computer’s Global Assembly Cache (e.g. \\otherbox\c$\Windows\assembly), Explorer will pretend to show you that computer’s GAC, but will actually show you your own.

I have two computers, sphere and cube, in a network. Here’s the view from sphere of both GACs (sphere on the left):

From sphere, both GACs look the same

And here’s the view from cube of both GACs (cube on the left):

From cube, both GACs look the same

It’s obvious when you look at all 4 windows in both screenshots, but if you only look at one GAC at a time it’s hard to tell what’s going on. Especially if you’re looking on the networked computer for an assembly that’s installed on your computer.

This happened at work today. A new version of an assembly needed to be in the GAC on a development machine. It showed up in Explorer, but the application that used it wouldn’t work unless it was also placed in the bin directory.

If you need to view another computer’s GAC, either use “tree” from a command prompt or use remote desktop.

Aside: In order to access an administrative share (e.g. \\otherbox\c$) in Vista or Windows 7, you have to make a registry edit. Paul Spourry explains how.

Raycaster version 5

January 31st, 2009

Version 5 of my JavaScript raycaster

I’ve updated my raycaster by adding variable-height walls. Not very exciting, but it’s a big step up for the engine.

Players shouldn’t be instrumental in game stories

January 7th, 2009

I have never been interested in the story of a game I was playing. Never. Ironically, the option of letting a player play a story and become a part of a story detracts from the experience of the story.

The closest I’ve ever come to being sucked in to a game’s story was when I watched my roommates play Resident Evil 2, or GTA 3. Even with a game like Final Fantasy 6, which I’ve played a few times, the story only feels relevant when I’m watching, not playing.

It seems strange when you first notice it - that being a part of something takes away from the experience as it develops - but it makes sense here. Game stories are predetermined and descrete. Even in the most advanced games with the most freedom, like Fallout 3, you’re not free to actually do what you want. There are always a set of options you can choose from, paths you can take, and decisions you can make. And if those options, paths, and decisions aren’t the ones you want, you realise that you’re not a part of a developing experience, you’re just playing a game.

But when you watch someone play a game, like when you watch a movie or read a book, you don’t have the illusion of making decisions. You’re a third party. So when a choice isn’t available, that’s okay, beause that’s how the story goes.

But that doesn’t mean a game can’t have a great story. It’s just that the player cannot be the main character, or the decision maker, in the story. The closest I’ve gotten to appreciating the story of a game I was actually playing was with Bioshock (but even there, the illusion was destroyed towards the end).

In Bioshock, you play the role of a stranger in a strange land. You find a place where something went wrong, and throughout the game you learn what that something was. You don’t make it happen, or prevent it from happening. You don’t even try to make things right after it happened. You’re ancillary. And so, there are no illusions. The game doesn’t pretend you’re in control. It gives you two options: run through the levels until you get to the end, or stop, look, and listen while you run through the levels until you get to the end.

And that’s what more games need to do. Let the player experience a story with the focus on someone else. Maybe the player does make a difference. Maybe he does have choices that affect the outcome. But it’s not presented that way. There’s no, “You can push the guy off the building and kill him, or you can save the guy and say you killed him, but you can’t kill the bad guy who told you to kill the guy on the building.”

What I’d really like to see is an RPG like this. Where it’s not “you’re an average kid but wait now you have to save the world from the ultimate evil”, but “the ultimate evil is trying to destroy the world and you just need to stay alive until the hero saves the day and hey if you want to save a few other people while you’re at it go ahead.”

Adam Sessler agrees with me about game reviews

December 6th, 2008

Here are a few quotes from a recent Adam Sessler’s Soapbox

I hate numbered scores.

You can like something for some parts and not like it for another.

It’s hard to pin something down to a simple qualified number. So anyway, I’m trying to say is, I hate doing it but I’m trapped doing it.

Back in August I wrote about how game reviews suffer from the inclusion of a score - a single number that is somehow supposed to portray the entirety of the game experience.

Game review are in a terrible state, and it’s all because of numeric scores. It’s great that Adam Sessler is taking this stand, and I’ve been hearing more and more from gaming netcasts and gaming sites about how ridiculous the “one game, one score” mentality is. It’s only a matter of time until review scores are a thing of the past.

The best place to go for legitimate review is still Kotaku. If only they’d review more games, from more perspectives.

Farcry 2 has the worst activation ever

October 24th, 2008

Farcry 2 uses a CD-key, like just about every other game. It’s a simple process - each copy has a unique identifier, which must be typed in before the game will work - but Farcry 2 botches the process so unbelievably. It took me about 8 tries to enter my key.

It doesn’t tell you where the key is. Sometimes keys are on the back of the packaging. Sometimes they’re on the inside of the case. Sometimes they’re on the back of the manual. It’s a minor inconvenience to have to look all over, especially when it’s so easy to avoid with an explanation.

It calls the key a “serial”. After a few tries, I wasn’t even sure I was entering the right key, because the program never used the words “CD key”.

It doesn’t make the difference between “O” and “0″ obvious. My key had an “O” - or maybe it’s a “0″, I still can’t tell.

It makes you enter the dashes. This is a common, but terrible, usability mistake. It shows up everywhere, from credit-card numbers to phone numbers, and now CD keys. Some programs use separate text boxes for each piece of the number or key. Better programs just ignore the dashes. The best programs insert, and remove, the dashes automatically.

It’s case-sensitive. I’ve never heard of a key being case-sensitive. It makes no sense, especially because all the letters are upper-case.

It doesn’t tell you if you’re missing a character. The key is 23 characters with dashes, and 19 without. If there were some indication of whether all the key I entered was long enough, I would be able to figure out that I’m just missing the dashes.

Altogether, I tried to activate about 8 times. With a “O” and with a “0″, with dashes and without, and with lower-case and upper-case letters. The only thing Farcry 2 got right was that I didn’t have to type in the whole key every time.

How to fix DRM

October 6th, 2008

Why doesn’t the ESRB just put DRM information on the box? So right under “Rated E 10+ for Animated Blood, Comic Mischief, and Fantasy Violence” you’d have something like “CD-key”, “Must be online to install”, “Installation limit: 5 machines”, and “SecuROM”. There are really only a handful of different types of DRM, so just a dozen or so labels would cover it all. And if the game turns out to have more restrictions than what’s on the box, it gets taken off the shelves and repackaged.

Retailers would have to be trained to help the customer understand it all, just like with the ESRB ratings. I think most people who buy and play games are aware of the ESRB ratings, and people are aware of DRM on music, so it’s not too much to ask to also know that game DRM is on the box.

This way, it’s up to the consumers. If games with SecuROM and installation limits continue to sell, I think it shows that DRM isn’t as bad as some people say. But the real test comes from comparing PC game sales to console sales. You can’t compare the absolute numbers of course, but if there’s a drop in sales compared to the console, maybe the DRM is the cause and really does need to go. It’s all about raising consumer awareness.


September 28th, 2008

What’s wrong with Spore

Spore asks if I want to be a carnivore or an herbivore

I thought this was exactly the type of this Spore was avoiding. Shouldn’t I be able to make this decision by actually playing the game? If I eat a plant, I’m an herbivore; if I eat a creature I’m a carnivore.

Spore lets me press a button to call a mate

At any point in the first two stages - Cell and Creature - you can call a mate by pressing a button, which takes you to the creator creator. Why not let me swim around or walk around until I find one?

Spore lets me completely rebuild my creature at any time

The creature creator lets you buy pieces to place on your creature. You can also sell the pieces for the same price you bought them for, at any time. This means you can strip down and recreate a brand new creature at any time. It would make a lot more sense to have some limits, so if you give it ten legs, you can’t suddenly remove them all later. If you paint him red, you can’t paint him green two minutes later.

And there should be some kind of evolution. So if your creature gets in a lot of fights with other creatures, it develops sharper teeth, longer claws, or tougher skin. If you play more as a scavenger, or only kill weaker creatures, you develop more stealthy traits. Again, I thought this was the point of Spore.

What’s more, most of the decisions you make when creating a creature don’t matter. Some pieces give you abilities or stats, but most of them don’t stack and it doesn’t matter where you put them. The green creature here has the same stats as the red creature, and performs the same in the game. In the creature stage none of the stats stack, and the sizes and positions of the pieces don’t matter. One set of claws is as good as two. So all you have to do is find the piece with the highest value for each stat and toss if somewhere on the creature.

Spore's graphics can be very bad at times

The procedural nature of Spore means the graphics can’t be as good as anything premade and optimised. And no one ever said the game would be gorgeous. But there’s a lot of some for improvement, especially with the landscapes. Just throwing in some more plants and using high resolution textures would make a huge difference.

And there’s no antialiasing, which is very noticable at times.

The vehicle editor, building editor, and space ship editor are no fun

The editors in the later stages let you choose from a bunch of pieces. Way too many. I think the spaceship editor has a couple hundred. And they don’t have any stats or serve any purpose. And then you have to paint it. That’s not fun, it’s just tedious.

What’s right with Spore

I’ve been sitting on this post for a while because I don’t know what to put here. Not because there’s nothing right, but because it’s so hard to describe it. Looking back, I feel like I spent a lot of time just mindlessly clicking around with no real intentions, no threats, and no excitement.

That’s all because it’s more of a toy than a game - something we all knew going in. It’s up to you to provide the fun and the greatness. LEGOs aren’t fun. Neither are PlayDo or GI Joes. But they let you think; they let you get away; they let you make your own fun. In fact they promote it, and so does Spore.

The space stage is clearly the best, both in terms of how fun it is and how well it was made. For a while I didn’t think so. Flying around space seemed just as pointless as the other stages. But I think there’s a point where you realise it actually takes some skill and strategy. Your decisions, like who to attack and which star systems to colonize, matter even in the long run.

But I think the best thing I can say about Spore is that I think it will last. I think people will be playing and talking about it for a long time. Five years from now people will be describing new games by comparing them to Spore. We’ll say “It’s like the part of Spore where…” and “Remember in Spore when…”

How to fix Spore

Here are just a few changes I think would greatly improve the game.


If there’s ever been a game that screams “Autosave!”, it’s Spore. Especially in the space stage. There’s very little change in the pacing, so it’s easy to lose track of time and to lose track of the last time you saved. There are no major events. No point where you feel like you’ve finally accomplished something. It feels a lot like an MMORPG, so you get in the habit of just expecting everything to be saved automatically.

Just saving every time you complete a mission or earn a badge would work great.

Combine the 3rd and 4th stages

I’m not even sure what they’re called. “Tribal” and “City” maybe. It doesn’t matter - they’re terrible. There’s no strategy, very few choices, and no fun. It’s just, “Go talk to this tribe, now go attack that tribe”, then “Go visit this city, now go take over that city”. Combining them would make it feel more like you’re making progress.

You start out with just a tribe and some sticks for weapons. You socialize with other tribes. You gain knowledge. You develop better tools and buildings. And finally you take over the planet.

Fix the graphics

As difficult as graphics programming is, this one should be easy. It’s all procedural, so just increase the detail and the amount of stuff that’s drawn until the computer can’t handle it. My machine never stutters, but I constantly see objects popping and fading in. I’m not looking for Crysis, just some sense of actually being in a forest or meadow, instead of a desert.

And for God’s sake, give me some antialiasing.

Closing thoughts

Overall, I’d sum up the game like this: I was expecting to be saying, “Look what the game is doing now” while I play, but instead I’m saying, “Look what I can do in the game”. I was expecting more behind-the-scenes. A lot more. Instead of actions having consequences, the consequences are the actions. Instead of eating meat to become a carnivore, you have to choose carnivore to eat meat. Instead of jumping and running to develop stronger legs, you choose the legs from a menu to match what you want to do. Instead of researching technologies so you can build faster and stronger vehicles, you can just use all the parts from the start.

There are no indirect results of anything you choose to do. Everything has a direct and immediate consequence and that’s it.