Programming in Python is fun!

October 10, 2008 at 5:04 pm | Posted in Game development, Programming | 4 Comments
Tags: , ,

The last few months I’ve been doing more and more with Python. While the games I work on are mostly written in C++, there’s still a lot of room for me to use Python. For example, when dealing with file conversions, data checking, automating processes, and so on.

Two weeks ago, I wrote a tool that packs smaller images into larger ones. I first prototyped the packing algorithm in Python and then translated it to C#, which I used for the tool itself.

Last week, within a few days, I was able to process, verify and preview almost 2000 files for one of our games, converting them from XML into a tight binary format, all packed into custom archive files to keep things easy for the file-system. I spent most of my time thinking about the file formats and the required checks. Writing the tools took little time.

Just today I set up a few automation scripts for one of our artists. I introduced him to SVN, but, considering he’s an artist, I decided to make things as easy as possible. I wrote a few batch files that took care of updating and committing the files he needs to work with, and another batch file for converting the art. That batch file calls a Python script that generates some information based on the new art, and another script that checks for new files, which are automatically added to SVN. All he has to do now is make art, click a few batch files and press a few Ok buttons.

I’ve also been using Python to prototype a collision system for a spare-time project and to solve some logic problems, as I recently discovered a site called Project Euler.net. Quite fun! Someone also pointed me at the Google Code Jam, that also contains some interesting problems. How about path-finding with portals?

In other words, I’ve come to like Python more and more. It’s still just one of several languages that I use and it’s not the best for every situation, but I do notice how much more productive I’ve become by embracing it.

About these ads

4 Comments »

RSS feed for comments on this post. TrackBack URI

  1. like yout post, very much. Looking at the publishing date makes me sad. I hoped for a recently updated programming blog. Too bad.

  2. Heh, same here. I’ve got a few half-finished posts, but haven’t really made time to finish up something recently.

    Thanks for the nudge. ;)

  3. Dude. I totally hear you on artists and SVN, and how they don’t mix.

    They sure make pretty pictures, though.

  4. I read this paragraph completely about the comparison of most up-to-date and earlier technologies, it’s remarkable article.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com. | The Pool Theme.
Entries and comments feeds.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: