Archive for the tag 'plugins'

Box of horrors

Today I adapted the nice setuptools-based plugin module from Spineless to more easily support different physics toolkits in my code, and played around a bit trying to write a Box2D plugin. Frankly, I don’t like the Box2D API design at all, and I like the pyBox2D API even less, as it’s a direct port of the C++ API and doesn’t even try to be Pythonic. Eww. Seems I’ll have to try fake sweeping collision detection and other tweaks to pymunk next to fix the collision problems I wrote about.

In other news, starting tomorrow I’ll try to finish two university courses that are really long overdue and that I want out of the way before September. I have one short paper to write and one coding project to do, so game development progress will probably be a bit slower again for a while. But every finished course takes me closer to graduation (which I’m planning to do next year), so yay for that!

Laying eggs

I’ve been lost on another side path for the past few days (and being lazy on purpose as part of my Christmas holiday ;) ), but hopefully this is the last one on my main path of producing something I can actually show you, my valued readers! …and something I can play with myself. Oh, I haven’t told about my main path? My roadmap for the near future is:

  1. Implement resource loaders
  2. Get the renderer plugin working again
  3. Start writing scene management
  4. Start writing Red Nebula

To explain the first step, I probably have to explain plugins in Spineless (as it’s still called, new name is pending; also see end of this post). Plugins are used to implement low-level parts of the engine which depend on an underlying library. At the moment these include the window manager (Pygame plugin implemented) and renderer (OpenGL plugin). Audio mixer, networking and physics are other examples. As such, there can only be one plugin per group loaded at a time.

Resource loading used to be based on similar plugins too. There would be eg. Pygame and PIL plugins for images. The problem was that this was mixing resource representation with loading. As such, you couldn’t for example load models using both the Collada and OBJ plugins. I’m going to add a second type of plugin now, the resource loader. There can be many of these loaded at once, and any loader can be used to load resources. For some resource types, there can also be toolkit plugins, which you can only load one at a time.

And finally, about the side path. Over the course of this new engine revision, I implemented at least three different ways of loading plugins, none of which I was really happy with. This was before I had learned that setuptools can be used to discover and load plugins! After throwing some code away and writing literally a few lines of setuptools-using code, I had far more elegant plugin loading implemented. Welcome, setuptools!

I’ve also been thinking about a new name for the engine. It’s not critical, but it’s something I want changed. Unfortunately, coming up with good names is extremely difficult. I have a couple of options:

  • Some derivative of Sampo, since it’s from Finnish and magical ;)
  • Something related to the (code) name of my game: Red Nebula. Unfortunately the obvious choice Nebula is already taken at least a couple of times.
  • Something else:

Suggestions are welcome. :)