TweetFollow Us on Twitter

BZFlag

Volume Number: 20 (2004)
Issue Number: 06
Column Tag: Programming

BZFlag

by Dave Mark

A SourceForge Open Source Project

Lots to talk about this month. There's a new version of Xcode up on the net, I got an excellent new toy I'll touch on briefly, and for the main event, we're going to download and build an open source Mac OS X program called BZFlag.

The Latest Version of Xcode

There's a new version of Xcode on the Apple Developer Connection web site. Definitely worth the download. Make your way over to:

http://connect.apple.com

Login, then click on the Download Software link. Figure 1 shows the section of the page dedicated to the new version of Xcode, version 1.2.

If you are working off of an unadulterated Panther install, chances are good that you won't have an easy time using Safari to download the pieces that make up the new Xcode installer. Fortunately, there's a nifty piece of freeware that will make your job much easier.

MisFox is from a German programmer named Alexander Clauss and allows you to edit all the file mappings and protocol helpers used by Mac OS X. In our case, we want to set the FTP helper app to whatever FTP client you happen to be dating at the moment. Here's the URL for MisFox:

http://www.claussnet.de/misfox/misfox.html


Figure 1. The Xcode download listing in Safari.

When I wrote this, version 1.2.1 was the most recent release. Figure 2 shows the main MisFox window. Note that there are 3 tabs to choose from: Default Applications, File Mappings, and Protocol Helpers. I used the Default Applications tab to set my default FTP application to Interarchy.


Figure 2. The MisFox Default Applications pane.

If you go back to Figure 1, you'll see a Download button to the right of the Xcode Tools 1.2 CD. Once you use MisFox to set your default FTP client, Safari will hand the list of files behind that Download button to your client for easy downloading.

Xcode 1.2 consists of 21 segments. Download them, and if they are not automatically reassembled, just double-click on one of them. The disk image will be mounted and you can run the installer. Obviously, make sure you backup your hard drive before you do the install, just in case something goes horribly, horribly wrong.

When you first launch the new Xcode, you'll have a chance to go through the release notes to see what's new with the new version. If you miss your chance, go to the Help menu and select Show Release Notes. Lots of good info here. Still some issues to address, but lots of fixes, making this release of Xcode more stable overall.

An Awesome New Keyboard

In the March 29th issue of TidBits, Adam Engst wrote a glowing review of the Tactile Pro keyboard from Matias. Here's a picture of the keyboard:

http://halfkeyboard.com/tactilepro/ viewer/tp_mainpic.html

Here's Adam's eloquent review:

http://db.tidbits.com/getbits.acgi?tbart=07607

I live on my PowerBook. Have a 17" Apple Studio Display. But have never found a keyboard I was really happy with. Until now. As you'll find when you read Adam's review, the designers made some excellent decisions when it came to laying out the keyboard. But to me, the most important aspect of this keyboard is its incredible responsiveness. The keys on my PowerBook keyboard are mushy. Perhaps a better way of saying this is, I can't feel the micro-switches underneath the keys when I press them. The keys on the Tactile Pro keyboard, however, clack when I press them, the reassuring clack of a micro-switch being depressed. The throw of each key is deeper, meaning that I have to press each key down further as I type. This might seem like a bad thing, but it is not. I can tell when I've pressed a key and the Tactile Pro keyboard is much more forgiving that any other keyboard I've tried. The result is much faster typing speeds with much higher accuracy.

If you've ever typed on the old Apple Extended Keyboard (think back to the days of the original Macintosh II), you'll have a sense of the Tactile Pro. They used the same mechanical keyswitches, and the result is brilliant. You can buy it online at http://tactilepro.com, $99.95.

Mac OS in an Open Source World

A long, long time ago, back before Cocoa and the second coming of Steven P. Jobs, the Mac was pretty much an island. You were either a Mac person or you were not. When it came to Mac sample code, there were some wonderful communities set up, but they were always either Apple-driven, or catered for the most part to Mac people. If you found some cool Unix/X windows code, chances are pretty good that any sample projects were set up for Windows or Unix-based environments, Mac folk need not apply.

Now that Mac OS X has passed through the steep portion of its adoption curve, there is much more of an acceptance of the Mac among the open source crowd. A perfect example of this can be seen at the big dog of development web sites, http://sourceforge.net.

Now, you might think that your favorite web site has lots of sample code and a big community of users, but no. This is big. SourceForge has more than 800,000 registered users (and that number does not include the hundreds of thousands of developers who just like to poke around) and more than 80,000 hosted projects. Those are crazy huge numbers.

In the olden days, there might have been a few scattered Mac projects, but they would have been few and far between. Navigate over to http://sourceforge.net and click on the software map button, just below the banner ad towards the top of the window. Here's the URL that will get you there directly:

https://sourceforge.net/softwaremap/ trove_list.php

This is a useful page if you are looking for a project and know the topic. But you can also browse by other categories, including OS. Click on the Operating System link. Again, here's the direct link:

https://sourceforge.net/ softwaremap/trove_list.php?form_cat=199

Figure 3 shows the OS categories, along with the number of projects in each category. More than three thousand Mac OS projects. This is cool!


Figure 3. The list of SourceForge projects, listed by OS.

If you click on Mac OS, and then on Mac OS X, you'll find 2,290 Mac OS X projects, 1,526 of which are Cocoa projects. That is a pretty rich vein of interesting material to explore. And, who knows, you might find a project that interests you so much that you'll dig in and get involved with the development process. SourceForge (and Open Source, in general) is cool that way.

It is worth noting that there are many projects that support the Mac or will just plain run on the Mac that are not necessarily in the MacOS category. For example, there are several thousand Mac-savvy projects in the OS Independent and POSIX categories.

Read through the rest of this column, then start digging around, see what you can find.

Building BZFlag

Each month, SourceForge nominates a Project of the Month. This past April, the project of the month was a cool tank-based shooter game named BZFlag. Here's a link to the SourceForge BZFlag page:

https://sourceforge.net/potm/potm-2004-04.php

Cool! Pictures of Tim Riker, David Trowbridge, and Sean Morrison, BZFlag's key developers. The page contains a lot of interesting info, including an interview with the principals. This is pretty typical of a "potm" (project of the month) page. The potm URLs are well constructed, so you replace the 2004-04 with a 2004-03 to get to the March project of the month:

https://sourceforge.net/potm/potm-2004-03.php

The potm page is more of a marketing page. On it, you'll find a link to the SourceForge BZFlag Project page:

https://sourceforge.net/projects/bzflag

This is the actual SourceForge home for BZFlag, where you'll go to download the various sources and binaries for the different platforms BZFlag supports. These pages are very well organized. Figure 4 shows the listing of recent BZFlag file releases. The link at the bottom of the figure takes you to a page with a much more exhaustive listing.


Figure 4. The list of recent BZFlag file releases on the project page.

If all we were interested in was the app itself, we could download the binary for our platform. Now BZFlag is a lot of fun to play, but there's something gratifying about successfully building an app on your own machine, especially an app as complex as this one.

Click on the bzflag source link towards the bottom of the list. Be sure to click on the one with the most recent date. As you can see, I'll be working with the one labeled April 25, 2004.

This link will take you to a page listing various source releases, including the one you selected. Source code is archived in a number of different ways, depending on the OS. In general, you do not want to download a .zip file. This will likely be a build intended for a Windows machine. The permissions will not be setup for Mac OS X, and there will also likely be carriage return/line feed confusion as well. For Mac OS X, look for a tar.bz2 or a tar.gz archive.

Click on the link labeled:

bzflag-1.10.5.20040426.tar.bz2

This will take you to a download page. Select your nearest location and click the link to start the download. StuffIt Expander will expand the archive just fine.

In the Finder, open the newly expanded directory. In my case, it was called bzflag-1.10.5.20040426. Now open the subdirectory src/platform/MacOSX. As the name implies, these are the build files for Mac OS X.

When the Xcode project window appears, click on the targets popup menu (it's in the upper-left corner) and select BZFlag (Figure 5).


Figure 5. The BZFlag targets popup from the BZFlag project window.

Now select Build and Run from the Build menu. This is gonna take a while, so this might be a good time to alphabetize those Zamfir pan flute CDs you've been collecting.

When you start the build, if nothing appears to be happening, it may be that you have the split closed in your build window. If your build window is not divided into two distinct panes, click on the dot on the bottom edge of the window and drag it up, towards the middle of the window (Figure 6). The build is driven by a set of Makefiles (Unix build scripts) and the script steps are shown in the bottom pane, while Xcode's compile messages will be shown in the top pane.


Figure 6. Be sure you split your build window by dragging the dot from the bottom of the window towards the middle.

If you get an error message during the build process, try changing the target to BZAdmin, doing a Build of that target, then selecting BZFlag as a target and doing a Build and Run again. Worst case, do a Build of the Everything target, then select BZFlag and do a Run. You need to run the BZFlag target to run the game.

Have fun playing BZFlag. It will take over the entire screen and put up a simple menu. Navigate the menu with the arrow keys and the return key. Escape takes you back up a level. Your choices are Join Game, Options, Help, and Quit. Review the help and options if you like, then select Join Game. This will take you to a new menu screen. Select Find Server, scroll through the list of servers to find a game you like, select the game, then select Connect.

That's it. You're in the game. And there is always a game going. It is amazing how big this game has gotten. When you are done playing, hit escape, then arrow down to Quit.

Doing a Unix Build

Not every Mac OS X project will ship with an Xcode project. That's OK, though. As long as the developers included the appropriate make files, we can use those to do our build. So if you had some trouble with your Xcode build or if you just want to give the Unix build process a try, here's the process.

Use the cd command to navigate into the top level of the BZFlag folder you downloaded. For example, I unstuffed my archive onto my desktop. From my home directory, I did:

cd Desktop

and then I did:

cd bzflag-1.10.5.20040426

I then did:

./autogen.sh 

The leading "./" tells the Unix shell to execute the shell script contained in the file autogen.sh found in the current directory, that is, in the directory bzflag-1.10.5.20040426.

The script hangs a bit, then spits out this message:

BZFlag sources are now prepared. To build here, run:
 ./configure
 make

And that's exactly what you want to do next. First, type:

./configure 

This will create a bunch of Makefiles and do a few other things. When it is done, type this command:

make

Got a dual processor G5? If so, do a:

make -j2 

This tells make to split the task into two concurrent jobs. Gets the job done in half the time!

This will take a while. You'll be compiling a fairly large batch of code, so sit back and dream about Gilligan's Island. Who would you be? Hmmm...

By the way, in case you were wondering, gcc is the C compiler, and g++ is the GNU C++ compiler.

The build should take about 10 minutes (obviously, depends on your processor). To run the binary, be sure you are still in that top directory and type the command:


src/bzflag/bzflag 

If you get an error message, do an ls and verify that there is a directory named src in the current directory. If not, you may have changed directories

Till Next Month...

Hopefully, between the Xcode method and the Terminal method, you've gotten BZFlag to run. Here are a couple of BZFlag related sites that can help you with your gameplay:

http://www.dervishdukot.org/home/bzflag/bzflag.html

http://bzflag.org/wiki

Also, if you are IRC-savvy, you can make your way over to #bzflag on irc.freenode.net with any questions or comments.

Your homework assignment is to search through some of the other Open Source projects on SourceForge.net listed in the Mac OS X area, find one you like, and get it to build.

A huge shout out to Sean "brlcad" Morrison for his most excellent help in getting BZFlag to build.

Oh, and be sure to head over to http://www.spiderworks.com and sign up for the email list. See you next month...


Dave Mark is a long-time Mac developer and author and has written a number of books on Macintosh development. Dave has been writing for MacTech since its birth! Be sure to check out Dave's latest and greatest at http://www.spiderworks.com.

 
AAPL
$102.50
Apple Inc.
+0.25
MSFT
$45.43
Microsoft Corpora
+0.55
GOOG
$571.60
Google Inc.
+2.40

MacTech Search:
Community Search:

Software Updates via MacUpdate

Skype 6.19.0.450 - Voice-over-internet p...
Skype allows you to talk to friends, family and co-workers across the Internet without the inconvenience of long distance telephone charges. Using peer-to-peer data transmission technology, Skype... Read more
VueScan 9.4.41 - Scanner software with a...
VueScan is a scanning program that works with most high-quality flatbed and film scanners to produce scans that have excellent color fidelity and color balance. VueScan is easy to use, and has... Read more
Cloud 3.0.0 - File sharing from your men...
Cloud is simple file sharing for the Mac. Drag a file from your Mac to the CloudApp icon in the menubar and we take care of the rest. A link to the file will automatically be copied to your clipboard... Read more
LibreOffice 4.3.1.2 - Free Open Source o...
LibreOffice is an office suite (word processor, spreadsheet, presentations, drawing tool) compatible with other major office suites. The Document Foundation is coordinating development and... Read more
SlingPlayer Plugin 3.3.20.505 - Browser...
SlingPlayer is the screen interface software that works hand-in-hand with the hardware inside the Slingbox to make your TV viewing experience just like that at home. It features an array of... Read more
Get Lyrical 3.8 - Auto-magically adds ly...
Get Lyrical auto-magically add lyrics to songs in iTunes. You can choose either a selection of tracks, or the current track. Or turn on "Active Tagging" to get lyrics for songs as you play them.... Read more
Viber 4.2.2 - Send messages and make cal...
Viber lets you send free messages and make free calls to other Viber users, on any device and network, in any country! Viber syncs your contacts, messages and call history with your mobile device,... Read more
Cocktail 7.6 - General maintenance and o...
Cocktail is a general purpose utility for OS X that lets you clean, repair and optimize your Mac. It is a powerful digital toolset that helps hundreds of thousands of Mac users around the world get... Read more
LaunchBar 6.1 - Powerful file/URL/email...
LaunchBar is an award-winning productivity utility that offers an amazingly intuitive and efficient way to search and access any kind of information stored on your computer or on the Web. It provides... Read more
Maya 2015 - Professional 3D modeling and...
Maya is an award-winning software and powerful, integrated 3D modeling, animation, visual effects, and rendering solution. Because Maya is based on an open architecture, all your work can be scripted... Read more

Latest Forum Discussions

See All

Rhonna Designs Magic (Photography)
Rhonna Designs Magic 1.0 Device: iOS Universal Category: Photography Price: $1.99, Version: 1.0 (iTunes) Description: Want to sprinkle *magic* on your photos? With RD Magic, you can add colors, filters, light leaks, bokeh, edges,... | Read more »
This Week at 148Apps: August 25-29, 2014
Shiny Happy App Reviews   | Read more »
Qube Kingdom – Tips, Tricks, Strategies,...
Qube Kingdom is a tower defense game from DeNA. You rally your troops – magicians, archers, knights, barbarians, and others – and fight against an evil menace looking to dominate your kingdom of tiny squares. Planning a war isn’t easy, so here are a... | Read more »
Qube Kingdom Review
Qube Kingdom Review By Nadia Oxford on August 29th, 2014 Our Rating: :: KIND OF A SQUARE KINGDOMUniversal App - Designed for iPhone and iPad Qube Kingdom has cute visuals, but it’s a pretty basic tower defense game at heart.   | Read more »
Fire in the Hole Review
Fire in the Hole Review By Rob Thomas on August 29th, 2014 Our Rating: :: WALK THE PLANKUniversal App - Designed for iPhone and iPad Seafoam’s Fire in the Hole looks like a bright, 8-bit throwback, but there’s not enough booty to... | Read more »
Alien Creeps TD is Now Available Worldwi...
Alien Creeps TD is Now Available Worldwide Posted by Ellis Spice on August 29th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Dodo Master Review
Dodo Master Review By Jordan Minor on August 29th, 2014 Our Rating: :: NEST EGGiPad Only App - Designed for the iPad Dodo Master is tough but fair, and that’s what makes it a joy to play.   | Read more »
Motorsport Manager Review
Motorsport Manager Review By Lee Hamlet on August 29th, 2014 Our Rating: :: MARVELOUS MANAGEMENTUniversal App - Designed for iPhone and iPad Despite its depth and sense of tactical freedom, Motorsport Manager is one of the most... | Read more »
Motorsport Manager – Beginner Tips, Tric...
The world of Motorsport management can be an unforgiving and merciless one, so to help with some of the stress that comes with running a successful race team, here are a few hints and tips to leave your opponents in the dust. | Read more »
CalPal Update Brings the App to 2.0, Add...
CalPal Update Brings the App to 2.0, Adds Lots of New Stuff Posted by Ellis Spice on August 29th, 2014 [ permalink ] | Read more »

Price Scanner via MacPrices.net

Apple now offering refurbished 21-inch 1.4GHz...
The Apple Store is now offering Apple Certified Refurbished 21″ 1.4GHz iMacs for $929 including free shipping plus Apple’s standard one-year warranty. Their price is $170 off the cost of new models,... Read more
Save $50 on the 2.5GHz Mac mini, on sale for...
B&H Photo has the 2.5GHz Mac mini on sale for $549.99 including free shipping. That’s $50 off MSRP, and B&H will also include a free copy of Parallels Desktop software. NY sales tax only. Read more
Save up to $300 on an iMac with Apple refurbi...
The Apple Store has Apple Certified Refurbished iMacs available for up to $300 off the cost of new models. Apple’s one-year warranty is standard, and shipping is free. These are the best prices on... Read more
The Rise of Phablets
Carlisle & Gallagher Consulting Group, a businesses and technology consulting firm focused solely on the financial services industry, has released an infographic depicting the convergence of... Read more
Bad Driver Database App Allows Good Drivers t...
Bad Driver Database 1.4 by Facile Group is a new iOS and Android app that lets users instantly input and see how many times a careless, reckless or just plain stupid driver has been added to the... Read more
Eddy – Cloud Music Player for iPhone/iPad Fre...
Ukraine based CapableBits announces the release of Eddy, its tiny, but smart and powerful cloud music player for iPhone and iPad that allows users to stream or download music directly from cloud... Read more
A&D Medical Launches Its WellnessConnecte...
For consumers and the healthcare providers and loved ones who care for them, A&D Medical, a leader in connected health and biometric measurement devices and services, has launched its... Read more
Anand Lal Shimpi Retires From AnandTech
Anand Lal Shimpi, whose AnandTech Website is famous for its meticulously detailed and thoroughgoing reviews and analysis, is packing it in. Lal Shimpi, who founded the tech site at age 14 in 1997,... Read more
2.5GHz Mac mini, Apple refurbished, in stock...
The Apple Store has Apple Certified Refurbished 2.5GHz Mac minis available for $509, $90 off MSRP. Apple’s one-year warranty is included, and shipping is free. Read more
13-inch 2.5GHz MacBook Pro on sale for $999,...
B&H Photo has the 13″ 2.5GHz MacBook Pro on sale for $999.99 including free shipping plus NY sales tax only. Their price is $100 off MSRP. Read more

Jobs Board

*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
Senior Event Manager, *Apple* Retail Market...
…This senior level position is responsible for leading and imagining the Apple Retail Team's global event strategy. Delivering an overarching brand story; in-store, Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.