Monthly Archives: September 2011

Martian Neo-Roman Architecture

As I mentioned in my previous Mars related blog post, it’s likely that the first settlement on the Red Planet will be made of bricks.  So what will these early structures look like?  Zubrin‘s suggestion that early brick martian buildings inherit flavors of old Roman Architecture really resonated with me… so I thought I’d use that as a basis for building design.  It’ll be a while before I come up with the right mix of modernity with the old school ancient imperial arched/pillared look.

I think that a major contrast between actual Roman design and what will be Martian neo-roman architecture is… Romans liked their plans open air.  This was a necessity back in the day because there was no air conditioning.  On Mars, however, everything, at least at first, needs to be walled off and pressurized.

To the left you see a quick drawing of what might be one of the administrative structures in my city plan.  The archways are just really just decorative.  If they went all the way into the building, they’d end up having two layers of thick glass, as each of the buildings themselves would be double-walled to help deal with the pressure difference between inside and the outside atmosphere.

As the first permanent structures built on Mars for habitation, these buildings will no doubt be considered hallowed historical monuments in the time the podcast takes place.  To that end, I don’t mind the buildings themselves taking on more of an over-the-top feel to them rather than simply the bare essentials that a for real initial settlement on mars might put up.

Most travel between buildings will occur through pressurized tunnels, not through doors in the buildings themselves.  Elaborate airlocks would need to be built which safeguards the inside air.

Another important structure, pictured to the right will be the green house.  Here we have a very primitive rendering of the inside of a martian vineyard.

Massive tracts of greenhouses will have to be dedicated to simply producing enough food for the population, however certain goods like wine can be produced for trade back to Earth.   These novel, fairly high margin items are necessary because, at least for the first couple of generations, any colony on mars will be very dependent on the mother planet, both practically and culturally.

From this initial colony plan, I think that the building designs will necessarily deviate from the original roman influence into something unique.

Submediant: Imagine – A work in progress

This past weekend, I worked more on Submediant.  This time through included both an internal refactor as well as a few new features:

  • Instruments have a chord notation
  • Instruments can have individually adjusted volume
  • Notes can now be tied together

To help demonstrate the new features, I’ve called upon one of my inspirations, John Lennon.  This is about a quarter of the song, Imagine rendered with Submediant…

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Here is source code for the song…

@SONGTITLE:Imagine
@ALBUMNAME:Let Them Eat Test
@ARTIST:Little Robots
@YEAR:2011
@GENRE:other

@bpm:80
@volume:1000

&righthand volume:1000
D4,E4,G4:1/8:tie C4:1/8 D4,E4,G4:1/8 C4:1/8:untie D4,E4,G4:1/8:tie C4:1/8:untie D4,E4,G4:1/4
D4,F4,A4:1/8:tie C4:1/8 D4,F4,A4:1/8 C4:1/8:untie D4,F4,A4:1/8:tie C4:1/8:untie D4,F4,A4:1/4

&lefthand volume:1000
C2,G3:1/2. C2,B3:1/8:tie C2,C4:1/8:untie
F2,A3:1/2. F2,A3:1/16:tie A#3:1/16 B3:1/16 C4:1/16:untie

&vocals volume:4000
_:whole
_:whole

&righthand
D4,E4,G4:1/8:tie C4:1/8 D4,E4,G4:1/8 C4:1/8:untie D4,E4,G4:1/8:tie C4:1/8:untie D4,E4,G4:1/4
D4,F4,A4:1/8:tie C4:1/8 D4,F4,A4:1/8 C4:1/8:untie D4,F4,A4:1/8:tie C4:1/8:untie D4,F4,A4:1/4
D4,E4,G4:1/8:tie C4:1/8 D4,E4,G4:1/8 C4:1/8:untie D4,E4,G4:1/8:tie C4:1/8:untie D4,E4,G4:1/4

&lefthand
C2,G3:1/2. C2,B3:1/8:tie C2,C4:1/8:untie
F2,A3:1/2. F2,A3:1/16:tie A#3:1/16 B3:1/16 C4:1/16:untie
C2,G3:1/2. C2,B3:1/8:tie C2,C4:1/8:untie

&vocals
# Imagine there's no hea-
G4:1/8 G4:1/8 G4:1/8 G4:1/4 B4:1/8 B4:1/8:tie
# ven--
B4:1/8 A4:1/8 A4:1/4:untie _:half
#     It's easy if you
_:1/8 G4:1/8 G4:1/8 G4:1/8 G4:1/4 B4:1/4

&righthand
D4,F4,A4:1/8:tie C4:1/8 D4,F4,A4:1/8 C4:1/8:untie D4,F4,A4:1/8:tie C4:1/8:untie D4,F4,A4:1/4
D4,E4,G4:1/8:tie C4:1/8 D4,E4,G4:1/8 C4:1/8:untie D4,E4,G4:1/8:tie C4:1/8:untie D4,E4,G4:1/4
D4,F4,A4:1/8:tie C4:1/8 D4,F4,A4:1/8 C4:1/8:untie D4,F4,A4:1/8:tie C4:1/8:untie D4,F4,A4:1/4

&lefthand
F2,A3:1/2. F2,A3:1/16:tie A#3:1/16 B3:1/16 C4:1/16:untie
C2,G3:1/2. C2,B3:1/8:tie C2,C4:1/8:untie
F2,A3:1/2. F2,A3:1/16:tie A#3:1/16 B3:1/16 C4:1/16:untie

&vocals
# try...
B4:1/8:tie A4:1/8 A4:1/2:untie _:1/4
#     No hell below-
_:1/4 G4:1/8 G4:1/8:tie G4:1/4:untie B4:1/8 B4:1/8:tie
# us--
B4:1/8:untie A4:1/8 A4:1/4 _:half

You can see that chords are simply notes that specify multiple frequencies… for example, C4,E4:1/4 is a quarter note that rings as both middle C and the E a step above it. You can also see the notation for tied notes:  C4:1/8:tie C4:1/8 C4:1/8:untie are three 8th notes tied together. Whether a note is tied or not tells the instrument rendering the sound how to handle the attack/decay aspects of the sound generated…

You can see that each of the instruments in the source sets a custom volume.  One thing that I want to work on in the future is allowing the volume of an instrument to change.  Even though you can set the volume on any of the lefthand designators, only the last one is applied to the whole song.

There are a few aspects of the code that bother me… it needs more refactoring… but I’ve gotten it to the point where I need it.  I can now use Submediant as a framework to give Little Robots the ability to speak.

Naive City Planning

In order to make a realistic city of 240,000 people, I wanted to go back to the very beginnings of the city, all the way back to its first founding.  In my mythology, 250 years before the podcast takes place, we find an ambitious but somewhat artificial plan to start the first for real human city on Mars.  It can comfortably house about 10,000 people and will represent the pinnacle of human achievement.  As for the year this happens relative to today? I’m not really sure… maybe 2060? 2070?

I’m not going to pretend that I know anything about actual Civil Engineering, but here’s my first stab at an initial city layout.  The areas scribbled off are further away from the settlement than would fit on the image.  One thing that I wanted to capture here was relative scale as far as quantity of a particular type of construction.  One thing to note, though, even though Agriculture is, by far the largest area… I’m pretty sure that this colony will still have to import food from Earth.  I’ll do a bit more research and figure out just what the square footage of farmland is required per person.  Also, In case you’re wondering, Education is lumped into “Administrative” in this diagram.  I should call that out as a separate thing later…  There’s little doubt in my mind that I’ll end up changing how this looks as I do more research… still, it’s a lot of fun to kind of play SimCity on Mars.

The construction of the buildings in question will all be primarily brick, as Robert Zubrin suggests in A Case for Mars.  A big thing to consider though is air pressure… The atmospheric pressure on mars is about 0.087 psi… here on earth, we’re used to having 14.69 psi.  That’s a pretty serious amount of force due to pressure being applied on the walls from the inside…The buildings here will have two layers to help reduce the strain on the walls due to the pressure difference between inside and outside.

You can see in this diagram, there will be a thicker outer wall which will be the primary barrier to the outside… a gap (enough for someone to comfortably walk) and then a thinner inner wall.  Inside will be completely pressurized and heated.  The intermediate gap won’t be heated and will be only partially pressurized.

The reason why I’m bringing up this point… is well, It affects the architecture… and architecture affects culture… and culture is exactly what I’m trying to capture here.

Martian Census Data

It’s been a while since I posted anything about Project: Mars, so here we go…

A subtle but very important aspect of any fictional culture is its population.  Specifically the census of age, gender and point of origin.  I see Martian culture to be an interesting conflict of old world (from Earth) ways of life with new world (born on Mars) burgeoning tradition.  To see just how much this affects the story, I needed some data… so it was off to the drawing board to model some population growth.

To the right, you can see a graph of population growth over time.  The population represented here has two components (which I should have broken out, but didn’t), an immigrant part and a birthrate part.  The immigrant portion of the population growth starts out modest and grows slowly over time.  I simulated this with a logarithmic increase.  The birthrate portion of the population represents actual births on Mars.  This population is of particular interest to me because they represent the specific culture that I want to study.  The population of Mars-born Martians grows exponentially; a lot like a compounded interest problem.  You can see from the graph, we have a healthy concave up growth curve.

I had put the setting of this fiction about 250 years after the founding of the principal city (yet unnamed).  After simulating 250 years, I ended with some interesting numbers… almost exactly 50% of the population at this point in time was born on Mars and the other 50 percent originated from Earth.   I need to play with the simulation to have a more realistic age distribution… at the moment, I assume that medicine has advanced to the point where old age is no longer a fatal condition, so a histogram of counts by age will look unrealistically flat.

Another liberty that I took with the simulation was with gender.  I assumed that the initial population would be male-heavy… which I set at 70% male.  Subsequent immigration, I slanted a little bit less male (65%).  To make things a bit more interesting, I assumed that natural birthrate on Mars would skew female, so 55% of children born on mars would be girls.  Let’s take a look at how this pans out…

At year 250, we can see that all surviving people from Earth are totally skewed male.  There are basically 2 men for every 1 woman.  I could see how this would amount to some extreme competition and drama as men vie over the extreme scarcity of a mate.  It could very well be that we see huge campaigns encouraging more women to head off to Mars… cuz, Mars Needs Women!

On the flip side of the coin, when we look at native born Martians, we see that women outnumber men.  Of course, the gender difference won’t equal out to near 50/50 for probably another 50 years based on the simulation… but it’s clear to me that earth men will end up pairing up with martian women more often than not.

I’m sure that there will be quite a lot of angst over the preferences of martian vs earth partners just as we see race preferences in online dating today.

Even with this limited simulation I can already see interesting drama unfolding in this Martian city!

Collaboration – The Lady of Thorn Keep

One of my on-going writing projects is a collaboration with artist and friend Stephanie Stone.  Together we’re bringing together the world of Thorn Keep, a fantasy setting where clans of anthropomorphic humans suffer through nominally fantasy setting kinds of things… war, politics, betrayal, etc.

The overall world was Steph’s invention.  She came to me with an initial plot and a few key characters.  It was my job to flesh things out and breath some life into the skeletal beginnings of the concept.  Once I’ve written and edited a section of story, Steph will then produce an artistic rendering from that segment.  The image you see to the right is the first such example.  You can keep up with the story either through the artist’s Deviant Art account, or through my pages here.   The original piece produced is then auctioned off over at FurBuy.

I will also keep a running storyboard here as a page off the blog.  We’ve just put out our second installment… Stay tuned for more updates.

Submediant, the voice of robots

This past weekend, I spent some time honing the script from last blog post into a framework that could be used to give voice to my Little Robots.  Okay, so what’s changed since I published that awesome .wav generating perl script? Well, first let’s listen to something rendered by the new script…

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

You can hear that the sound is far more refined.  I took the time to add some basic attack and decay to the sine waveform.  Even though it’s one of the most audible changes… it’s probably one of the least significant.   One major change from the previous script is the movement of all data to external data files…

Here is the data file that generated the MP3 that you just listened to:

@SONGTITLE:Minuet in G
@ALBUMNAME:Let Them Eat Test
@ARTIST:Little Robots
@YEAR:2011
@GENRE:other

&righthand
D4,1/4 G3,1/8 A3,1/8 B3,1/8 C4,1/8
D4,1/4 G3,1/4 G3,1/4
E4,1/4 C4,1/8 D4,1/8 E4,1/8 F#4,1/8
G4,1/4 G3,1/4 G3,1/4

&lefthand
B2,1/2 A2,1/4
B2,1/2.
C3,1/2.
B2,1/2.

&righthand
C4,1/4 D4,1/8 C4,1/8 B3,1/8 A3,1/8
B3,1/4 C4,1/8 B3,1/8 A3,1/8 G3,1/8
F#3,1/4 G3,1/8 A3,1/8 B3,1/8 G3,1/8
A3,1/2.

&lefthand
A2,1/2.
G2,1/2.
D3,1/4 B2,1/4 G2,1/4
F#2,1/4 D2,1/4 F#2,1/4

&righthand
D4,1/4 G3,1/8 A3,1/8 B3,1/8 C4,1/8
D4,1/4 G3,1/4 G3,1/4
E4,1/4 C4,1/8 D4,1/8 E4,1/8 F#4,1/8
G4,1/4 G3,1/4 G3,1/4

&lefthand
B2,1/2 A2,1/4
B2,1/2.
C3,1/2.
B2,1/2.

&righthand
C4,1/4 D4,1/8 C4,1/8 B3,1/8 A3,1/8
B3,1/4 C4,1/8 B3,1/8 A3,1/8 G3,1/8
A3,1/4 B3,1/8 A3,1/8 G3,1/8 F#3,1/8
G3,1/2.

&lefthand
A2,1/2.
G2,1/2.
C2,1/4 D2,1/4 D2,1/4
G2,1/4 D2,1/4 G0,1/4

You can see, both the notes and metadata about the song are found all in one place, completely apart from the code.  At the very top of the file are attributes which are denoted with an ‘@’.  Notes are comma separated tuples where the first field is the note itself and the 2nd field is its duration.   Notes are divided into sections attributed to instruments (set off by an &).  Multiple sections for a single instrument simply append notes.

In this particular example, we have two instruments, one called lefthand and the other called righthand.  They simulate the left and right hands when playing the very simplified version of Minuet in G from the Easiest Book of Piano Favorites.

Both the notes and the durations are defined in a file.  The notes get mapped to frequencies and the durations get mapped to fractions of beats.  In my notation, 1/2 means half note, 1/4 means quarter note, etc… and if it ends in a period, that’s a dotted note.

Like all great projects, this one needed a name… and so I scoured Wikipedia‘s audio/sound entries for the first cool sounding term that I had no real understanding of… and that became the name of the project… Submediant. Even after trying to read the wiki page… I still have no idea what a Submediant is… but I’m sticking to it.

Exit Structured Audio, Enter Home Grown

In a previous blog post, I had explored using MPEG4 Structured Audio to produce the sounds that my robots will make in future animation.  A few weeks later, I find that the learning curve for the tools is a bit too steep for my liking… so I decided to start from scratch… and write my own.

Yeah, I understand that people of far greater sound knowledge and experience put a LOT of effort into Structured Audio, but that doesn’t help me now.  Maybe this tool that I’m building (which doesn’t quite have a name yet) will iterate toward the stuff I’m giving up… but I’m sure I’ll learn quite a bit about audio programming along the way.

As it turns out, most of the tool chain that I had previously built still works! I’m just replacing sfront with something that I’ve written… and if you’re curious what a program looks like which generates .wav files? here it is!

#!/usr/bin/perl

use strict;

my $filename = shift @ARGV;
die "You must specify an output file." unless $filename;

my %aliases = (
   C4 => 261.626,
   D4 => 293.665,
   E4 => 329.628,
   F4 => 349.228,
   G4 => 391.995,
   A4 => 440.000,
   B4 => 493.883,
   C5 => 523.251
);

my @song = qw(B4 A4 G4 A4 B4 B4 B4 A4 A4 A4 B4
              D4 D4 B4 A4 G4 A4 B4 B4 B4 B4 A4 A4 B4 A4 G4);
my $duration = (scalar @song) * 0.5 + 0.5;
my $volume = 8000;

my @notes;
push @notes, $aliases{$_} for @song;

my $channels = 1;
my $samplerate = 44100;
my $bitspersample = 16;
my $byterate = $channels * $samplerate * $bitspersample / 8;
my $blockalign = $channels * $bitspersample / 8;
my $samples = $samplerate * $duration;
my $dataChunkSize = $samples * $bitspersample / 8;
my $chunkSize = 36 + $dataChunkSize;

my @values;
for (my $i = 0; $i < $samples; $i++) {
   my $note = int($i / $samplerate * 2);
   my $freq = $notes[$note];
   my $x = $i * $freq / $samplerate * 3.14159 * 2;
   push @values, int($volume * sin($x));
}

open(FILE, "> $filename") || die "could not open $filename";
print FILE pack('NVN', 0x52494646, $chunkSize, 0x57415645);
print FILE pack('NVvvVVvv', 0x666d7420, 16, 1, $channels, $samplerate,
     $byterate, $blockalign, $bitspersample);
print FILE pack('NV', 0x64617461, $dataChunkSize);
for my $sample (@values) {
    print FILE pack('v', $sample);
}

close(FILE);

Yup. That’s the whole thing.  No libraries. No weird complexity.

I decided to write the thing in perl for the practice.  I use an awful lot of perl at work, so as this project grows, it’ll force me to learn the proper perl patterns.

If you’re curious what that program produces? Here’s the converted MP3:

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Seña’s Final Eye Rigging

I took some time over the Labor Day weekend to finalize Seña’s eye rigging.  As you can see from the image to the right, the rigging itself is made up of something like 25 bones.  Crazy but awesome.

A particularly pleasing aspect of finishing this rig is, it satisfies all of the requirements that I set forth in my previous post about Eye Detail.  This means that I wasn’t forced to compromise with the features I wanted… I was able to figure it all out.

While rigging the “eye petals” (the four sun shades around the outside of the eye), I ran into another peculiarity of blender‘s armature system.  Let me describe the setup… The eye petals each have a vertex group (upper petal, lower petal, left petal, right petal) and each vertex group has an associated bone in the armature (they’re the largest ones in the image above).  Whenever I’d rotate a petal, though, it’d deform in very peculiar ways.  Below is a simple rig that reproduces the problem…

For the first say, 20 degrees of rotation everything looks fine.  You’ll notice though as the bone is rotated, the box it rotates starts to get smaller and no longer seems to follow the track of rotation.  Grrr… what’s causing that??!

Before I present the solution, I need to show you how the vertex groups are set up so that I can explain what it is we’re seeing here…

You can see that I have two vertex groups… “Upper Box” represents the box we’re trying to move and “All Boxes” is a group containing both the upper and lower box.  “All Boxes” is associated with the parent bone (behind blue one) and “Upper box” is associated with only the box that we’re moving.

Because the upper box is being influenced by two different bones at the same time, their overlapping influence on the vertexes of the box causes the strange behavior.  The solution is to remove the upper box from the “All Boxes” vertex group.  Once I removed the overlap in bone influence everything works as expected.

The PAX 2011 Sorting Workshop

I was going through the PAX Prime 2011 program guide one last time before committing it to the circular file when a paper (picture right) fell out.

Yes, mofo. That paper is hand written. By me. Barbaric right?  So what exactly is this artifact?

There was a panel that I attended called “The Sorting Workshop”.  I was intrigued both by the Harry Potterness of the title and the fact that it was a writing panel at a game convention.  I wanted to be sorted!  Instead of being sorted into magical houses, however, the goal of the panel was to sort you into your best games related writing occupation (Journalism, PR, or Community Management).  Let me quote, verbatim, the description of the panel as found in the program guide:

Unicorn Theatre
The Sorting Workshop
3:00pm – 4:00pm
Writing Workshop: Journalism, PR, Community Managers Industry vets inflict writing on attendees to determine where in the industry an apsiring writer belongs. A game developer and a publicist kick things off with a 10-minute product demo that you get 20 minutes to write up. Then a panel of journalists, community managers, and publicists sort your writing samples into which field it aught to be in based on tone, content, and accuracy. You won’t be graded, but you might be mocked with dramatic readings of your sample. Whatever happens, you’ll have a chance to make industry contacts and learn the difference between writing for journalism, for community management, for marketing and for PR. Bring pens, pencils and a surface to write on (we recommend the PAX guide) – We’ll provide the rest.

Panelists include: AJ Glasser [Lead writer, Inside Social Games, inside Network],
Susan Arendt [Senior Editor, The Escapist], Dan Amrich [Social Media Manager, Ac-
tivision, Sue Bohle [Founder, The Bohle Company], Jon “Seg” Seggerson [Content
Programmer, Telltale Games]

The thing that made this panel awesome were the panelists.  All of the other panels that I attended at PAX were fluffy, comforting workshops that tried to make you feel good about yourself and your lack of ability.  I enjoyed that these professionals just kind of breathed real life into the presentation.  (They also weren’t afraid to brandish expletives. It was fucking rad)

We ran out of time before individuals could get properly sorted… so I will never know whether I’m destined for PR fame or community management… As a career software engineer, though, I suppose it doesn’t matter much in the long run…  Still.. if you happened to have been on that panel and are reading this… drop me a note!