// Internet Duct Tape

7 Tips to Optimize Windows XP for Gaming — Playing The Witcher on Minimum System Requirements

Posted in Games, Microsoft Windows XP and Vista, Technology by engtech on December 28, 2007

Working With Windows

One of the lures of the holiday season is to be able to hopefully squeeze in some time between eggnog, family and friends to exercise your vices. No, not heroin, but that other life consuming addiction: gaming. PC gaming is quickly going the way of the dodo, with console gaming taking over because it is so much easier to prevent piracy and ensure that the games will “just work” with the minimum of effort. But PC games are still my drug of choice, the combination of mouse and keyboard can’t be beat, especially for real time strategy or roleplaying games.

I decided to give the Witcher a try. It’s based on Bioware’s Aurora engine that powered my all-time favourite game Neverwinter Nights. The story is based on a long running Polish fantasy series, that has already had a movie and tv series based off of it. You can find a fan-subbed English copy of the tv show on popular bittorrent sites like the Pirate’s Bay. It is surprisingly better than I expected, about on par with the Highlander tv show.

Unfortunately the Witcher’s biggest flaw is that it’s using the Aurora engine. Game areas are split into several different area files that means changing areas becomes a complete pain in the ass. This was a huge problem when I used to do Neverwinter Nights game modding under the alias OldManWhistler, and I’m very surprised that four years later it STILL hasn’t been fixed. Playing the game will drive you running back to Bethesda’s Oblivion and their excellent background loading technology.

Load times are bad. The 1.2 “Christmas patch” of the game has improved it, but it still sucks all the joy out of the game to have the simplest of quests require up to 10 minutes of load screen staring to complete. Of course, the real culprit is that I’m trying to play the game with minimum system requirements. Let’s face it, no game plays well in the worst case scenario.

Special Witcher Tip: If your character became “locked-up” after moving to a new area it’s because you have autosave turned off. The game often moves into a cut-scene immediately after doing an autosave, and the cut-scene never starts if autosave is turned off.

In Program Files/The Witcher/System Folder/player.ini, set disable autosave to 0 instead of 1.

Getting Started: FreeRam XP Pro

Before you start optimizing your system, you should download and install Free Ram XP Pro. I don’t recommend using it all of the time, it’s pretty brutal when it decides to kick in and free up ram from running applications (it usually crashes Firefox). But it will display the amount of free RAM available in the system tray which will give you a warm fuzzy of progress as you go about optimizing your PC.

Performance Tip #1: Turn Off Your Antivirus

Antivirus software is a tax on the computer illiterate that wastes up to 50% of your computer resources. You should *NEVER* leave your antivirus software turned on while running PC games that are performance intensive (assuming they’re games you legitimately purchased)

Futher reading:

Performance Tip #2: Buy More RAM

RAM is cheap these days. There is no reason why anyone shouldn’t be running their system with the maximum amount of RAM they can get their hands on. Crucial makes a scanning tool that will automatically tell you what kind of RAM your computer needs. It’s one of the easiest ways to make everything on your computer run faster.

If you don’t have enough RAM then your computer will have to use part of your hard drive as RAM, which is so much slower. Buying more RAM is the most time effective way to get more juice out of an old PC.

Performance Tip #3: Free Up Hard Drive Space

Most computers have a ridiculous amount of free space on them unless you download music, movies or tv shows. There are lots of free programs out there that will help you find out where your hard drive space is going. I was losing 12 GB to a log file that was automatically created by a program called PeerGuardian 2!

Performance Tip #4: Defrag Before and After Install

Fragmentation happens when you store things on your hard drive after time. The computer will write information to the hard drive where ever it fits, which means parts of the same file can be all over the place. Ideally you want to install programs so that the entire program is “contiguous” — all the bits of the file are as close to each other as possible so that they can be read all at once with the minimum amount of time. You should always defrag after freeing up your hard drive so that you can make the most out of that new free space.

Performance Tip #5: Using msconfig

The stupidest invention ever was the “helper application” that sits in your system tray, doing nothing but consuming memory and making whatever program it is supposed to “help” run faster. My worst offender is Apple’s quicktime task that NO ONE uses, but reinstalls itself every time you upgrade iTunes. There are a couple of startup applications that might be necessary because of external devices (IE: cellphone, digital camera, keyboard, scanner) but for the most part these can all be removed.

Performance Tip #6: Removing Services

The only thing left to improve how fast your computer is running is to turn off parts of the operating system that you don’t use. There’s a lot of them, and its hard to know what really does what. This is one area where you can screw up your computer if you do it wrong. GameXP provides a nice simple interface that will disable most things for you automatically (as well backup the changes). But you can do it yourself by following guides.

Performance Tip #7: Advanced Guides

The previous six tips are the easiest ways to get games running on your computer with the least chance of screwing things up. But that’s just the start and there are many other ways you can tweak Windows XP to get your system running faster. These methods are time consuming to implement, and may be too technical for the average person, and you can screw up your computer if you do things wrong.

Conclusion

You can get a lot done with an older computer if you’re willing to get your hands dirty and remove all the stuff you don’t need. Your operating system includes much cruft, and there’s always ways to extend your PC life beyond the normal limits.

Programming Best Practices: Profiling

Posted in Firefox and Greasemonkey, Programming and Software Development, Technology by engtech on November 14, 2007

Programming Tips

My first task coming back from my work stress blogging hiatus is to finally fix problems with Akismet Auntie Spam that Lorelle reported over a month ago — if your Akismet spambox has over 10,000 spam comments then Auntie Spam is going to crash hard. Viewing that many comments at once will make Firefox use eight times more memory than normal web browsing, even without using Auntie Spam [1].
This means it’s time to do some code profiling [2]. In programming, profiling means to measure your code and find out which parts are using the most time and the most memory. Profiling gives you performance analysis measurements so that you can optimize your program for speed and/or memory.

“Don’t prematurely optimize” is a programming Best Practice, and it can be summed up in the words of my grandfather: “measure twice and cut once”. You can guess at what parts need fixing, but it is much more effective to measure how your program performs so that you can focus on the worst parts. They have the most room for improvement. Without profiling you could easily spend several hours optimizing a loop that executes in negligible time and ignore the three lines that copy huge chunks of memory for No Apparent Reason. Get it working, and then use your profiler to get it working fast.

Profiling is a Skill

I’ve been creating Greasemonkey scripts using javascript for a year now, and this is my first time firing up any kind of javascript profiler. It really struck me that I waited too long to do this. Don’t prematurely optimize, but also don’t waste any time learning how to run a profiler on your code and interpret the results. If you’ve never gone through the process of optimizing code in a language you regularly use, then you’ve been relying on all kinds of bad habits [3]. Learn how to integrate a profiler with your program as soon as possible so that performance analysis doesn’t become one of those “I’ll get around to it” tasks that never happens.

Another good rule is to always test with large data sets. Ideally you want a fast case for rapid prototyping of new features, and a worst case for stressful testing of that new feature. To often we use small sets of data for development and testing. We never realize how badly our code performs in real world conditions. Speed and responsiveness play a greater factor in whether or not someone becomes a regular user of your program than you might realize.

Footnotes

[1] One thing WordPress does wrong is it includes all of your comment spam in their WordPress export files. One friend saw his export file decrease from 83 MB to 8 MB once he deleted the comment spam.

[2] The best way to profile Javascript is with FireBug, but it doesn’t recognize Greasemonkey scripts unless you embed them in the page so FireBug can find them. Wikipedia has a list of profilers for popular languages.

[3] Some of the bad habits that were lurking in Auntie Spam:

  • I was using a custom getElementsByClassName instead of an XPATH call. XPATH can be so much faster that walking the DOM.
  • I had too many innerHTML assignments instead of leaving HTML as a string and then giving it to the web page to process as a final step
  • Inefficient regular expressions
  • Too many copies of the comments in memory
Follow

Get every new post delivered to your Inbox.

Join 285 other followers