Physics Engine and Object Selection

This is the second part of my post about what I've been working on lately. In the first part, I talked about data structures and serialization. In this post, I talk about the physics engine and object selection via mouse picking.

For Ambienome's physics engine, I'm using SquirL, a Common Lisp port of the popular Chipmunk 2D game physics engine. I'm not far enough along yet to know how well it performs in my own game, but from running the demos, it certainly seems performant enough for my purposes. If it turns out to be somewhat sluggish, many Common Lisp implementations can perform some pretty aggressive optimization, given the right type declarations. As a last resort, I could create an FFI binding to the actual Chipmunk library, although that might not be any faster than a well-optimized Common Lisp port. One benefit of a binding to Chipmunk would be using its new features that have not been ported to SquirL (which hasn't been updated in 2 years).

Continue reading “Physics Engine and Object Selection”

Data Structures and Serialization

Lately, I've been tackling several separate, but interconnected, systems in Ambienome: data structures, serialization, object selection, and the physics engine. These are complex topics, so I've written this in two parts. In this first part, I talk about data structures and serialization, and in the second part I talk about the physics engine and object selection.

Continue reading “Data Structures and Serialization”

Complicated Code and Creative Blocks

The past several weeks have been a struggle, productivity-wise.

First, I spent quite a lot of time working on proto-slots. That may seem productive, but the amount of effort I put into polishing and documenting it was way out of proportion to the benefit I would get from it. I think I did a pretty good job on that project, but I also recognize now that I was using it as a way to avoid actually working on Ambienome.

Continue reading “Complicated Code and Creative Blocks”

Mini-project: proto-slots

I've just released proto-slots, a mini-project I created as part of Ambienome. From the README:

proto-slots provides a macro for defining prototypal accessor methods so that CLOS instances will support protoypal inheritance. Prototypal inheritance means that an instance's slots can inherit values from another instance, known in these docs as the "base object" (but more commonly known elsewhere as the "prototype").
Continue reading “Mini-project: proto-slots”

Colored Shapes

I got a bit sidetracked while working on creature components, but still ended up making important progress for the overall system.

First, I created a new transform class by abstracting and cleaning up the shape class's position, angle, and size attributes and methods. I also created a transformable "mixin" class, which can be used by any class that has a transform. (Lisp doesn't have mixins in the same sense that Ruby does, but since Lisp supports multiple inheritance, you can get more or less the same effect by designing a class in a mixin-ish style.) The transformable class provides accessors for the transform's position, angle, and size, so that you can treat them as if they were direct slots of the object holding the transform.

Next, I decided to enhance the shape class so that shapes can have a color. This turned out to be somewhat challenging, because of how I had designed the OpenGL wrapper classes.

Continue reading “Colored Shapes”

Shape Mesh Progress

Yesterday, I completed the code to generate triangle and circle meshes:

Screenshot of a rectangle mesh, a triangle mesh, and a circle mesh.

The triangle looks like it's too small, but it fits perfectly in the circle, and the circle fits perfectly in the square. Yay, geometry! Of course, when building a creature, they can be scaled to whatever size you like, and the algorithms can produce meshes at any level of detail. Eventually, I'll make it so the game automatically adjusts the level of detail based on the shape's size on the screen.

As I mentioned in the previous post, these aren't the only shapes that will be available, but they are enough to let me move on to other things. One of the core concepts of Ambienome is that I can program new shapes later, even after the game has been released. If I'm feeling really clever, I could probably leverage Lisp's power to allow users to program new kinds of shapes, too. That's not a high priority, though.

Today I'll start code-sketching the concept of components and creatures. A creature is built from one or more components, which are basically shapes with some associated behavior. Components can be grouped to move together, and groups can contain other groups, so it's essentially a "tree" (hierarchy) of transformation nodes, with each "leaf" being a shape. This is the same concept as grouping in SVG or Flash, or parenting in 3D software like Blender or Maya.

After weeks of just studying and debugging OpenGL, it sure is nice to be making visible progress again!

Adventures with the OpenGL shader pipeline

For the past several weeks, I've been learning "modern" OpenGL programming practices, by which I mean using a GLSL shader pipeline with vertex and fragment shaders.

Even before starting Ambienome, I was already somewhat familiar with the old OpenGL "fixed function pipeline", using glBegin/glEnd, glColor, glVertex, etc. Ambienome is going to be visually simple enough that I probably could have used the fixed function pipeline, but I decided to learn the shader pipeline to improve my knowledge and skills, to allow nicer visual effects, and to leverage the GPU's number-crunching power as much as I can.

Continue reading “Adventures with the OpenGL shader pipeline”

Ambienome - Technology

In my previous post, I described the concept and roadmap for my new project, Ambienome. In this post, I'll be describing the technology (programming language and libraries) I'm using, and why I chose them.

Even though I have seven years of experience with Ruby, and my own game library, Rubygame, already available and ready to use, I've decided not to write Ambienome in Ruby. Instead, I'm writing it in Common Lisp, using OpenGL and OpenAL for graphics and audio.

Continue reading “Ambienome - Technology”

New Project: Ambienome

I've started a new project: Ambienome. This is a game (or, rather, a toy) I've wanted to create for years — I blogged about it in May 2007 and November 2009 — and now I'm finally making a serious attempt.

I'll be blogging about my development progress, both to solidify my ideas by putting them into words, and to keep myself "accountable" for maintaining progress. I'm starting off with a two-part announcement and introduction to the project. In this part, I'll describe Ambienome's concept and a tentative list of progress milestones. In the second part, I'll write about the tools (programming language and library) I'm using, and why I chose them.

Continue reading “New Project: Ambienome”

Sup email client keybindings and filters

Lately I've been playing with Sup, a geeky console-based email client written in Ruby. I've used it enough to understand it and settle in a bit, but unfortunately also enough to realize that it's probably not right for me. Along the way, though, I've done some work with keybindings and message filters that I'd like to share with you.

Continue reading “Sup email client keybindings and filters”