mikeash.com: just this guy, you know?

Posted at 2006-02-20 00:00 | RSS feed (Full text feed) | Blog Index
Next article: What Every Programmer Should Know
Previous article: Bug Reversal
Tags: bolo games
by Mike Ash  

A couple of articles back, I wrote an article about Bolo, and briefly mentioned an OS X version called nuBolo. Those of you who have tried it have no doubt noticed how authentic it is. You may also have noticed that it's lacking Bolo's Brains (AI plugins) support. I'm working on a module to add Brains support to nuBolo, and I've reached the stage where I thought I'd make a post about it.

As a programmer, brains are one of the most interesting things about Bolo. The Bolo world is relatively simple, but with complicated emergent properties (as discussed in the previous article). This means that interfacing a program with it is easy, but it's still challenging to get it to do something intelligent. In addition, Bolo is a real-time game, making it all the more interesting to real-time programming weenies such as myself.

A huge number of brains were written for Bolo. There were normal bots that tried to play like a human such as Indy, aIndy, and Ladmo, bogs which allowed human control over the tank but helped that human play better, and specialized brains that did things like record quicktime movies of the game. I never wrote anything that I released, but I did make a modification of Indy so it could play a specialized type of game called Tix Tox Pillbox, and I worked on a game recorder that was never finished. The idea of being able to write a brain on OS X with comparatively huge CPU speeds and things like preemptive threads is very appealing to me.

The existence of borgs is one of the reasons nuBolo doesn't support brains. There were some pretty nasty borgs back in the day that tried to hide their existence to provide the player with a hidden advantage, and some that just outright cheated by fiddling with Bolo's private variables.

I came up with a design that helps to eliminate those concerns, nuBolo's author accepted it, and now I'm actually implementing it. The major change in architecture is to move everything brain-related into an external brains server. This server will run as a separate application, and all of the brains will be loaded into it. nuBolo will send game data over mach ports, which will then be handed over to brain plugins. The commands generated by brain plugins will be sent back to nuBolo over mach ports, and then executed in nuBolo. Mach ports are reasonably lightweight, and this separation means that a brains plugin can't touch nuBolo's private variables*.

Another big change is that substantially less data will be provided to the brains. Bolo provides more data to brains than it actually provides to human players, even when its "brains advantage" checkbox is turned off. This helps make brains smarter, but it makes it trivial to cheat by simply writing a borg that reports this extra data to the human, and does nothing else. nuBolo will provide almost exactly the same data to the brains as it does to a human player, eliminating this problem**.

Currently the code is still in the relatively early stages. The code that will eventually be in nuBolo is working and reasonably complete. The server is implemented enough to talk to nuBolo and send data back and forth, but there's currently no plugin interface. I think the communications code was the hardest part, and that's basically done now, so the rest ought to be straightforward.

Stay tuned for more.

* Yes, I know there are lots of other ways to get code and data into a process you don't own, so there's no need to remind me.

** The main exception is that brains get the entire viewable area around the tank without needing to scroll. Since a brain could scroll fast enough to simulate this anyway, it makes no real difference, and substantially simplifies brain programming.
Did you enjoy this article? I'm selling a whole book full of them. It's available for iBooks and Kindle, plus a direct download in PDF and ePub format. It's also available in paper for the old-fashioned. Click here for more information.


Madd the Sane at 2007-05-11 06:10:00:
That is interesting. I did notice the brain menu on nuBolo version 1.0b9a and thought it was just a leftover feature from the Classic days. This leads me to ask how far is the Bolo Brain Server along? Is it done?
Sorry if this is posted twice. I’m using a text-based web browser.

Ryan Stout at 2007-11-28 11:27:52:
Hey, I am also wondering what the status is. I created ryan2 for WinBolo a few years ago, and have been wanting to pick it back up. Having now become a mac user, I like the idea of giving it a try for nuBolo. Too bad the community is mostly dead for this kind of thing. For me it's just a fun programming challange. Let me know if you need any help... ryanstout--at--gmail dot com

Mike at 2011-08-04 13:19:15:
Any status updates on this? I'd love to have bolo on the iPad as well!

Comments RSS feed for this page

Add your thoughts, post a comment:

Spam and off-topic posts will be deleted without notice. Culprits may be publicly humiliated at my sole discretion.

Web site:
Formatting: <i> <b> <blockquote> <code>. URLs are automatically hyperlinked.
Hosted at DigitalOcean.