Resurrected Entertainment

Neverball: Under the Hood – Part #1

July 29, 2008

I’m a big fan of the Monkey Ball series produced by Sega. Sadly, I can’t just bring the game everywhere I go since it’s shackled to a console, and you just don’t get the same experience on one of the portables. So to get my 3D rolling ball fix more easily on the road, I have turned to a game called Neverball. Neverball is actually two games in one package; the second game is called Neverputt. It’s a GPL licensed game, so you can fool around with it to your heart’s content and maybe even contribute something worthwhile back to the project when you’re done.

Which brings me to the focus for this series of articles, we are going to add some functionality to the Neverball game. But before we can inject a new feature, it helps to understand how the game works and the architecture of the software; otherwise, we risk adding code which is either buggy, incomplete, or just awful. Since I really appreciate the stream-lined codebase for this project, I definetly do not want to sully the project using inferior source code, but that doesn’t really concern me since every drop of code I write is pure gold.

As a logical first step, let’s review the overall structure of the project. If you download it from the project’s website, you will be given a choice of packaging suitable for Windows, Linux, or Mac OS X platforms. For the most part, I’ll be focusing on the Linux platform, since it tends to be my development platform of choice in the here and now (although that’s quickly changing to the Mac). However, I will not forget about the other two and will relay any useful information for those platforms when I come across it.

Neverball has a simple build file using to generate the executables and compiled map data, although there is a Microsoft Visual Studio specific project file so you are saved from toiling with Cygwin. You should have little difficulty in getting it to compile using your favourite Linux distribution. It has dependencies on a few SDL libraries like SDL_image, SDL_ttf, and SDL_mixer. I would also recommend developing and testing this program on a machine using 3D hardware acceleration. Depending on the sophistication of your CPU, software emulation may not be terribly fast and can prove frustrating when you’re jumping into the game so frequently.

The project is structured into basically four pieces: data, modules specific to Neverball, modules specific to Neverputt, and the shared source code used by both programs. Between the two projects, Neverball is the larger and more full featured game. Neverputt uses the same rendering engine but customizes the game setup, layout, camera, etc. to suit the game of golf. The 3D rendering is entirely performed through OpenGL; there are no DirectX dependencies which is a boon for us since it makes the project more consistent and easier to modify.

The underlying engine uses objects and maps constructed from within a program called Gtk Radiant. I believe the most compatible version for Neverball would be 1.5, but 1.4 or earlier may work as well. A word of caution, the Gtk Radiant project does not build particularly easily on Mac OS X 10.5. You can find pre-built versions on the Internet via a small variety of sites, or you can simply download it here. In the next article, we’ll look at how to set up Gtk Radiant and get it working; we’ll also be looking at some of the higher level architectural pieces which makes the world of Neverball come to life.

No Responses to “Neverball: Under the Hood – Part #1”

Care to comment?