Of maps and ships and sealing wax
I’ve been working on my idea for a program to generate a static set of google map tiles from a KML input, but it’s been slow going. Of course there’s the usual obstacles to any software project I’ve taken on recently—I have a job that involves sitting at a computer all day, and riding a bicycle all day is probably making me dumber—but this idea presents some new challenges. The problem I’ve been stuck on, perhaps out of a subconscious avoidance of the geometry problems ahead, is converting latitude and longitude into pixels on a map projection. In short, floating point arithmetic sucks. I’ve generally viewed floating point calculations as a dark abyss of rounding and inaccuracy, and I’m to some extent running into that wall. I’m not sure if I can accurately reproduce the calculations done by the google map engine. Maybe I’m getting close enough, but the perfectionist in me wants more, and floating point math just isn’t designed for that. Maybe I should just decide on an acceptable number of significant figures (I’ve been using 7 for all the marta map points) and do everything with integers.
Way back in ancient times, I played a game called Descent. I mostly played adventure games back then, since I enjoyed the stories and puzzles of games like Monkey Island or Quest for Glory, and Descent was on the surface uninteresting as a pretty basic first-person shooter with regards to storyline. However, there were a couple things that made it totally rad. As far as gameplay, it was the first (as far as I know, and at least the most dramatically so) truly 3-D game. We had games back then like Wolfenstein and Doom, but those games were actually played in two-dimensional worlds. Doom was the better of the two in that it had some fancy tricks to create illusions of altitude, but true up and down movement was impossible, and if there happened to be a staircase that appeared to be going up, the game was limited in that there couldn’t be anything under that staircase; that particular part of the two-dimensional landscape was given a particular altitude, and you couldn’t project more than one thing onto it. Descent broke through a lot of barriers by putting the player in a spaceship with a full range of motion. The environment had no gravity and no restrictions on movement, so part of the difficulty of the game was breaking out of a flat mindset and learning to navigate the twisting spiderwebs of tunnels going any direction the designer could imagine. In this respect it was kind of like Ender’s Game played in a maze.
Another interesting feature, though one not visible to the casual player, was that Descent did not use floating point math. In projecting a three dimensional environment on a two dimensional screen it’s handy to have tools like cosines and radians and all that other crap you slept through in high school available, but math coprocessors weren’t widely available back then, so the programmers didn’t use any of that fancy stuff. The result looked incredible for the time, and you could play it on a 386. I wonder if I’m going to be stuck trying the same tricks if I can’t get google’s javascript engine and my C program to agree.
I’ve noticed that google recently added the ability to create custom maps, which seems pretty cool. It provides the same kind of interface I imagined in my point and line making maps, but it brings everything together nicely and lets you share maps or save as KML. I don’t think something like this will scale to ideas like the MARTA map, but it would have been nice to use for something like that bike ride I describe a while back. Maybe this is what Web 2.0 is supposed to be?
In other news, I think that Carlos, the singer for the Breeze Kings, is stalking me. He talked to me once at one of their shows since he wasn’t sure where he recognized me from, and since then he’s appeared the last couple of times I’ve gone to eat at Al Capri. Al Capri is an Italian place near my office that set up shop where Port City Java used to be, next to the army recruiting center and the halal butcher. They seem to be doing pretty well now, despite the crappy location; when I visited today, the owner, a half-Italian Moroccan dude, was still working in the kitchen, but he now has two waiters, and there was a pretty big lunch crowd. Carlos came in today about ten minutes after I sat down. I guess he must like those meatballs, too.