Tuesday, April 18, 2006

Fun and Games in Mérida

It’s been a while since an update, but I’ve been having a great time in Mérida. I came down with a bit of a cold for the first couple of days, but a few extra hours sleep each day got me through it.

Last week was Easter holidays and Mérida is a popular destination for Venezuelans, so the town was packed but, because of Easter, bars and a lot of businesses were closed. Ace and I were unable to find a cheap apartment in a good area, and computer rental is impossible to come by, so I’ve been spending a lot of time in an internet café and we’re still in the posada, which has been cool.

The main thing I’ve been doing in Mérida is working on my game. So far I’ve been spending 8 to 9 hours on it a day and it’s been going really well. I’ve gone with Java, using some SDL bindings for the graphics, input, timer and audio. I’ve got a USB key with Eclipse and all the other tools I need on it, so it’s been really easy to work from the internet café. It would be nice to have Subversion running as well, but I’ve been backing up the code onto my iPod at the end of each day in case I do something stupid.

The graphics have been a bit of a problem, but I had one of Hans’ famous brain farts as I was writing this and it’s ok now. The game is 2D, so the graphics are very simple, but I don’t have Photoshop with me so I’m using GIMP… which I really don’t like but that’s another story, and yes I could use GIMPShop but for some reason every time I try to download it the Win32 binaries are incomplete, so the download fails. Anyway, GIMP has, I think, a defect where when I try to save an image in native GIMP format it looks for a font, which is dumb as I don’t even have any text in the image, can’t find it because the font isn’t installed and then falls back to another font which isn’t installed either. GIMP then aborts the save and exits, so I haven’t been able to save anything from GIMP. Instead I’ve been working in GIMP then taking a screen capture and cropping it in MS Paint, which has to be the clumsiest graphics program ever written. Writing this it occurred to me that I should try and save the image in a different format. Luckily GIMP supports Photoshop format files, so layers are maintained, and saving works perfectly… yah!

The game I’m working on is about as simple an idea as you can get, but will hopefully be fun. The working title is ‘Elevator Game’, though I’m toying with ‘Elevation’ at the name.

I’m far from a nerd but I’ve always been intrigued by elevators and how they could benefit from some learning algorithms to know peak times for different floors in order to provide better service during those times. Writing an elevator simulator would be fun but a little dry, so in this game you control the elevator for a building and have to get people to the floor they want. Waiting for an elevator is always frustrating so the longer it takes you to deliver someone to their floor, the lower their satisfaction with your service and the lower your score. So the idea is basically to get people in the building to the floor they want to go to as quickly as possible in order to get a good score and go on to the next level. I think of it like a real time version of The Traveling Salesman Problem where the cost of each arc in the graph changes with time.

I’ve taken the Module architecture that I’ve used in previous games and expanded it to use this Game State model that Kenny used in a prototype for a game we started working on before things got insane with work. There’s a UI system in sdlJava that I was hoping to use, but for some reason it’s bound to the OpenGL bindings in sdlJava, basically you need to pass a GL context into widget creation, which I don’t have… and seems kinda dumb to me, so I wrote a simple UI framework to drive the menus and game states. This type of dynamic, event driven system is so much easier to write in Java than C++. After only a few hours everything was up and running perfectly.

After 3 days of work, the basic mechanics of the game are in place. Navigating through menus you get to the main game module, where you can move the elevator up and down in the building and if there is room in the elevator people get in. When the elevator stops at a floor that someone wants to go to, the people get out. Next up is to add the satisfaction mechanics, new graphics, music (elevator muzak of course), lots of polish and, depending on time, incorporate the combo system from v2 of the game – even I know moving a box up and down is a bit boring.

Of course, there’s some RealLife to get in as well, I’ve been neglecting my Spanish study, spent a couple of days camping, and tomorrow we’re planning to go canyoning.

1 Comments:

At 2:38 am, Blogger Phil Chan said...

Wonderout magic... check
Goblins... double check

Yep, all seems to be in place.

 

Post a Comment

<< Home