Thursday, May 17, 2012

Playing Half Life 2 on an old/slow computer

I wanted to play Half Life 2 on an old laptop with Intel GMA 900 graphics (910GML/915GM chipset), but with the default settings the game would often become unbearably slow. So after doing some googling and lots of testing, I found some settings that seem to work.

  1. First, create a text file named autoexec.cfg and place it in the hl2/cfg folder. Give it the following contents:

    // see http://www.tweakguides.com/HL2_8.html for more information
    // also see https://developer.valvesoftware.com/wiki/List_of_HL2_Cvars

    // ***** major stuff *****
    mat_compressedtextures 1
    mat_forcemanagedtextureintohardware 0
    mat_softwarelighting 0
    // in pixels
    //r_decal_cullsize
    // specific number
    //r_decals
    // level of detail at a distance: -8 to 8
    //r_lod

    // ***** minor stuff *****
    cl_ejectbrass 0
    cl_show_splashes 0
    dsp_slow_cpu 1
    mat_bumpmap 0
    mat_dxlevel 70
    muzzleflash_light 0
    r_drawflecks 0
    r_waterforceexpensive 0
    sv_robust_explosions 0
    violence_ablood 0
    violence_agibs 0
    violence_hblood 0
    violence_hgibs 0

    // these are newer source 2007-based variables and may be unrecognized by older
    // versions of half life 2
    ai_expression_optimization 1
    mem_max_heapsize 768

  2. In your shortcut that you use to launch Half Life 2, add the following parameters:
    -novid -window -dxlevel 60 -heapsize 786432 -console

    The end result will look something like this:
    "C:\Program Files\Games\Half-Life 2\hl2.exe" -novid -window -dxlevel 60 -heapsize 786432 -console

  3. (Optional) Create valve.rc in the hl2/cfg folder, or edit the one that already exists, and make sure the startupmenu line is commented out by ensuring there are two slashes (//) in front of it.

  4. Lastly, read this article to get more information on what these tweaks mean and how to customize them for your system:
    http://www.tweakguides.com/HL2_1.html
If you're playing on a machine with integrated Intel graphics, GMABooster may help some as well.

Monday, April 30, 2012

my next OS: elementary



as ubuntu 12.04 brings yet another buggy release (see the comments here), I'm all the more excited about elementary's upcoming Luna release.

elementary, for those of you who don't already know, is everything linux (and any operating system) should be. it's crisp, clean, and most importantly, consistent! the team at elementary have created a desktop environment and suite of applications that adhere to a common set of interface guidelines. it's evident they care more about a great UX and UI than cramming more bells and whistles into an already inconsistent and unstable UI (ubuntu's unity).

for those of you suffering through another buggy ubuntu release with the lackluster unity desktop environment, I highly recommend elementary.

less is more.

Friday, April 27, 2012

Powerbook G4 not enough disk space

Solution:

Set the date and time.

Details:

So I had an old Powerbook G4 lying around that someone had given me. I hadn't used it in a while, and I turned it on, plugged a USB drive in, and tried to copy some files. I got an error message saying there wasn't enough disk space. Strange, as there was plenty of space, on the hard drive and the USB drive. I ctrl-clicked on the hard drive, clicked get info, and the space wasn't even reporting. Even more strange.

Well... turns out it was the fault of my own laziness. When I first booted the laptop, it said that the date had been reset, probably because the CMOS battery was dead. The error said that I'd probably have problems until I fixed the date, but hey, I just wanted to copy some files off, nothing serious.

Well, while I was putzing around, I decided to go ahead and set the date and time. Lo and behold, my problem went away. If I hadn't been so lazy and paid more attention to the error message I wouldn't have had the problem in the first place. Lesson learned? We'll see... :)

Thursday, April 19, 2012

problems overriding android compatibility methods

I had a class that extended android.support.v4.app.FragmentActivity. I wanted to override onRetainCustomNonConfigurationInstance, and I ran into the following error, indicating FragmentActivity didn't have that method:

The method onRetainCustomNonConfigurationInstance() of type ... must override or implement a supertype method


here's how to fix it:

  1. open the android SDK manager


  2. update the compatibility package


  3. copy the updated compatibility package to the /libs folder of your project. see here for where to find the compatibility package: http://developer.android.com/sdk/compatibility-library.html#SettingUp




that last part's what got me; I assumed updating the compatibility package would update it in my project :P

Wednesday, February 29, 2012

Playing old-school adventure games on Android


Did you know you can play many of the old-school point-and-click adventure games on your Android device? Here's how:

  1. Install the ScummVM app

  2. Check compatibility
    In the game compatibility list, pick a game you want to play, and make sure it's compatible. Be sure to click on the game and read the compatibility notes.

  3. Install the game engine
    Go to the list of game engines, find the game you want to play, and then find the engine it needs. Then go to the Google Play Store and install the correct plugin for that engine.

  4. Get the game data files
    Find your game in the data files list, and make note of the data files it needs. You need to get those data files from your copy of the game (install the game if necessary), and then put these files somewhere on the SD card of your phone.

  5. Add the game to ScummVM
    On your phone, open ScummVM, then click Add Game. Browse to the folder where you put the data files, highlight the folder, and click Choose
A few games, such as Beneath a Steel Sky and Flight of the Amazon Queen have even been released as freeware. See here on where you can get them. Here's what the above steps would look like for one of the free games, Teen Agent:

  1. Install ScummVM

  2. Install the teenagent engine plugin

  3. Download Teen Agent from GOG

  4. Install Teen Agent (if you're using Linux this works fine in Wine)

  5. Go to the Teen Agent installation folder, and copy all the *.res files somewhere to your Android device's storage/SD card

  6. Get the teenagent.dat file (which was mentioned in the compatibility notes for this game) and put it in the same folder where you put the *.res files

  7. On your phone, open ScummVM, then click Add Game. Browse to the folder where you put the Teen Agent files, highlight the folder, and click Choose.
In case you're curious, I haven't actually found Teen Agent to be very fun. In particular, the English translation isn't that great (the original game was Polish, I believe) and the puzzles are somewhat difficult because many of them aren't very intuitive; many of the solutions simply don't make much sense. I chose it intentionally as my example, though, because it's important to check out the compatibility notes for any quirks, like the teenagent.dat file in this case.

You might also find these links helpful in using ScummVM on Android:
Enjoy!

Friday, February 10, 2012

Free resources for learning Python

I've blogged on here a bit about Python, but it occurred to me that I haven't actually provided any resources for anyone interested in learning Python.

A great place to start is learnpython.org. It's got simple tutorials as well as an interactive shell so you can try it out as you learn.

There's also Dive Into Python, a free book that's also been published by Apress.

Dive Into Python covers Python 2, but there's a Python 3 version available as well for free, published by Apress as well.

Of course there are a lot of other free resources available, but less is more, and these two are a great place to start. A more comprehensive list of resources, free and non-free, are available here: http://wiki.python.org/moin/PythonBooks

Have fun!

Monday, February 6, 2012