MOTD

Message Of The Day

Mon, 19 Dec 2005

00:25 [zork(~)] cat pygame.txt

The Wonders of Pygame

After spending a good amount of time in the SAIS source code and getting a feel for the game logic, I sent a long mail to a collaborator with my dream goals for the system. I listed a bunch of things, but my real pie-in-the-sky items were these:

After poking around through lua some, I chanced to take another stroll through the pygame docs. I had not remembered how high-level pygame is compared to using libsdl in C! Pygame has all sorts of great rect methods and sprite groups and other great features that make it a real win. So now I'm taking up the fool's errand of the second system.

I've got access to the SAIS code, so I've been trolling through it to figure out some of the math behind the game object interactions. The camera math is some of the clever stuff, and I am thinking of making heavy use of pygame's rect magic to make that happen.

And then I'll make the game AI, situations, ship definitions, and so on out of modder-supplied python code. I'll have my own default set based on SAIS, but it should be fun.

But for now I'm working on making the simple tactical system work as a hollow demo, with space-object-motion and sweeping camerawork. Once that works in a generalized manner (so that you can raise and lower HUD elements once that's coded) I'll start making a game of it.

Tue, 13 Dec 2005

19:13 [zork(~)] cat sais.txt

Strange Adventures in Infinite Porting

I've got a short list of goofy projects that always seem to come up at times when I'm feeling nostalgic or hoping to tackle a relatively uncomplicated programming feat to keep my skills up. I always consider writing interactive fiction in my new favorite language, or maybe a BBS, or perhaps that TradeWars clone I've been meaning to try.

I mumbled about TradeWars in IRC one day, and someone mentioned Diceland. It's a game where you fold these paper octahedra, and the side that's facing has certain power qualities. You move by pressing down on green corner dots (causing you to roll over one edge, allowing you to "walk" across the field) and damage is represented by a red dot that always takes you to a less powerful face.

On the web site and paper game box, they tout this PC game called Strange Adventures in Infinite Space. Last night as I was leaving the ragout to simmer and waiting for E to come home, I decided to head over to the Web site and drool over screenshots.

So I had a look around and figured it would be another era before Free Software had a good critical mass of indie game developers to make shiny little cult hits like this. But I noticed that they claimed to have a Palm Pilot version or something, so I kept poking around on the site to see just how cross-platform it really was. Then I hit jackpot.

They released the source code to the game engine under the GPL about a month ago, in order to open the doors to the modding community that had sprung up around this game. In addition to this, the authors had ripped out all the DirectX code and replaced it with SDL, making Linux ports super easy.

So I quickly pasted this into IRC and set to downloading. After an hour of ripping out Windowsisms (namely, replacing all the directory-walking code, and then spending an hour in the debugger before realizing that an image wasn't being loaded because the coder expected a case-insensitive filesystem) I had a running demo! It was slow, so this morning I had a look at how the developers had done the main SDL loop, and realized that the double-buffering was miscoded. It's a little faster now, but still not exactly where I'd like it.

You can see my darcs repository at http://zork.net/~nick/sais/ and you can always just darcs get http://zork.net/~nick/sais/ and join in with me. I've put in a proper makefile, and I plan to fix the performance bottlenecks visible in http://zork.net/~nick/sais/gprof.txt . The big problem is that the developers hand-wrote their own sprite libraries and just treated DirectX as a dumb buffer to blit pixel data to. There is a lot of room to replace their code with ordinary SDL functions, and their sprites with SDL_Surfaces.

In addition to this, I'd love to see if I can get the modders to contribute some GPL-friendly artwork, and maybe I'll hit the creative commons sites to find replacement sound samples. I'd love to get Uncle Pedro to do some pencil-squiggle animations so that we can finally do the Bread & Cheese game.

For now, though, you will still need to download the Source Code and Demo zipfile to get the graphics, sound, and game data. Be sure to check out the modders' forum thread on the source code release.


[zork(~)] cal
[zork(~)] tree
[zork(~)] syndicate.py
[zork(~)] cat README