Possibility and Probability

Python, AI, and other fun stuff

11/15/2004

Don't start from scratch if you don't have to

There's a lot of people out there wanting to make a lot of games. As a result there's a lot of programs that never get finished. Sometimes this is ok, people start a project to learn some new technology or to get more experience with some thing.

Other times someone starts a project because they really believe in what they are doing. Look at all of the fan versions of various classic video games out there. People are doing these because they genuinely feel something about that original game and they want to emulate it (or honor it) through their own work.

And that is so cool. But more often than not, once the project gets rolling it stops. And once it stops, it rots. And to me this is sad. Most of the time it seems like the people involved decided from the get-go to try and do everything (code, sound, art, writing, etc.) themselves. One part of the project got to be overwhelming (usually the artwork, most programmers can't draw to save their own lives), and the house of cards comes tumbling down.

But it doesn't have to be like this. Your house of cards can use a little bit of glue in the form of recycling an existing project. I'm not saying you should steal, but I"m saying that if you seem some project out there that is similar to what you are aiming to do, try to use it as a spring board.

Get the code (again, only do this if it is licensed to allow you to do this), play with it. You'll probably find that most of the "grunt work" has been done for you. This will allow you to get your project up and running a little bit faster.

Of course it won't look exactly like what you had in mind, but a running program is worth its weight in gold. It helps capture and build momentum. It frees you up to work on more interesting problems. It lets you see the big picture.

Plus it buys you some time. You don't like the way the fonts are displayed? Well all you have to do is tweak the rendering code. Tweaking is much easier than WRITING FROM SCRATCH. Remember that, it will make your life easier.

Comment on this post [ so far] ... more like this: [games]

A year (almost) of Python

Well, it was almost a year ago (mid December I think) when I got my first Python book and started to really seriously work with it. In the time since I think I've come a long way in my understanding of the language/platform. I still think Python is the greatest thing since sliced bread.

The readability factor alone is worth the price of admission to me. Due to other commitments (i.e. real life) I'm some times forced to put down my python projects for a few weeks at a time. But once I get back to them, I'm usually able to pretty much pick up where I left off. I've never been able to do this in C/C++, and its only been in the last year or two that I've been able to do this with Java. Obviously, part of this is due to my programming habits (good naming conventions, comments, etc.) but I think a lot of it is due to how python makes you think, and how it allows one to write object-oriented code, but still break free from OO idoms when necessary.

For example, I've spent a lot of time reading up on and subsequently implementing a state machine in python. With python it was a snap to do (a benefit of dynamic languages), and more importantly, it was easy to change things around to experiment and tinker. Trying to do this in other languages would have been much more challenging. In fact looking over some old code it looks like I've tried to do state machines in C and Java, and neither one of them turned out like I wanted it too.

I think part of that was the implementation curve that was necessary for those languages. Python on the other hand, was more inviting, more open. It allowed me to get in there and quickly try things out. To me, that's really important. I'm really into the little RPG game I'm building, but sometimes I only have 10 to 20 minutes of free time to work on it. (I know, poor pitiful me) The ability to get in there and over the course of 3 or 4 of these little sessions and make *huge* architectural changes is big. Especially when everything works like you want it to when you are done. ;)

But this little blurb is not to say that python is perfect, there's a lot of areas where I think it could stand to be improved (tools, packaging of executables, etc.). But if python is the future of programming (platforms and languages) then I think we have a very sunny future ahead of us.

Comment on this post [ so far] ... more like this: [python]