Install Doom 3 in Ubuntu (from Steam)

January 4th, 2010 2 comments

These are further instructions to the Ubuntu Community documentation on Doom 3 (and Resurrection of Evil). Where those instructions deal with installing from the retail CDs which you’d be hard-pressed to find any more, my instructions are how to install from an existing Steam installation.

The Steam version of Doom 3 most likely exists within a Windows partition on your computer, but I don’t see why you couldn’t install Steam/Doom3 via Wine and copy the files over from that.

First, download the Doom 3 Linux installer from id software (~20MB). As of the time of this writing, the file name is doom3-linux-1.3.1.1304.x86.run.

Next, run the installer.

sudo sh doom3-linux-1.3.1.1304.x86.run

I left all options default, installing to /usr/local/games/doom3, which is why you need to run as sudo.

The game won’t run yet. We still have to copy the retail files over to the installation directory. So mount the Windows partition so we have access to those files.

The files we’re interested in are located in

Steam/steamapps/common/doom\ 3/base

and if you have the expansion

Steam/steamapps/common/doom\ 3/d3xp

and the CD-Keys (doomkey and xpkey) found in

Steam/steamapps/common/doom 3/base

To install Doom 3, navigate to the doom\ 3/base directory and copy each of

pak000.pk4
pak001.pk4
pak002.pk4
pak003.pk4
pak004.pk4

into

/usr/local/games/doom3/base

and if you are also installing Resurrection of Evil you’ll want to navigate to doom\ 3/d3xp and copy

pak000.pk4

into

/usr/local/games/doom3/d3xp

That’s it. To launch the game you can type

doom3

from the command line, and to launch Resurrection of Evil you type

doom3 +set fs_game d3xp

But wait! There’s more! A common complaint at this point is that the Steam CD-Key does not work. Doom 3 expects 18 characters, but the Steam provided CD Key contains only 16 characters.

Easy solution.

Copy doomkey, and xpkey if you have it, from the Doom 3 Steam directory into your local doom3 home directory

~/.doom3/base

Done!

Categories: technical Tags: , , , , ,

Java String Validation and Scrubbing

December 24th, 2009 No comments

I find myself more and more needing to validate user input, checking for illegal characters and empty Strings.

import java.util.LinkedList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
public class ScrubTest {
 
	public String scrubText(String dirty) {
		dirty = scrub("\\s+", dirty, " ");
		return scrub("^\\s?|\\s?$", dirty, "");
	}
 
	public String scrub(String pattern, String text, String replace) {
		Pattern p = Pattern.compile(pattern);
		Matcher matcher = p.matcher(text);
		return matcher.replaceAll(replace);
	}
 
	public static void main(String[] args) {
 
		ScrubTest st = new ScrubTest();
		LinkedList<String> list = new LinkedList<String>();
 
		list.add(new String("test"));
		list.add(null);
		list.add(new String(""));
		list.add(new String(" "));
		list.add(new String("\n"));
 
		for (String s : list) {
			System.out.println ("\nTesting string: \"" + s + "\"\n---------------");
			try {
				s = st.scrubText(s);
				System.out.println ("null:  " + (s == null));
				System.out.println ("empty: " + s.isEmpty());
				System.out.println ("\\n:    " + s.equalsIgnoreCase("\n"));
			}
			catch (Exception e) {
				System.out.println ("ERROR:" + e);
			}
		}
 
		String scrubbed = "\n\n\n   This   is       just a  test            \n    ";
		scrubbed = st.scrubText(scrubbed);
 
		System.out.println (scrubbed + ".");
	}
}

Produces:

Testing string: "test"
---------------
null:  false
empty: false
\n:    false

Testing string: "null"
---------------
ERROR:java.lang.NullPointerException

Testing string: ""
---------------
null:  false
empty: true
\n:    false

Testing string: " "
---------------
null:  false
empty: true
\n:    false

Testing string: "
"
---------------
null:  false
empty: true
\n:    false
This is just a test.

Linux Game Sales Count

December 23rd, 2009 No comments

I propose that when counting the “Linux sales” of a game to reduce the Windows sales of that title by the same amount.

I can’t speak for everyone, but when I purchase a game for Linux (usually via digital download) like these great games which are on sale right now:

when I’m offered links to the Linux version and to the Windows version, I download from the Linux link first but I always download the Windows version immediately after.

I’m uncertain how many people are out there who do the same thing, but I propose reducing the Windows count by a certain amount all the same.

I even bought a Windows netbook (and later returned it) with the intent of wiping Win and replacing with Linux.

Categories: technical Tags: , , ,

Game Design Canvas

December 7th, 2009 No comments

I’ve been reading a series of articles about a “Game Design Canvas”. The series focuses on game design, broken into 5 catagories. I recommend giving the articles a read.

There are currently three published, and presumably at least two more on the way.

Categories: Game Dev Tags: , , ,

Beer Bottle Rocket Man

October 30th, 2009 No comments

It’s done. I made the deadline (after two full days of working on it).

BBRM_Teaser01

Next time I’ve got a full month to work on the game, I’ll manage my time better. No more leaving it until the last few days.

Here is the forum post announcing the details.

Pretend this is an old Nintendo game and the story
and instructions are in the booklet but the game doesn't
make sense without the booklet.

This is the booklet: The evil doctor wants a beer, so he
sent you, his robot, down into the cellar to get it.
It's easy enough for you to walk down stairs, but your
legs are too short to climb back up. Being a heavy robot
with short legs, you can't jump very high. 

How are you going to get back up to the doctor to give
him his beer?

Note: It is possible to finish the game with a beer for each of
you and the doctor.