Welcome!

Joe Barr

Subscribe to Joe Barr: eMailAlertsEmail Alerts
Get Joe Barr via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Related Topics: Online Shopping

Online Shopping: Article

'Tis the season to frag with Linux

How to take out shopping-related aggression with Cube, an earthy first-person shooter game

(LinuxWorld) — We're in that "special" time of year between Thanksgiving and Christmas. Shopping time and tempers grow short. Parking spots grow scarce. Frustrations grow and multiply. Even in small towns, it is hard to escape the insanity. Last week in a small town near where I live, a man went berserk in a Wal-Mart parking lot and drove his truck into five other vehicles, presumably cracking under shopping-induced pressure.

This holiday season, it's healthy to save a little quiet time for yourself. To meditate on life's simple pleasures. To quietly and contemplatively cozy-up with a good FPS and frag everything that moves.

FPS, if you don't speak video-game, stands for First Person Shooter. You know, games like Quake or Unreal Tournament. If you run Linux and don't have the cash to buy UT2003 or Quake 3, you might think this path to inner peace is not available to you. Fret not, my dweebs. Aardappel (AKA Wouter van Oortmerssen) and his friends are here to help you. So long as your video card supports 3D and OpenGL, that is.

Cube is the name and killing is the game. Written with a single codebase to support both Windows and Unix platforms through the magic of open standards like OpenGL and SDL, the game is both free as in beer and as in speech. Cube is not bogged down with a long storyline or complex gameplay. According to the documentation, the official storyline goes like this: "You kill stuff. The end."

Cube is free software, albeit not as in GPL'd code. It uses a GPL-compatible, free software-license called the Zlib license, which is similar to the BSD license.

I was curious about the name, so I asked Aard (short for Aardappel) where it came from. He explained, "Just before starting Cube I made a tiny spherical landscape engine called 'Sphere'. I then used the base rendering code to start Cube, and quickly typed in 'Cube' as project name, since the geometry was expected to be mostly cubes... I never changed the name and when I wanted to change it, it was too late. I now regret it, as it's not a very unique name, though it doesn't seem to have been very problematic."

Aard also told me that the project did not start to be open-source, although it was designed to be cross-platform from day one. He says that as the code matured, various people began to make it clear to him that they could put the game engine to good use, so he decided to make it open-source near the end of the development phase.

Video gaming these days is not just big business, it is huge business. Last year, video games outearned the movie industry by $1 billion. Since Aard's day job is to write code for a game company, I asked how he would benefit from the game. He says that he wouldn't, except for one thing: the fun of it. "Making an entire game from start to finish by yourself is very rewarding," he says.

As far as contributions from others, most have been in the form of maps and textures. Lee Salzman rewrote the networking code for the multiplayer modes using UDP instead of TCP. Other than that, it's almost all Aard's baby.

Oh, before I forget: Aard is not exactly your typical free-software developer. His normal desktop is Windows XP, and he uses Visual Studio .Net for development. Why is he doing open-source for Linux then?

"I have always worked on multiple platforms," Aard says. He adds that he used to be an Amiga user and was a Linux user very early on. "I think one should have very good reasons why to NOT make something portable, and with games (thanks to OpenGL + SDL) there aren't," he says. It's a pity that game publishers don't see things that way.

One of Cube's best features is the ease and speed with which you can create maps. You'll see references to this aspect of the project on almost every menu. This is one reason Cube has proved popular as a basis for others writing mods or their own complete games. There are a number of sites where you can find alternative Cube maps.

Before the fragging you must prepare!

Enough of that. Let the killing begin. Here is a quick primer to get you playing in single-player, death-match or online multi-player mode.

First, grab the latest version off the official Web site. After you've downloaded it, create a Cube subdirectory and unpack the Zip file like this:

mkdir cube 
cd cube 
unzip ../cube_downloaded_file.zip

The result will be a Cube directory containing the docs, source code, data and Windows/Linux executables. Change the permissions on the cube_unix script in the installation directory by typing:

chmod +x cube_unix

Then go into the bin_unix directory and give linux_client and linux_server the same medicine. That's it. That's the installation.

NOTE: If you download the 10-20-2002 version of the game, there is a nasty bug in it that causes lockups when joining multiplayer games. You can find a newer Linux client binary (the source is on the same site) at http://tunes.org/~eihrul. Download cube_linux_clients_2002_10_28.tar.gz and decompress it in the bin_unix directory.

Being the lazy type, I went a little further and created an alias to execute the game by adding the following to my .bashrc:

alias cube='cd /home/warthawg/cube/;cube_unix'

Before you start the game, you should edit the autoexec.cfg file found in the directory you created and at the very least enter a name for your player. You might also want to change some of the other settings, but I was fine with the defaults.

Lock and load

OK, now you're ready to start the game. If you created an alias like mine and have reloaded your .bashrc file, just type the alias from the command line. If you didn't, go into the directory you created and enter:

sh cube_unix

After the game starts up, hit the ESC key to get to the main menu. Use the up and down arrows to negotiate the menus and choose either the single or multi-player option.

If you've chosen the single-player (SP) mode, a new menu will appear, giving you the choice of starting an SP map, a DMSP (single-player death match) map or changing the skill level. On a scale of 1 to 10, Cube starts you off at level 3. The screenshot below shows the beginning of the map called aard-1, available in DMSP.

Single-player Death Match
Editor's note: The above image is reduced in size and color palette to allow it to load quickly. Click on this image to see the original.

The difference between the SP and DMSP was explained to me on the #cube IRC channel. SP comes with a fixed number of opponents placed where the creator of the map desired. The death-match entries automatically spawn bot opponents as you kill them.

To play against others online, select multiplayer from the main menu, then select server browser. I usually find two to five active servers, but there are not always players available. Just keep checking, or start your own server and wait for others to come to you.

You can also amuse yourself by downloading custom maps created by others. I grabbed one called "myfilthymind" from pushplay's site (see Resources for the URL). I unzipped it in the packages directory. The next time I started cube, I pressed the tilde key to get a prompt, then entered map filthymind and there I was. As I mentioned earlier, making maps for Cube is a popular activity, so you can find a lot of them to play.

Is Cube the smoothest, most-polished, most-powerful game engine available for Linux? No way. However, it has a very real, earthy tone to it that you don't often find in commercial games. It is fun, and it is free. Moreover, not only can you use it to exorcise whatever demons are hounding you, you can create your own little universe to do it in.

This holiday season, Ol' Doc Barr recommends spending some quality time with Cube before your next trip to Wal-Mart. You and your fellow shoppers will thank me for it.

More Stories By Joe Barr

Joe Barr is a freelance journalist covering Linux, open source and network security. His 'Version Control' column has been a regular feature of Linux.SYS-CON.com since its inception. As far as we know, he is the only living journalist whose works have appeared both in phrack, the legendary underground zine, and IBM Personal Systems Magazine.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.