anotherbyte.netanother byte

Steam Saved Games

Published
28 Aug 2010
Updated
28 Aug 2010

I really like using Steam these days - the price of games is lower than from stores, and I really don't need cds and boxes. It is also much easier to download and play games than hunt around for torrents, keys and that special little trick to get the game to skip the cd check. Not that I ever did that. But it was very tempting. And occasionally still is.

It seems that Steam, rather than showing that DRM is not needed, encourages game producers to attach more and more annoying and fragile DRM to games. I have no idea why. Part of the appeal of Steam is the community, not having to worry about backing up game data files and being able to get updates without having to hunt around each game website.

Steam even has an auto-sync feature now. Which is great... when it works. Unfortunately, that seems to be less often that it should. There are a number of stories about Steam refusing to sync, syncing the wrong thing, and providing nothing in the way of options or conflict resolution. A search for Steam sync show that articles about it tout it as one more reason to use Steam, while the forum posts from users having issues with it are equally as abundant, if not more so.

I've recently been having troubles with my hard drive, so I thought now was a great time to figure out how to manually backup saved games. There is a Steam forum post dedicated to the location of Steam saved games, and now even a wiki.

I've been trying to find where Plants vs Zombies stores it's saved games, and I've only recently been pointed in the right direction. If you're looking for saved games for Steam games, here are some locations to check:

  • Some games still use My Documents or Documents in the user's home folder. (C:\Users\<user name> on Windows 7, C:\Documents and Settings\<user name> on Windows XP or WIndows 2000). Also check any folders named Saved Games or folders games names in the user's home folder.
  • In the Steam install location (C:\Program Files (x86)\Steam [Windows 7 64-bit default]), browse to steamapps\common\<game name>.
  • In the Steam install location, browse to userdata\<steam id>\<game id>. The game id can be found by looking at the id in the URL when on the game's Steam store page.

Some other possible locations (from the Saved Game post on the Steam forum):

User IDs
[USERNAME] -- The name of the Windows account you use on your computer
[STEAMNAME] -- The name of your Steam account
[STEAMID] -- A numerical identifier for your Steam account

Steam-specific locations
[STEAMPATH] -- The default location where Steam is installed
Windows 32-bit: C:\Program Files\Steam\
Windows 64-bit: C:\Program Files (x86)\Steam\

[STEAMAPPS] -- The default location for Steam Games
All versions: [STEAMPATH]\steamapps\

[STEAMCLOUD] -- Files that synchronize with the Steam Cloud
All versions: [STEAMPATH]\userdata\[STEAMID]\

General Windows locations
[DOCUMENTS] -- The default location for the "My Documents" shell folder/library
Windows XP: C:\Documents and Settings\[USERNAME]\My Documents\
Windows Vista: C:\Users\[USERNAME]\Documents\

[APPDATA] -- The default location for standard application settings
Windows XP: C:\Documents and Settings\[USERNAME]\Application Data\
Windows Vista: C:\Users\[USERNAME]\AppData\Roaming\

[LOCAL] -- The default location for system-specific application settings
Windows XP: C:\Documents and Settings\[USERNAME]\Local Settings\
Windows Vista: C:\Users\[USERNAME]\AppData\Local\

[PUBLICDATA] -- The default location for cross-user application settings
Windows XP: C:\Documents and settings\All Users\Application Data\
Windows Vista: C:\ProgramData\

[PUBLIC] -- The default location for cross-user system settings
Windows XP: C:\Documents and Settings\All Users\
Windows Vista: C:\Users\Public\

[SAVEDGAMES] -- The Windows Vista default Saved Games folder
Windows Vista: [DOCUMENTS]\Saved Games\

CSS vendor prefixes

Published
10 Jul 2010
Updated
10 Jul 2010

I'm reading through this A List Apart article on CSS vendor prefixes. I'm not a fan, for a number of reasons – instead of just knowing the W3C CSS words, you have to go looking on multiple sites to see if multiple browsers have multiple ways of declaring the same thing. Not to mention that browsers show errors when parsing css declarations they don't understand. As well as making stylesheets that bit harder to maintain.

Then there's this paragraph in the article:

In the past, we had to invent a bunch of parser exploits just to get inconsistent implementations to act the same once we found out they were inconsistent. It was a wholly reactive approach. Prefixes are a proactive approach.
Furthermore, prefixes are a temporary hack. As time goes on and implementations become consistent, browsers will drop the prefixes. From then on, authors will be able to write one line for border-radius instead of six-plus lines of CSS. Without them, we’re just waiting for the next botched implementation that forces us to support it through hacks for years upon years.

This highlights my number one annoyance with CSS prefixes – I don't know of a single one that has been deprecated or removed. From what I've seen, all that happens is more get added. And while I love to see browser competition, with more browsers come more prefixes.

I'm not alone in this. PPK at Quirksmode has similar feelings.

After reading a bit more about what other people have to say, and the A List Apart article, I can see that there are some uses for CSS vendor prefixes. The ability to differentiate between implementations in flux is especially nice (the example of clip is a good one). Although, I still don't think having eight or more prefixes (and have to worry about the order we use prefixed and non-prefixed words) for any new CSS words is such a great idea.

All in all, with browser versions and support moving so fast, it seems like a bit of a restriction to quick, iterative development to use or require vendor prefixes. Isn't the whole point to be able to use a standard set of CSS? And with the current rate of development, any browser really trying to compete will have their implementation standardised quite quickly.

Downsampling audio and Linux OS camera

Published
10 Jun 2010
Updated
10 Jun 2010

Part of today was spent researching what would be required to be able to down- (or up-) sample audio to a specific sample rate. It's quite complex. I don't have much knowledge or background in this area, so that doesn't help. It appears that the idea is to add or remove samples without modifying the sound. Which is not trivial.

Wikipedia has an explanation of what I want to do in the Sample Rate Conversion article. This helped a bit, but now I need to understand all the terms being used. What does "...creates images of frequency f..." mean?

A stackoverflow post also helped. It even includes some code! Now, how to use it? Is this the same thing as what I want to do? More when I have a chance.

I have a couple of old cameras and phone around the place, although none of them are mine - they're all from my family - why am I the dumping ground? Anyway, they're not being used for anything, so I wondered if there was something I could do with them along the lines of the CHDK project. This is an experiment that kind of 'turns on' hardware features in Cannon cameras that aren't available due to lack of firmware support. Could this be possible on other cameras, or even old phones as well? Maybe. What would be the best way to find out?

Games!

Published
8 May 2010
Updated
8 May 2010

It's been a while since I've posted anything here, but I've been getting into a few games recently, and wanted to note down what I've done. First of all, I'm still quite happy with Good Old Games and Valve's Steam store. I tend to go for the specials and bundles, as I'm not concerned with the latest and greatest, just good games.

Just today I found The Humble Indie Bundle - a pay what you want experiement for five rather brilliant indie games, plus donations to Child's play and Electronic Frontier Foundation (EFF) a very active civil liberties group. The games are great (I've played one or two of them before), and the causes are right down my alley.

Sound in Ubuntu Server 9.10 Karmic Koala

Published
13 Mar 2010
Updated
13 Mar 2010

I've recently attached my previously headless Ubuntu server to a TV - so it's purpose has morphed to be a server plus a media centre. I've installed Fluxbox, a minimal window manager for X. It means there's a GUI for the server for playing videos and maybe even youtube videos (if the old video card in the server can handle it).

All the extra software is available through the Ubuntu repositories. Installing fluxbox was not too difficult, although there were some problems getting everything required to run a GUI. It is quite configurable, but I haven't gotten around it that just yet. The default set-up is usable. Then just add Midori for web browsing and VLC for video.

Getting the wireless connection and sound to work was quite tricky. For wireless, I had a D-Link DWL-G122 802.11g Adapter available. The driver worked without any troubles, and I found wpa_supplicant the easiest way to set up the wireless. The two most important places to look when doing this are /etc/network/interfaces and /etc/wpa_supplicant/wpa_supplicant.conf. These were some of the most helpful pages:

Getting sound was a bit of a struggle. First of all, don't try making sound work in the 2.6.31-20 Linux kernel. It just doesn't. If you don't trust me, have a look around the web - people are finding problems everywhere. Next, it helps to have speakers plugged in (to the correct output jack) and turned on. Then check the volume in Linux. And the volume in the application.

For sound troubles, the best resource was this Comprehensive Sound Problem Solutions Guide. Since PulseAudio is the default Ubuntu sound server now, the documentation pages can be a real help.

Some of the most useful commands and files I found were:

alsamixer
command line volume control
less /proc/asound/modules
List the available/known sound cards.
ps ax | grep pulseaudio
Check if PulseAudio is running (there might be a entry for the grep command itself - ignore that).
pulseaudio -k
Kill any running pulseaudio server
pulseaudio -D
Start pulseaudio as a deamon (in the background)
/etc/modprobe.d/alsa-base.conf
ALSA config file in Ubuntu.
/etc/modprobe.d/sound.conf
Sound card config file in Ubuntu.
speaker-test
Use this command to play a test sound. Very useful to see if anything is actually happening.

Versioning a factory pattern or plugin architecture

Published
5 Mar 2010
Updated
5 Mar 2010

I have a problem: I need an architecture to allow for versioning a plugin, component or factory pattern in C#. The requirements are:

  • Simple way for a running program to access a new component.
  • When a new version is added, the older version still need to be available.
  • A way to specify which version of a component to use.
  • Standard interface for the program and the components to communicate.

I've got a couple of ideas. I could modify a plugin architecture to allow for versioning. I'm not really sure about dynamically loading dlls - bit more complex than what I have time for. Although I'm willing to listen to any reasoned arguments.

A console application wrapper could work. I could pass arguments for the various requirements. Then the console app could write out a text file in a well-known format. I'm not a real fan of writing and reading text files for communication if I can help it. I'd rather just call a method in code.

At the moment the console app is the most straight-forward idea. I'd have a whole bunch of directories named using the version. Then just create a new directory, copy over the required files, run the console app, read in the output file.

I'm really looking for a simple way to get this done without too much fooling around with complex c# concepts. Or a ready-made library.

Different faces of web development

Published
7 Feb 2010
Updated
7 Feb 2010

As a wider range of devices are able to access the internet, designing a website to work everywhere becomes more and more challenging. Desktop design is pretty much covered - it's the standard. Small screen design is slowly increasing in uptake, but it's still usually a second-thought, rather than a prime consideration. Unless a website is intended primarily for small-screen use. Now we're getting devices in between, such as tablets. Add with most of these new devices comes touch.

PPk's investigations and comments on touch support in mobile browsers shows a few things - more work is needed to make touch really work with websites, and web site developer will need to start supporting more than just mouse events. There are now three event types that need to be taken into account: mouse, keyboard and touch.

This area may be much more important than some other parts of HTML5. It is interesting to note that although Firefox and Opera are moving quite quickly in some area regarding HTML5 and added features, they score badly on touch and mobile browser UI support.