Starcraft on VirtualBox (and Hamachi)

Rationale

Starcraft on Wine is horribly slow due to the missing DIB engine.

Handling DIBs is a crucial component when it comes to fast 2D drawing. Other games like Age of Empires and even applications like Adobe Photoshop are affected by this weakness in Wine.

Work on this has started last year as a Summer of Code program, but progress has slowed down recently.

All in all I guess we won’t get a usable implementation within the next few years except if another dedicated effort is spent on it.

Enter VirtualBox

Luckily another solution has come up recently: Sun’s VirtualBox virtualization product is free (as in beer and freedom), easy to use and works well enough with Starcraft.

Here’s my basic setup: VirtualBox 3.0.0 (in beta state right now but so far it hasn’t crashed on me) with guest additions, Windows XP and Starcraft Brood War 1.16.1.

I have enabled DirectDraw acceleration and bridging as network mode in VirtualBox. Both are simple point-and-click settings; you need to make sure the vboxnetflt module is loaded, though.

All of Starcraft is usable and very importantly fast.

Resolution issues

Update: You can just use VBoxSDL to start your VM in proper fullscreen mode without jumping through the hoops below. Makes it much more convenient and reliable.

VirtualBox does not have a real full-screen mode. With the guest additions you’re able to get a Desktop that resizes automatically to fit, but fixed resolutions (Starcraft uses 640×480) will not be scaled up to fill the VirtualBox window or the whole screen.

I have tried XRandR but it just made the viewport smaller which is worse than useless.

The kludge here is to copy over your X config, remove all resolutions except for 640×480 and start a new X server. I cannot go into the full detail here but it boils down to this:

xinit /home/sky/scripts/xinitrc.2 -display :1 \
  -- :1 -ac -config xorg.conf.lowres

Put in some lightweight window manager or VirtualBox itself at the end of xinitrc.2.

After that just use VirtualBox as you have before and switch to full screen.

You should be ready to get the full experience of playing Starcraft now!

Bonus: Hamachi integration

Hamachi is a proprietary cross-platform VPN solution that is also beginner-friendly and gratis. It works well with my VirtualBox setup, too.

However the latest version (1.0.3.0) does seem to have some problems with UDP networking.

Downgrading to 1.0.1.4 helped, and I was even able to play Starcraft via a VPN. Don’t forget to turn off the helpful Windows firewall least it might interfere with your network.

Did this post help you?

If yes, then I’d like to know about it. Please also tell me about other games that work or don’t work with this setup.

If you’re really happy about it you may also send me a gift.

Clozure Common Lisp binaries packages

ArchLinux AUR now has a package build for the Clozure Common Lisp binaries, both 32-bit and 64-bit.

CCL is an excellent free alternative to the wide-spread SBCL.

Weblocks 0.8.2 is out

Quite shortly after the 0.8.1 release of Weblocks, Hunchentoot 1.0.0 was released.

Since this major release of Hunchentoot is not entirely backwards compatible we now have another release.

Besides working with the new Hunchentoot it offers:

  • A new example (simple-blog) has been added (with a matching screencast tutorial by Benjamin Collins).
  • An experimental Twitter widget by Ian Eslick (in contrib/)
  • The Elephant store backend working again

Apart from that it should be backwards-compatible with the earlier 0.8 releases.

Paul from Ardour needs your help

Ardour belongs to the flagship class of GNU/Linux software:

It’s a free software DAW and thus a valuable program that has the potential to attract a lot of semi-professional and professional audio users to GNU/Linux (given the pricing, missing portability and inferior support for customization of the commercial alternatives).

Until now its main developer Paul Davis was living off a corporate sponsorship. This has changed:

With the end of SAE sponsorship, subscriptions & donations are the only thing that make it possible for full-time development of Ardour to continue. In January this added up to US$1968. That’s less than 1 copy of Nuendo, 4 copies of Logic or 40 personal copies of Reaper. If you agree that it takes more than this to support to keep Ardour moving forward, please subscribe or donate. Your support is critical and much appreciated.

Paul has not only been the industrious main developer of a great piece of free software but also a valuable member of the GNU/Linux audio user and developer community.

Although I’m not an Ardour user right now I have subscribed for a monthly donation nevertheless.

I strongly suggest you support him, too.

Reblog this post [with Zemanta]

Pianist Marcus Loeber sells rights for his new album

Pianist and composer Marcus Loeber is collecting money for the release of his album “At the very moment”.

Here’s how it works:

First you choose how much you commit to pay while listening to excerpts from Marcus’ album.

If the target price total is reached by the end of 26 December 2008, the album is released under Creative Commons BY-NC-ND and you will be charged the fee you committed to pay before.

If the price is not reached then either Marcus will release the album nevertheless or he will decide to try something else. In the latter case you won’t be charged any money.

This album is definitely worth the money not only because of the music itself but also because it’s one of the new ways to get paid for digital content.

Remember? This is one of the new ways of selling music that the music industry refuses to take serious.

Let’s show them.

And while you’re at it, grab some free music at Jamendo, too. :)

Mercurial extensions for git features

I still enjoy work with Mercurial more, although git has grown a lot better in the last few years.

In the last few days I especially noticed that hg is faster for me than git (even after repack of the git repository).

That said, git has some very cool features that are missing in Mercurial.
Two of them are local branches (helpful for feature development or bug isolation) and the stash command that lets you stash away local changes for later (sort of a simplified patch queue).

Fortunately there are two extensions that provide both local branching and stash functionality.

Localbranches extension

Wiki page
http://www.selenic.com/mercurial/wiki/index.cgi/LocalBranches
Repository
http://hg.kublai.com/mercurial/extensions/localbranch

Shelve extension

Wiki page
http://www.selenic.com/mercurial/wiki/index.cgi/ShelveExtension
Repository
http://freehg.org/u/tksoh/hgshelve/

Installation

To use an extension just clone the repository and put the following line into the [extensions] section of your hgrc (create file and section if necessary):

EXTNAME=/path/to/EXTNAME.py

Usage examples are on the wiki pages.

Happy hacking!

Reblog this post [with Zemanta]

Muffling package redefinition warnings (SBCL)

The CLHS says the following about DEFPACKAGE:

If the new definition is at variance with the current state of that package, the consequences are undefined; an implementation might choose to modify the existing package to reflect the new definition.

SBCL opts to modify the package but throws a warning, most often in the form of “PACKAGE also exports the following symbols: …”.

Luckily the warning is a specific one, i.e. SB-INT:PACKAGE-AT-VARIANCE.

So to get rid of the warning the following macro helps:

(defmacro without-package-variance-warnings (&body body)
  `(eval-when (:compile-toplevel :load-toplevel :execute)
     (handler-bind (#+sbcl(sb-int:package-at-variance #'muffle-warning))
       ,@body)))

Apply sparsely.

We need the EVAL-WHEN to ensure that the non-toplevel definition of the package is available at compile time.

There’s a minor catch here. One might be tempted to put the EVAL-WHEN clause inside the HANDLER-BIND. But this leads to the package not being available at compile time (therefore rendering the EVAL-WHEN ineffective) because “the compile-time side effects described in Section 3.2 (Compilation) only take place when eval-when appears as a top level form.” (CLHS on EVAL-WHEN).

Does anyone know how to muffle these redefinition warnings in other implementations?

Weird release policies in PEAR land

I’m not very fond of PHP, but it’s hard to dodge it.

Fortunately the PEAR project has a set of excellent (well, as close to excellency as PHP lets you get…) libraries for all sorts of purposes.

The only thing with them is that they have problems managing their releases. The main site of the popular HTML Quickform library sports a fat warning sign, claiming that this package had been superseded by the aptly named HTML QuickForm 2 package.

That’s funny, because most if not all other packages depending on QuickForm are still built for the old version. Even more funny is what a vanilla install of the PEAR package tool will throws at anyone attempting to install QuickForm2:

% sudo pear install HTML_QuickForm2
Failed to download pear/HTML_QuickForm2 within preferred state "stable", latest release is version 0.2.0, stability "alpha", use "channel://pear.php.net/HTML_QuickForm2-0.2.0" to install
Cannot initialize 'channel://pear.php.net/HTML_QuickForm2', invalid or missing package file
Package "channel://pear.php.net/HTML_QuickForm2" is not valid
install failed

Now take into account that this situation has been in place for at least one year. Not really a role model for a sane software development release process.

Evidence B: Structures_Datagrid and a bunch of other packages are also marked “beta” but have been used by the majority (I daresay) of developers without any problems over the course of the last dekamonths.

What gives, PEAR?

Partial MP3 decoder in Haskell

Here’s a partially conforming MP3 decoder in Haskell.

It looks pretty clean even to me, not being a Haskell programmer.

Who’s up for it in Common Lisp? :)

JES, a KISS mail server

JES is a tiny Java mail server.

Very useful for testing local mail emitting routines.

Usage: download, extract, quickly edit the configuration files and execute bin/mail.sh.

Thanks, Eric!

« Previous PageNext Page »