Why GTA4 is so highly rated

May 7th, 2008

Games released in the months prior to The Legend of Zelda: Ocarina of Time:

Games released in the months prior to Grand Theft Auto 4:

1998 reads like a Top Games of All Time list1. 2008 hadn’t had anything memorable until GTA4. Sure, Smash Brothers Brawl was huge for fans of the series, but it’s nothing new like MGS or Rainbow 6. You have to go back to last year for Unreal 3 and Call of Duty 4, and they’re nothing compared to Half-Life, which is still on almost everyone’s top 10 list2.

I’m sure GTA4 is great. Not as fresh as the previous versions, but maybe more fun. But I believe its place as the highest ranking game of all time according to GameRankings.com is inflated due to the complete lack of anything else.

And here’s something else I thought was interesting. The user rating for GTA4 is around 8.0. The user ratings for the other top games on GameRankings are must higher, mostly around 9.0. I’m not sure what that means.

  1. Not my list, not by a long shot []
  2. Except mine []

IDE colors

April 24th, 2008

I recently switched to a color theme with a dark background in Visual Studio 2005. The choice was almost purely logical: there’s more room for color variations. A light background will have dark text and a dark background will have light text, and the differences between light colors is more noticeable than the difference between dark colors (eg. compare #5f0000 and #00005f to #ff0000 and #0000ff). Therefore, the different elements of the syntax will have more variety and be easier to understand.

That’s my theory at least. We’ll see how it pays off.

I haven’t settled on a particular theme yet. Scott Hanselman has given some suggestions. Jeff Atwood has written about it, of course. So far I’m using Dark Visual Studio from Brad Wilson. I prefer its blues over some other themes’ browns.

Initially, I had a hard time seeing and understanding my code. I was looking for green comments, but they were purple. But I realized that the problem wasn’t the colors, it was the code itself. Even though I had written it the day before, and was looking at it just minutes ago, it become gibberish with a new theme.

The problem is that, when you’re writing code, you get used to seeing the shapes and structures of the text, more than the code itself. That method with a couple long green lines at the top and a too-deep if-nest at the bottom? Yeah I know what that does. But when the green code is purple and the blue statements are orange, it’s brand new.

I immediately refactored a large portion of the application.

It’s good to be familiar with your IDE, including the syntax highlighter, but I think it’s also good to step out of your element every now-and-then. If you’re working with the same code and the same colors for weeks, you can lose sight of the deficiencies. Change helps bring them back.

There’s one thing left though. This was just for VS2005. I also use VS2003 at work, and I sometimes use VS2008. Then there’s Notepad++, for anything non-.Net, which has dozens of themes itself. I really with there were a standard settings format that could be used by all major editors. Better yet would be if they all use the exact same file, so a single file in your user directory controls the highlighting in all your editors.

Another thin software development analogy

April 22nd, 2008

Software development is like making a table. It can be as fun, frusterating, time-consuming, rewarding, and difficult as you want.

Someone tells you the dimensions, the shape, the color they want, and acts like that’s enough to get a definitive estimate. A square, 4′x4′ table can be made in under an hour. Just nail a few boards together. Or it can take days (maybe weekx, I don’t know, I’ve never made a table), if you want to make it sturdy and robust, with intricate carvings, maybe a hidden drawer, and whatever other frills you can think of.

Of course, if you go to a table maker, you probably have a better idea what you want. I don’t think that’s the case with software development. I was asked to give some estimates today, to add some functionality to an existing app, and I’m just hoping I can get them right within an order of magnitude. Getting the functionality working, in the sense that the app can do what they want, if they ask it just right, any never want to change anything, would take only a few dozen hours. Getting it working right, so it won’t crash, and it errors gracefully, and it can be changed without a complete rewrite, and it has tests to verify that it works, might take a few hundred hours.

What type of table does your client, customer, or boss want? I think it’s usually safe to assume they don’t want the one-hour table. And the fancy table might be too much - they’re more concerned with the functionality. But that still leaves a lot of room to work with. If you try asking what they’re looking for, they’ll say they want a fancy table for a one-hour table price.

The trick is to give the estimate they’re looking for. When someone says, “give me an estimate”, what they mean is, “I’m thinking of a number”.

Raycaster updated

April 11th, 2008

I’ve updated my JavaScript raycaster. It doesn’t look much better than before, but it works better. I’ve also included a preview screenshot for the next version.

IE8 issues

March 9th, 2008

By now we’ve all had a chance to try out IE8, and we’ve all found quirks, bugs, and pages that don’t quite work right. PPK has a summary of CSS issues. John Resig talks about JavaScript. Erik Arvidsson gives his impressions. I’m sure there’s plenty more out there.

I’ve found a few interesting things myself. Navigation on sites like Sourceforge and Codeplex doesn’t look right. MSN TV listings don’t work. But the biggest issues I’ve seen are with my raycaster.

Broken raycaster in IE8 - Cyberdemons everywhere

There are basically 3 causes of the problem: opacity, overflow, and zIndex. IE has never done opacity the same way as Firefox or other browsers; it uses filter: alpha(opacity=50) instead of opacity: 0.5. IE8 doesn’t seem to have any opacity support at all.

More noticable is overflow. I was using large spritemaps for the enemies, which were clipped to show a single sprite1. So the Sarge sprites are all in a single image file, and different parts of the image are shown for different individual sprites. In IE8, the images wouldn’t clip and the entire spritemap would be shown.

I made a CSS overflow test to pinpoint exactly what the problem is. I was using absolutely positioned imgs in a relatively positioned div. In Firefox and IE7, the children of relatively positioned elements are clipped, but not in IE8.

To fix it, I’m using a staticly positioned div for the container, and positioning all the content (walls, sprites, and sky) relatively.

The third problem is with z-index, for which I made a CSS z-index test. In IE7, there was no interleaving of children of siblings. So if 2 adjacent nodes, A and B, each have children with different z-indexes, there is no way for A’s children to be layered between B’s. Either all of A’s children are in front of B’s children, or they are all behind B’s children. And it all depends on A and B’s z-indexes, not their children’s. In Firefox and IE8 there can be interleaving if the z-indexes of the parents aren’t set. Also in IE8, there can be interleaving if the z-indexes of the parent are set to 0.

For more about IE8’s CSS handling, there’s the Windows Internet Explorer Testing Center and CSS Improvements in Internet Explorer 8.

  1. I did this so that only a few images needed to be downloaded. Instead of one for every frame and angle for each enemy, there is just a single image for each enemy type []

Internet Explorer is standards-compliant

March 6th, 2008

With the recent release of Internet Explorer 8 Beta 1, everyone’s talking about web standards again (or rather, they’re still talking about them, but more loudly now). Is IE8 standards-compliant? Will Firefox 3 be standards-compliant? What does it really mean to be standards-compliant?

One of the more popular ways of evaluating standards-compliance is with the Acid 2 Test, which IE now passes. Or does it?

Although we said that IE8 Beta 1 passes the ACID2 test, some of you may be seeing results like the image above; we thought we should explain what’s going on. IE8 passes the official ACID2 test hosted on http://www.webstandards.org/files/acid2/test.html. (Note, this seems to be a popular destination at the moment. You may have trouble reaching the site.)There are also a number of copies of this test around the net. One popular copy that I’ve seen of late is http://acid2.acidtests.org/

IE8 fails the copies of ACID2 due to the cross domain security checks IE performs for ActiveX controls.

IE Blog

What I don’t get about all this is why anyone cares whether an arbitrary set of HTML and CSS renders the way an arbitrary group of people say it should. The Web Standards Project and the W3C do not set standards. The browser makers do. More specifically, the popular browsers do. So right now, Microsoft sets the standards and by definition, anything that works in both IE6 and IE7 is standards-compliant. That’s what a standard is: “an object that is regarded as the usual or most common size or form of its kind”. If it’s not implemented by most browsers, it can’t be a standard. And right now, IE6 and IE7 make up “most browsers”:

Source Date IE Firefox Opera Safari
TheCounter.com Q4 2007 81.14 13.81 0.67 3.21
OneStat.com Feb 2008 83.27 13.76 0.55 2.18
ADTECH July 2007 77.5 15.5 0.9 1.6
Net Applications Q4 2007 77.37 15.84 0.62 5.24
W3 Counter Jan 31 2008 61.79 28.39 1.02 2.42
Averages 76.21 17.46 0.75 2.93

Designing a web page around “standards” that don’t work in IE your site will be broken for about 3/4 of your viewers. When writing and testing your HTML and CSS, you should do it in this order:

1. Make it work in the most popular brower.
2. Make it work in other browsers, to the point where the extra effort isn’t worth it.
3. Make it adhere to the suggestions of the Web Standards Project.

So some sites, IE6 and IE7 aren’t the most popular browsers. For a lot of “tech” sites, Firefox is just as popular. For Apple-focused sites, Safari probably is. If that’s the case, then go ahead and ignore IE. You may have trouble attracting new readers though.

As for IE8, there’s one site I’ve found that works in IE7, Firefox 2, and Opera, but not IE8: my raycaster.

Broken raycaster in IE8 - Cyberdemons everywhere

Final Fantasy XII disappoints - here’s how to fix it

February 17th, 2008

I was really excited about Final Fantasy XII, but so far it’s been a let down. It seems like every few minutes you run into something that just isn’t right - whether it’s gambits that don’t work like you want or just having to stop for 2 seconds and sheath your weapons when fleeing1. I was planning on writing a big post on all the little details that are broken, but instead I’m just going to suggest a few changes that would make the game much better.

Cut back on the randomness

In all the previous Final Fantasy games I’ve played, spells like Stone, Sleep, and Death only work a fraction of the time. If you cast the spell, the entire battle depends on the random number generator. That’s devastating randomness, and I hate it.

FFXII cuts back a little - by making spells like Stone and Death start a countdown timer, so they’re not instant kills - but it’s not enough. Spells like Sleep and Slow still only work every once-in-a-while, so the battles as still controlled by the random number generator. Whenever a spell results in a “miss”, it’s an instant Fail for the game designer. Spells should either hit (with some degree of power) or be ineffective (if the enemy is immune). There is no miss.

This is easy to fix. Instead of making Slow “hit-or-miss”, just make it effective to a certain degree. Sometimes it’ll slow the enemy down by 10%; sometimes by 40%. Same with Sleep - instead of “awake” and “asleep”, let enemies be “sleepy”. And as they get more “sleepy” they may slow down, miss with their attacks more often2, and block fewer attacks.

Fix the Gambits

I love the idea of Gambits, but they don’t quite work as implemented in FFXII. I think there are 2 main problems, the first being that they’re too specific, with too many choices. Instead of “Cast fire on enemies that are weak against fire; cast thunder on enemies that are weak against thunder; etc.”, there should be something like, “Cast whatever will do the most damage to this enemy”. Of course this brings up the question of how the character should know which spells are the most effective. The solution is simply to include it in the beastiary. If you find a spell that’s especially effective, the character should take a note of it and use it again next time.

The other problem is that there’s no way to easily change gambits. There’s a nice interface, but it requires a lot of clicks. And until you spend the time to reconfigure everything, you keep using the same settings. It would be nice to be able to set up different classes of gambits - like Battle gambits, and Safe-zone gambits, and maybe even Aggressive or Careful gambits. So once you enter a battle, you switch to battle gambits, which might place emphasis on attacking until characters are especially low on HP. At the end of a battle, you’re back to the safe gambits, which involve more preparation for the next battle.

Combining all this, and taking it further, you could get rid of the list of instructions (”if A do B; else if C do D; else …”), and turn Gambits into equippables. So a single gambit that you find or buy would consist of an entire battle strategy for a single character, and you just assign each character a gambit (or a couple - one for battles and one for between battles). And different gambits would be tailored for different classes - tank gambits, mage gambits, healer gambits.

About the closest thing to gambits I’ve ever seen successfully implemented was in Ogre Battle. In Ogre Battle, you had no direct control over your characters, you just gave them simple instructions like “attack leader” or “attack weakest”, and the AI took over. This particular system wouldn’t work in a Final Fantasy game, because the battles are too different, but I think it’s something to consider. The best solution might be somewhere between FFXII and Ogre Battle.

Don’t make my characters stop

I don’t know where the idea of stopping to cast spells, or stopping to sheath a weapon, came from, but it needs to be sent back. In FFXII, whenever a non-leader character casts a spell, he has to stop for the entire duration of charging the spell, casting, and deciding what to do next (the leader can move for everything except the actual spell casting). This accomplishes nothing but annoying the player.

Fix the bosses

Maybe the worst part of the game, and the hardest to fix, is the bosses. I don’t mind a long boss battle, as long as they’re not so boring and common as in FFXII. I just spent 15 minutes fighting one boss, casting the same spell again and again, and the very next battle is another 15 minute boss. I used to enjoy the Final Fantasy bosses, but not anymore3.

Every boss feels the same. First learn its attacks and equip something to nullify the status effects it throws at you. Brace yourself when it gets down to 50% HP, because it uses a super-powerful attack. Again at 25%. And for the final 10% or so it just attacks relentlessly.

Mix it up a little. Throw in one that switches its weakness every few minutes. Or one with multiple stages. I think it was FF3 (that’s FF6 to Japan) that perfected the multi-stage bosses.

Overall, I’d say the Final Fantasy XII just feels unpolished, which is especially surprising for a game of that name. I was hoping it would be good enough to make me play the games I skipped in the series. I still do want to play them, but for a different reason: I want to see the full progression from 6 to 12. Each game in the series adds new gameplay elements, and I want to see what I’ve missed.

  1. Seriously - if try to flee you have to stop and sheath while the monsters catch up to you - fleeing actually slows you down []
  2. I can tolerate blocks and misses with regular attacks because they rarely have such a drastic effect on the overall battle []
  3. I can’t remember exactly what it was about FFVII that made be stop playing the series, but it could have been the bosses []

Final Fantasy 12 might bring me back to the series

January 15th, 2008

I haven’t played a game from the Final Fantasy main series since Final Fantasy 7. I think I’m the only person to have stopped playing the series because of that game. That means FF12 is only the 2nd 3D Final Fantasy game I’ve played, and the first in about 10 years. I’ve only just started, but I think I may end up going back and playing 8-11 once I finish.

FF12 is almost exactly what I’m looking for in an RPG. In fact, it’s what I was hoping DS2 would be. I’m a huge fan of Dungeon Siege, and I had hoped Dungeon Siege 2 would expand on the party command system and the equipment/spell requirement system. FF12 does both of these. And since the battles are in run-time, on the same screen as the world, it feels more like a PC RPG than a Final Fantasy (although the artwork and the story leave no question).

Those two systems I wanted - party commands and equipment/spell requirements - exist in FF12 in the form of gambits and licenses.

Gambits are sets of rules which determine how your party behaves in battles. They are essentially simple logic statements. “If a party member has less than 50% HP, heal them.” “If an enemy is attacking the party leader, attack that enemy.” Combining them lets you have a character who will cast spells and perform other special actions when they’re needed, and just attack when they’re not. This is what Dungeon Siege was lacking. Your mages would only cast spells, repeatedly, until they run out of MP, and then just stand there.

Licenses are how FF12 controls which equipment, spells, and techniques a character can use. Instead of requiring a character class, or level, as previous Final Fantasies and Dungeon Siege have done, all that’s required is a license, of which the player has full control. Of course, there are restrictions. Licenses are organized on a 2D grid, and you can only buy a license if you have an adjacent license. So your mage, which only has staff and robe licences, can’t suddenly get a heavy armor or broad sword license.

The systems aren’t perfect though. Licenses can be tedious, and gambits can be restrictive. And that’s why I want to play FF8-11. I didn’t realise back when the games were new, but the Final Fantasy series has always been full of innovation. FF1 let you choose character classes; FF3 let you change classes; FF56 let you learn spells through espers. Jumping straight from 7 to 12, I’m sure I’ve missed some great gameplay mechanics.

Bloat and verbosity

December 24th, 2007

In his latest rant, Steve Yegge asserts that the worst thing that can happen to a codebase is for it to get too big. He uses a lot of words to make his beliefs clear: too much code is bad; most people don’t think too much code is bad; Java, and similar languages, are verbose; refactoring doesn’t help code size. But in all his words, there wasn’t a lot of reasoning behind what he said.

Fortunately, Jeff Atwood condenses and elaborates, and for the most part he agrees. But they both fail to distinquish between bloated code and verbose code.

Bloat is when code is larger than it should be because of repetition, featuritis, or poor organisation. Bloat is the opposite of elegance.

Verbosity is code that is long because the language requires it, or because of design decisions. Verbosity is the opposite of succinctness.

Code can be bloated but succinct. It can be verbose but elegant. And it can be bloated and verbose. Verbosity can be bad, but bloat is always bad.

In Java, and C#, there’s a lot of boilerplate code. A simple property can take up 15 lines on the screen. A map can take 6. Both can be done in a single line in a language like Ruby.

But does that matter? Is that extra code any harder to manage?

One more thing that Steve asserts is that the claim that the IDE can overcome this verbosity is flawed. This is where I don’t necessarily agree. A good IDE can hide a lot of that boilerplate code from you, can do refactorings that would requires managing the code, and, perhaps most importantly, can highlight the code so it’s easier to see the meat.

Steve’s argument is that the power of the IDE promotes even longer code, requiring even more powerful IDEs and creating a vicious circle. This is true, but it’s ultimately up to the programmers and languages designers to keep their code managable. Just because it’s easy, doesn’t mean you should do it.

Yes, less code is better. And being succinct is better than being verbose. But the latter really isn’t that big of an issue.

Microsoft’s Parallel Processing Framework

December 7th, 2007

4 days ago I wrote about parallel processing.

Sun and Microsoft are constantly working on improving the Java and .NET frameworks. And by the time the average programmer needs it, both will have plenty of support for easy threading.

Today, via Public Sector Developer Weblog:

Microsoft is working on a set of Extensions for the .NET Framework 3.5 (Visual Studio 2008) that will make it dramatically easier for Developers to build “managed code” parallel process applications.

The CTP is now available. I hadn’t heard about it before today, but apparently the word has been out for a few months. There’s a Parallel Programming Team blog, an MSDN Magazine article, and a Hanselminutes podcast about the framework.

I haven’t tried it yet (my computer only has a single core), but it looks interesting.