Flamingo Dev Log

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.

Advertisements

Written by bradzeis

November 26, 2009 at 10:06 pm

Posted in Flamingo

One Response

Subscribe to comments with RSS.

  1. Looks very promising, keep it up!

    Przemysław Müller

    December 9, 2009 at 1:48 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: