Flamingo Dev Log

Archive for November 2009

Flamingo – What’s the Deal?

with one comment

(This post is rather old, and some of the information is wrong due to changes in the application. The general idea is still the same. For specific details, refer to the documentation (after it is written, of course).)

The reasoning behind the switch from Opossum to Flamingo is pretty simple. Think about Opossums. They’re hairy, smelly, disgusting, and unwanted. That’s how I felt about my engine. The more I added the more ┬álocked in it became, the opposite of how I envisioned it at the start. I needed a clean slate. I needed something elegant, something unconfined, something faster, something pink.

At it’s heart Opossum was a sketchpad. It was a test. And now that I’ve learned what does and doesn’t work, I’m ready to build the real thing. Extensive planning has gone into the project already. Here’s a summary of how things are going to work for the most part in the final product:

Coordinates

There are two coordinate systems in Flamingo: the rendering coordinate system and the physics coordinate system used by box2d. The first step to understanding how everything fits together is figuring out how the two coordinate systems work together.

Opossum used native SDL rendering which made mapping coordinates a mess. (0,0) was in the top-left corner of the screen, so all of the physics had to be done in the IV quadrant and then the y-value had to be flipped for each entity before rendering. This caused a lot of headaches.

Flamingo will be migrating to OpenGL rendering. Luckily (0,0) is on the bottom-left of the screen in OpenGL, so most of the physics and all of the rendering coordinates will be positive.

In addition there are World coordinates and Local coordinates. World coordinates are relative to the origin and local coordinates are relative to an entity’s central point.

These coordinate systems are combined to form RW, RL, PW, and PL.

Sprites

Next is the concept of a Sprite, which I’m sure you’re all familiar with. A Sprite is simply an image that is blitted (drawn) to the screen. Sprites are grouped together in SpriteGroups and are all blitted together. Every Sprite instance is in at least one Master SpriteGroup. Sprites are positioned with RW coordinates.

Objects (subclass of Sprites)

An Object is a sprite that updates it’s position and rotation based on a box2d body (If you are unfamiliar with Box2d, I suggest reading the wiki). These can be either rectangular or circular and use PW coordinates.

Compound Objects

A Compound Object is essentially a collection of Objects that act together as a unit. They can be attached with joints or not.

Viewport

A viewport is a rectangular or circular area in RW coordinates. These are the “cameras” that let you see the world. Whatever is inside of these areas is blitted to the screen. These can include custom drawing functions to make things like Radars.

Map

A map is a collection of images, sounds, and scripts all bundled together with the MapEditor. These are saved as .fmap files and loaded directly into the Game. All of the resources are tied up in the map file, so distribution is extremely easy.

This is one of the core aspects of Flamingo. All of the scripts are offloaded into the map files themselves. All you have to do is load map and the scripts are loaded with it. Doing the scripts in this way makes development much easier; you no longer need to add a bunch of specific map code to the core source files themselves, eliminating all the headache associated with it. In addition it makes it very easy for the players to create and distribute their own maps.

Character

A character is a specialized Compound Object with sounds, scripts, and animations. They are created with the CharacterBuilder, saved as .fchar files, and loaded into the Game. Characters follow the same script philosophy as Maps.

Written by bradzeis

November 26, 2009 at 10:06 pm

Posted in Flamingo

Opossum v0.1 Released

leave a comment »

The first and only release of Opossum has been released here. Most of what I wanted was not completed, but it’ll be much easier to implement with Flamingo.

The Flamingo Project page has been created and the repository has been set up. Some first draft logos are in the works. Expect some real updates soon.

Written by bradzeis

November 25, 2009 at 7:12 pm

Posted in Announcements

Opossum Gets a Makeover

leave a comment »

Nearly 6 months ago I started working on an open-source, 2d game engine with 3 things in mind:

  1. Written in Python
  2. Easy to Understand
  3. Versatile

What I came up with I called the Opossum Engine. Though far from being done, it satisfied all of the requirements above. The problem was it was a bit bulky and some things clearly needed an overhaul. Much of the engine was (thoughtfully) hacked together, and it accumulated quite a bit of cruft. In addition, I was stuck with design choices made in the beginning of the project (like native SDL rendering instead of the faster OpenGL), which I regretted later. I decided it was time to scratch the idea and start over completely, using what I’ve learned so far in the making of Opossum.

And thus Flamingo was born. It’s being built from scratch, based on the original work from Opossum. It will be designed with speed and simplicity in mind, while remaining as versatile as possible. Many features and concepts will remain the same in this change. A more substantial overview will be posted in the future, but for a quick overview:

  • Python (based on pygame)
  • OpenGL rendering
  • Extensive sprite system
  • 2d Physics based on Box2d
  • Versatile Audio Mixer with unlimited number of simultaneous sounds
  • Advanced Maps (levels) and Characters (with physics-based animation) built in specialized editors
  • Scripts in Python, which are mostly bundled with the Maps and Characters

Flamingo obviously has quite awhile to go before being released, but initial development should be rapid.

The original Opossum Engine will be released soon, though it is extremely far from being production ready. Check here or the Pygame website for the release details.

Written by bradzeis

November 23, 2009 at 10:56 pm

Posted in Announcements, Flamingo