Patch for SolarWolf

Icon


Contents:

1   Overview
2   Screenshot
3   Details



1. Overview.

This page is intended for CLI developers.

SolarWolf is a FOSS arcade game created by Peter Shinners in the 2000s. It's modeled after a 1980s game for the Atari 2600 named Solar Fox.

SolarWolf is pretty good but, as of 2011, it hasn't been updated by the original developer since 2004. Linux distros are continuing to distribute the program with distro-specific patches. However, the patches don't fully address one significant problem: a lock-up that occurs on some systems when the program starts up.

This page provides a patch file for SolarWolf that includes my work-around for the lock-up problem and additional fixes from various distros related to the same problem and other issues.





2. Screenshot.

Here's what SolarWolf looks like under my Linux distro. Note: For more distro screenshots, click here.


image





3. Details.

On some systems, the standard version of SolarWolf slows down (or locks up entirely) at startup time.

Some Linux distros address the problem by changing the way that fonts are handled. However, the program started up slowly on my system whether or not the fonts change was used. In some cases, one or two minutes passed before startup was completed.

The problem seemed to be related to the way that threads (a Python language feature) were used. I settled on the following simple work-around, which corrected the problem:


=== cut here ===
--- solarwolf-1.5.old/code/gameinit.py
+++ solarwolf-1.5/code/gameinit.py
@@ -4,6 +4,7 @@
 from pygame.locals import *
 import sys, threading
 import game, gfx, snd, txt, input
+import time
 
 load_total = 0
 load_current = 0
@@ -140,6 +141,7 @@
 
 
     def run(self):
+        time.sleep(3)
         if self.rect:
             self.background(self.rect)
         gfx.updatestars(self.background, gfx)
=== cut here ===

After this change was made, SolarWolf started up in three seconds for me (as opposed to the one or two minutes that it took before).

For the benefit of any developer who's interested, the following ZIP file contains a standard Linux patch file for SolarWolf 1.5. The patch file includes the fonts and threads changes discussed above and other fixes from various Linux distros:

solarwolf-1.5-all-fixes.zip

To download, right click (or, on a Mac, use control-click).

To obtain the upstream (i.e., original) SolarWolf source code and more information about the program, visit:

http://www.pygame.org/shredwheat/solarwolf/index.shtml


SolarWolf needs Python, Pygame, and SDL. However, if these packages are present, no “build” procedure is required. You just need to unpack the SolarWolf sources and apply the patch. For example (modify the paths shown here appropriately):


cd /var/tmp
tar zxf /foo/solarwolf-1.5.tar.gz
cd solarwolf-1.5
unzip /foo/solarwolf-1.5-all-fixes.zip
patch -p1 < solarwolf-1.5-all-fixes.patch

The ZIP file is provided by one of the links earlier on this page. The tarball is available at the official SolarWolf page (also linked above).

If the preceding steps have been done, and you're still in the solarwolf-1.5 directory, the following command should run the game:

python solarwolf.py





Hosting provided by Zymic.

For acknowledgments related to CSS and other code used, click here.

Linked or embedded works (software, books, articles, etc.) are presented under their own licenses.

Other unique content on this page, excluding screenshots, is distributed under the following license: C.C. Attribution NonCommercial ShareAlike 3.0. In some cases, screenshots are distributed under the same license. In other cases, the associated program's license applies.

image Valid XHTML 1.0