Monday, September 29, 2008

Review: Gravitron 2



Gravitron 2 is a retro-style arcade shooter in the vein of Gravitar and Thrust. You fly a rocket to a series of tiny planet surfaces, where you must destroy one or more reactors and then make your escape before the entire planet blows up. In addition to flying and shooting, the ship is capable of landing on any flat surface, which is useful for rescuing engineers. Each rescued engineer repairs a bit of hull damage as well as adding a bonus to your score for the level.

The ship controls are a slight update to the Lunar Lander family. The mouse's X axis directly orients the ship, and there is a button each for thrusting, firing, and shields. Thrusting and shields expend fuel, which can be replenished by landing or hovering near fuel depots in the levels.

The game has a nice variety of enemies. Levels often contain moving parts. There are occasionally gates with switches, and destructible trees. Each level has a checkpoint; when you first touch the checkpoint, it snapshots the enemies alive at that time. When you die the game restarts you at the checkpoint with the snapshotted enemies. Thus there is an incentive to try and clear as big a swath of the level as possible before touching the checkpoint, which is risky.

I have not finished the game; I think I'm about twenty levels in. I don't think the difficulty curve is as smooth as it ought to be (I'm reviewing version 1.5). Gravitron 2 is brutally hard in places; I've played some levels dozens of times to get through. I have a dormant game project that uses almost this exact interface, so I was already quite good at flying the rocket, and it is still really hard for me. In general the game does a good job of encouraging “Just one more try” gameplay, though. My two-year-old daughter likes watching the game; when I die she tells me “We have to try again!”

I was just over at the Chipmunk physics library page and noticed the game author's handle in the forums, so I wouldn't be surprised if Gravitron 2 makes use of the Chipmunk library for its physics. In general the game's physics is impressive, but there does seem to be some inconsistency in how much damage collisions with the environment do. I also wish the rocket didn't bounce quite so much off of walls.

There's a free demo available with the first five levels. If you like it, the full game only costs $5 (at this writing) so it's not a difficult purchase to justify. In terms of hours of gameplay per dollar this is a great value.

Ron “X-Out” Bunce has since updated his game to version 1.7, fixing several minor interface quirks and an instant-death physics bug. Give it a try!

Monday, September 22, 2008

Villa Creation (first steps)

Andrea Palladio published his Four Books of Architecture in 1570. He designed villas for wealthy people who lived in and around Venice.



Palladio was one of the earliest Neoclassicists. You don't have to read him very far to find out that he was heavily influenced by Roman architecture, in particular by the only surviving book by a Roman architect, Vitruvius' Ten Books on Architecture.

Palladio's villas were an attempt to recreate Roman style in the 16th century. His books were eventually translated to English and because of them Neoclassicism swept 18th-century England. Thomas Jefferson was a fan, and used Palladio's blueprints as a starting point for designing his home Monticello.

I had gotten the impression that Palladio's books might have given some rules for laying out his villas, but that turns out not to be the case. He does give a whole bunch of floor-plans in Book Two, though, which are quite instructive.

In 1978 Stiny and Mitchell developed a shape grammar by looking at Palladio's blueprints (“The Palladian Grammar,” Environment and Planning B 5). I have not been able to get a copy of this paper so I don't know whether it's worth anything.

Vitruvius's books are interesting in their own right. For instance, the section about where to locate the temples for the various deities is interesting. Apparently the worship of Vulcan involves lots of fire, so you want his temple well outside the city. The worship of Venus involves rites that prove distracting to upright young men, so Vitruvius recommends putting Venus's temple outside the city as well. Near the harbor, if you've got one.




I have turned from whole-city layout to the layout of individual buildings. It seems wiser to work bottom-up from a single piece of gameplay (the burgling of a building) rather than top-down.

My initial steps for randomly constructing a building are not very impressive. I am using an adaptation of the algorithm I used for laying out alleys. The rooms of the house are laid out on a grid. The walls of the grid are then given random offsets. Finally, the random offsets are made to match in either the horizontal or vertical direction (randomly chosen) at each junction, to ensure that rooms don't overlap or leave gaps. Additionally I impose a line of symmetry on the house. Here's what I've got so far:



To ensure that all rooms are connected by doors, I use a breadth-first search to flood-fill connections from the front door. Then I go through and randomly add other door connections.



The problem with the grid-based approach is that it is hard to have rooms that vary significantly in size. For instance, a lot of urban Roman houses have a central courtyard (to admit light) surrounded by a whole bunch of little rooms.



Still, having something is better than having nothing. I'm going to throw in some loot and guard patrols and see how it plays, and then try to think about how to give the houses more realism and character.

Tuesday, September 16, 2008

Science!

I'm having trouble getting back up to speed on my programming project, as no doubt is clear. Today I'm going to stop by the library to pick up Andrea Palladio's 16th century book on architecture. I've heard that it lays out a shape grammar for villas which would be useful in my project. That may be a 20th century paper by Mitchell and somebody else, though; I won't know until I can get my hands on some of it.

In the meantime science marches on:

Epazote: My wife tried making identical batches of pinto beans, one with epazote and one without. I could not really tell a difference, so either we had weak epazote or it doesn't add significantly to the flavor of beans. At least not in an unmistakable way like, say, chorizo.

Head On: A product with one of the most memorable no-budget TV advertising campaigns in recent history. We picked up a small tube the other day when we were at the pharmacy. It turns out to be a homeopathic headache remedy! Who knew? Of course it's got menthol in it: that's how you know it's working. I have an idea for a product of my own: a special lamp with a row of switches for enabling various rays which will cure headaches, insomnia, constipation, etc. It would make use of advanced LED technology and the unseen portions of the electromagnetic spectrum.

Cheesy Chipotle Chicken Chorizo Chili: How does this sound for a Taco Bell special?

Avatar, the last Airbender: I stayed away from this Nickelodeon series for a long time because of the cheesy name and four-elements premise (don't get me started on the four elements!) but enough people sang its praises that I finally borrowed the first season from the DVD library at work. It's a great show!

Monday, September 8, 2008

Coming back gradually

I got a new hard drive and have been gradually getting everything reinstalled. I'm taking the opportunity to upgrade in a few places along the way.

The 2008 edition of Visual Studio Express fixes the bugs that annoyed me in the 2005 edition: the inability to double-click on solution files in Vista, the extra security dialog check, and the inability to drag and drop files onto the Visual Studio editor. All of these are the kinds of things you'd think would be impossible to break in a long-running product like this, but they probably re-implement everything periodically just to keep life interesting.

Beyond Compare has a new version 3.0 out; they finally implemented 3-way merge although they charge an extra $20 for it. This diff utility is an integral part of my day job and I can't imagine working without it. There are much more expensive solutions out there (Araxis Merge) but I think Beyond Compare delivers some of the best value.

I'm getting more and more pissed off at Perforce, mostly because I'm the de facto Perforce administrator at work. I am unimpressed (version 2 of my post) with the current programming lineup behind this product. The current GUI client (P4V) is quite noticeably slower than their old Win32 client (P4Win) despite years of development and suffers from incredibly bad user interface design and a never-ending stream of bugs. As an example of the bad user interface, the Sync and Checkout buttons are adjacent on the toolbar. Once or twice every month somebody will select the root of the art tree and accidentally check out everything. This action is very quick and locks everyone else out from checking any of the art files out. Unfortunately reverting the checkout takes hours, unless you use command-line trickery. The old P4Win client, by asking the user “Do you really want to check out 60,000 files?” avoids this sort of problem. I've requested that they put this warning into P4V since it is present in P4Win, and I've reiterated that it's a problem four or five times, and in as many releases of P4V they have not done it. I haven't even mentioned the inexplicable problems with the user interface, like not being able to get the Submit dialog to appear, and I haven't mentioned the Qt debacle, whereby they used a DLL with the same name as a DLL in Maya, and from the same vendor, but with different function sets, thereby rendering either P4V or Maya inoperable depending on which came first in the PATH.

The Perforce server, which was written by the Wise Ones at the Dawn of Time, continues to be a most excellent piece of software. It's a shame that all we can do is gaze back in wonder and mystification at these relics of a bygone era.

I'm considering switching to a different version control for personal use. My criteria are: free, easy to install and administer, fast, and no “turd files” littering my work directories. A good GUI client would be nice too. Wish me luck; I have a feeling such a combination of things does not exist.

I've tried out Google Chrome for a while. It is a decent browser but has a tendency to get very thoughtful (shall we say) when you require it to share those 4GB of RAM with other programs.

Finally, Jungle Disk was the real star of this computer breakdown. I was able to restore my backed-up projects with no trouble. They've continued to improve the interface of the client.




It's past time to return to work on my little game; I've been getting antsy while my computer's been out of commission. Fortunately there have been things like crunch time at work to fill the void. I'm looking forward to getting back to work this week, though.