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.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links... | Read more »
Price of Glory unleashes its 1.4 Alpha u...
As much as we all probably dislike Maths as a subject, we do have to hand it to geometry for giving us the good old Hexgrid, home of some of the best strategy games. One such example, Price of Glory, has dropped its 1.4 Alpha update, stocked full... | Read more »
The SLC 2025 kicks off this month to cro...
Ever since the Solo Leveling: Arise Championship 2025 was announced, I have been looking forward to it. The promotional clip they released a month or two back showed crowds going absolutely nuts for the previous competitions, so imagine the... | Read more »
Dive into some early Magicpunk fun as Cr...
Excellent news for fans of steampunk and magic; the Precursor Test for Magicpunk MMORPG Crystal of Atlan opens today. This rather fancy way of saying beta test will remain open until March 5th and is available for PC - boo - and Android devices -... | Read more »
Prepare to get your mind melted as Evang...
If you are a fan of sci-fi shooters and incredibly weird, mind-bending anime series, then you are in for a treat, as Goddess of Victory: Nikke is gearing up for its second collaboration with Evangelion. We were also treated to an upcoming... | Read more »
Square Enix gives with one hand and slap...
We have something of a mixed bag coming over from Square Enix HQ today. Two of their mobile games are revelling in life with new events keeping them alive, whilst another has been thrown onto the ever-growing discard pile Square is building. I... | Read more »
Let the world burn as you have some fest...
It is time to leave the world burning once again as you take a much-needed break from that whole “hero” lark and enjoy some celebrations in Genshin Impact. Version 5.4, Moonlight Amidst Dreams, will see you in Inazuma to attend the Mikawa Flower... | Read more »
Full Moon Over the Abyssal Sea lands on...
Aether Gazer has announced its latest major update, and it is one of the loveliest event names I have ever heard. Full Moon Over the Abyssal Sea is an amazing name, and it comes loaded with two side stories, a new S-grade Modifier, and some fancy... | Read more »
Open your own eatery for all the forest...
Very important question; when you read the title Zoo Restaurant, do you also immediately think of running a restaurant in which you cook Zoo animals as the course? I will just assume yes. Anyway, come June 23rd we will all be able to start up our... | Read more »
Crystal of Atlan opens registration for...
Nuverse was prominently featured in the last month for all the wrong reasons with the USA TikTok debacle, but now it is putting all that behind it and preparing for the Crystal of Atlan beta test. Taking place between February 18th and March 5th,... | Read more »

Price Scanner via MacPrices.net

AT&T is offering a 65% discount on the ne...
AT&T is offering the new iPhone 16e for up to 65% off their monthly finance fee with 36-months of service. No trade-in is required. Discount is applied via monthly bill credits over the 36 month... Read more
Use this code to get a free iPhone 13 at Visi...
For a limited time, use code SWEETDEAL to get a free 128GB iPhone 13 Visible, Verizon’s low-cost wireless cell service, Visible. Deal is valid when you purchase the Visible+ annual plan. Free... Read more
M4 Mac minis on sale for $50-$80 off MSRP at...
B&H Photo has M4 Mac minis in stock and on sale right now for $50 to $80 off Apple’s MSRP, each including free 1-2 day shipping to most US addresses: – M4 Mac mini (16GB/256GB): $549, $50 off... Read more
Buy an iPhone 16 at Boost Mobile and get one...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering one year of free Unlimited service with the purchase of any iPhone 16. Purchase the iPhone at standard MSRP, and then choose... Read more
Get an iPhone 15 for only $299 at Boost Mobil...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering the 128GB iPhone 15 for $299.99 including service with their Unlimited Premium plan (50GB of premium data, $60/month), or $20... Read more
Unreal Mobile is offering $100 off any new iP...
Unreal Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering a $100 discount on any new iPhone with service. This includes new iPhone 16 models as well as iPhone 15, 14, 13, and SE... Read more
Apple drops prices on clearance iPhone 14 mod...
With today’s introduction of the new iPhone 16e, Apple has discontinued the iPhone 14, 14 Pro, and SE. In response, Apple has dropped prices on unlocked, Certified Refurbished, iPhone 14 models to a... Read more
B&H has 16-inch M4 Max MacBook Pros on sa...
B&H Photo is offering a $360-$410 discount on new 16-inch MacBook Pros with M4 Max CPUs right now. B&H offers free 1-2 day shipping to most US addresses: – 16″ M4 Max MacBook Pro (36GB/1TB/... Read more
Amazon is offering a $100 discount on the M4...
Amazon has the M4 Pro Mac mini discounted $100 off MSRP right now. Shipping is free. Their price is the lowest currently available for this popular mini: – Mac mini M4 Pro (24GB/512GB): $1299, $100... Read more
B&H continues to offer $150-$220 discount...
B&H Photo has 14-inch M4 MacBook Pros on sale for $150-$220 off MSRP. B&H offers free 1-2 day shipping to most US addresses: – 14″ M4 MacBook Pro (16GB/512GB): $1449, $150 off MSRP – 14″ M4... Read more

Jobs Board

All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.