Flamingo Dev Log

Archive for December 2009

Never Trust A Software Developer

leave a comment »

I’ve learned quite a lot developing Flamingo so far, though there isn’t a lot to show for it yet. Near the top of that list is that Software Developers lie (just take a look at 3dRealms’ track record). “Mostly Done” really means it’s about time for a rewrite in the software world, which is the case for the Flamingo math module (it’s named fmath so as not to override the built-in math module in Python).

The reason for the massive fmath refactoring is mostly lack of foresight on my part. The old version was very rigid and concrete, it was hard to get much done, and it was slow. The new version supports the abstract notion of Coordinates, Polygons, and Matrices, making it much more flexible and extensible. As a result you can now use tuples, lists, the concrete Vector class, or your own Coordinate class to show coordinate points. The same is true for Polygons (and, by extension, the Rect class which will be the basis of much of the rest of the engine). Matrices, however, are best handled by numpy. The wonders of Cython will also be taken advantage of in fmath and all of Flamingo.

This refactoring has gotten me thinking a lot about the rest of Flamingo and how it’ll be pieced together. I now know that I want it to be as easy to extend as possible, making it useful for people other than myself. For example, I need a way to make it easy to roll in a new audio engine or sprite system, which I suspect developers would like to extend. I’ll have to draw a line somewhere, though. What sections do I make concrete? What parts don’t need custom functionality by someone? Striking a balance poses an interesting problem.

Next up after the final touch-ups on fmath is the general rendering system, which will take advantage of OpenGL. I’m not going to go too far into this because I want to get started on the audio component soon (experience with Opossum tells me that it’ll get pushed to the end, at which point it’ll be too hard to integrate into the rest of Flamingo).

Source Updates
The repository has been updated so you can download the trunk without adding the installation path to PYTHONPATH (which is much more convenient ). The source is located here. The new fmath is not there yet, but it will be shortly.


Written by bradzeis

December 28, 2009 at 9:48 pm

Posted in Flamingo

Flamingo Update: fmath (mostly) done

with one comment

Sorry about the lack of updates, I’ve been swamped with school. Don’t expect anymore soon, I’ve got finals next week. But after that I’ll be an evil little code monkey for two weeks (what else would I do with that Christmas break?).

In the spare moments I have had, I’ve churned out some very useful stuff: the fmath module. It has all the usual math functions a 2d game could ever need (distance, distance squared, polyline simplification, etc) and a 2d Vector class, which is invaluable for the engine.

Head on over to the repository to check out the latest version. The library won’t work correctly if you just download everything to the installation directory. You need to add the installation directory to PYTHONPATH or navigate to the directory (usually Python26\Lib\site-packages\flamingo) and type:

svn checkout http://flamingoengine.googlecode.com/svn/trunk/flamingo "" flamingoengine-read-only

I should probably setup the repository more conveniently in the future, but that’s for another time.

Written by bradzeis

December 6, 2009 at 4:19 pm

Posted in Flamingo, Updates