Monday, October 22, 2007

Building Games in Small Pieces

A few people have been asking for ICCARUS source code.

In it's current state, it is a big ball of mud, and probably useless to most people. So, I'm attempting to refactor parts of the code and release them as re-usable units of functionality, which can be easily tested, documented and even used! :-) I'll think about a complete ICCARUS release later.

The first useful chunk is my mainloop module. This module supplies a generic Loop construct (which implements frame skipping and a fixed simulation supdate), for your pyglet/pygame/opengl application.

It's rather simple. To use it, you create 3 callback functions to handle tick, render and gui events.
>>> import time
>>> from mainloop import Loop
>>> loop = Loop(time.time, time.sleep, tick_func, render_func, gui_func)
>>> loop.start()
It's quite a tight loop, and IMO is probably about the most code you should have as your inner game loop.

Mechanics and Coders

Took my MX5 in for a major service today. Walked back into the shop at closing time to pick up the keys and take it home. 3 hours later I drive away in a car with non-working handbrake. Which is not a good thing, especially considering I almost live on the side of a mountain.

Finding a good car mechanic is like finding a good coder. Next to impossible. From my personal experience, I believe most programmers don't really care about their work, and are satisfied with mediocrity. Perhaps the same can be said of auto mechanics.

Unicode Madness

I don't think I completely understand unicode.

>>> x = u'\xbb'
>>> x.encode('ascii', 'ignore')
>>> x.decode('ascii', 'ignore')
Traceback (most recent call last):
File "", line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode character u'\xbb' in position 0: ordinal not in range(128)

Why does the decode call raise an exception even though I've asked it to 'ignore' Unicode problems?

Friday, October 19, 2007

Do you work from home?

For that last 12 months, I've been working for myself, from my home office.

The single best thing I can recommend to anyone doing the same... is get a decent high backed office chair. I received one as a gift last night, and sitting here right now... ahh its magic!

I'm sure it helps me write better code! :-)

Update: Chair is pictured, and can be bought from ikea.

Wednesday, October 17, 2007

Meeting fellow enthusiasts...

I went to a DCiRG (Digital Content Industry Reference Group) meeting this evening, and met a few fellow enthusiasts. If you cannot work out what might happen at a DCiRG meeting... it was mostly about computer games and multimedia technologies. :-)

We talked about Python, Pygame, Pyglet and OpenGL. There was also talk about XNA + IronPython... It's great to talk to other people about all this stuff... It's rare that I get to meet Python people who like to build games too! Our technical colleges and Universities are offering (or will be offering) Python courses, centered around game development. Woohoo!

Popular Posts