Friday, September 28, 2012

Biggest Mess Ever

Hey, see these images?  They're supposed to resemble each other.

I've got just over 15 hours to get this damn program working and write a research report about this before I have to turn it over to UPS for overnight shipping.


Thursday, September 27, 2012


I'm building a shape analysis program and writing an 18-page research paper in one night.  So, before I go completely off the wall I need something to distract me.

Some of the more perceptive of you might have noticed I've switched to Linux.  Specifically, Ubuntu 12.04 LTS.  And it's absolutely beautiful.

A quick dry run:

  • XKCD jokes are a ton more enjoyable when you understand them.  This is by far the biggest pro.
  • No more linker errors.  Or at least, it's less of a problem.  Everything typically installs to your /usr/ folder so it's all system-wide.  (Although arguably the same can be done on Windows, it's more hassle-free on Linux).
  • Very flexible Terminal; more (useful) arguments available and it's almost possible to control your entire computer GUI-less if you know what you're doing.  (Windows' Command Prompt falls behind just a tiny bit).
  • Installing anything is a breeze.  Either find it in the Software Center (which has a slew of great programs, both free and paid) or find the package name and install it with:
 sudo apt-get install [package-name]
  • Super resilient to viruses.  Compared to Windows, very few people spend time making viruses for Linux systems considering they make up a minuscule portion of the market.
  • Workspaces let you essentially quadruple the size of your screen, allowing you to push groups of windows around very easily between the four quadrants.  (Same goes for Macs, I believe).
  • I hear it's fantastic for networking and server maintenance but I can't personally attest to that.
  •  Lack of Windows program support.  You'll be leaving all your favorite Windows programs behind.  There's WINE, of course, but it's fairly buggy.
  • As far as I know, there's no task manager.  Crashes for good, and the proper restart procedure is a really masochistic key combo: Alt-PrintScr + R E I S U B, in that order.  Seriously.  Why.
  • Not much point in using it if you're not a programmer.  It's clearly built around convenience to coders.  Stick with Windows if you're not having problems with static libraries or what-have-you.
  • Cross-compiling is kind of a pain.  It's also a necessity, since you're programs will likely be distributed to Windows users.
Overall I'm really glad I switched but I won't be getting rid of my Windows partition anytime soon.  If you're coding in any library-dependent languages then I highly suggest at least VM'ing it and testing it out.  Brilliant OS.

(I just wasted 20 minutes that could've gone to that research paper.  Go figure.)

Sunday, September 23, 2012

Loaf : Part One

This happens every time.

Jammed with Loaf today for four hours and ended up drawing that while everyone else was straddled down with Github errors and Borderlands 2.

Aaaahauauuuuuuu Githuuub.

Saturday, September 22, 2012

The Game-Design Normal Curve

A.K.A., a really self-centered timeline of my game-dev non-career.

My friend Exar sent me this video we made a while back with most of the games we made about 3 years into game development, and wow.  They're great.

Or no, they're not.  But they're actually playable.

I've been making games for (six? seven?) years now and here's how it's been.

Year One:
Ohmygosh gamedev!  Ohmygoshohmygosh this is so fun.  I can't draw but there's sprite libraries everywhere let me just borrow some here and there, and wow!  Dodge the ghosts!  Done!  I am so cool.

Year Two:
Game Maker is really super nice I don't know why people don't use it more, you can do anything in it ever.  But I guess I should try a little C++, I hear that's standard.  WOW nevermind this is impossible, sticking with GM.

I can draw a little now and I'm starting this great game called Blobworld which is really pretty good and I'm happy with it.

SEQUEL TIME, it doesn't matter that I never released the first one, 'Blobworld: The Ice Age' is coming soon!

Nevermind!  I'm going to work on it up to version 0.92 and then just completely stop.

(Turns out, this is typically what I always do).

Year Three:
YoYo Games is putting on this competition!  Wow!  I can totally win this, let me make this gizmo-based game called 'The Infinity Engine' and oh, wait.

It's literally impossible for anyone except me.  No, really.  I am the only person to have gotten past level 3, and there's 25 levels.

I should probably fix that.


(Plagued by this for the next four years, no one ever knows how to play my games).

Year Four:
Zerosoft Games is hosting a team competition, let me join.  Fuzion Creative and I spit out this rockin' Death Worm clone 'Tropically Correct', and we land second place.  We later start working on a long-term company called Fuzion Creative / Awoken Entertainment.

Everything goes straight down from here.

Year Five:
This is about the time I transfer out of a top-level private high school, even after getting a full ride there (a $20,000 scholarship).  The people were too college-oriented and lacked hobbies of any sort; I couldn't learn anything from them.  But it turns out, lo and behold, the people at the new school are exactly the same.

That was disappointing.

I kind of lose faith in game design and people in general.  Sort of slugged out Wrapple development for a really long time before Fuzion Creative picks up my slack and submits it anyways.  It nabs 'Staff Pick' on YoYo Games.

I then release 'Holiday Bombings' and 'Retroplat' later in the year, both for Zerosoft competitions.  Holiday Bombings wins 3rd and Retroplat get a runner-up award.  Retroplat turns out to be really successful; a certain Mr. Larson asks for an interview with me and Indie Game Comics features it in a webcomic.  All three sites, the interview, IG Comics, and Zerosoft, are now down, along with any proof of those occurences.  I submit it to a random side competition and it places a nice 4th.

Still not very happy with game design, or life in general.  I start realizing that there's no future in indie game design at all.

Year Six:
Total lack of attention span.  The GMC Jam starts running every few months, and I join the first four or so.  'Diagnosis' gets the closest to winning one (at 2nd place) and 'Pannenkoekenhuis' gets (12th?  I think?).  Pannenkoekenhuis later becomes my flagship game, which I remade in Flash and threw up on MochiAds, who later decided to spam it literally everywhere.  Google "pannenkoekenhuis game" and you'll see what I mean.  I'm still getting random hits on my blog from it.

The plan was this: Make a Flash game, post it on MochiAds or run it for sponsorships, use the money to start larger projects that recursively fund other projects and eventually make enough to start a full-fledged company, or at least to pay for college.

I make about two dollars with Pannenkoekenhuis.

Someone introduces me to a guy in Belgium who needs a Flash developer, and we work together on a few games which I'm not allowed to disclose because they're still being shown to potential sponsors.

'Cantilever Bridge' is born.  It's my ugly duckling.  It's a book disguised as a game, where one city decides to unite itself with another, of which it harbors heavy animosities toward.  The bridge is built, civilians kill each other over nothing and a war starts.  Your character is drafted in and you kill people along the bridge, but it's steady enough that you never realize until the very end that every single character has died, either by your hands or by circumstance, except for the Old Man.  He then decides to blow up the bridge while still on it, leaving you completely alone, in the wrong city, with no way to get back.

Only one person understood the story.  I was proud anyway.

Some people on YoYo Games start the Rapid Development Competition, in which you have 4 hours to make a game from scratch.  The people are generally nice and I actually manage to win one with 'Coma', which isn't particularly prestigious since there's about, on average, eight or nine entries.  But the competitions are cancelled, then revived, then cancelled, then revived, until somehow they end up in my hands as host.  I rebrand it as the 4 Hour Jam where it's all nice and cuddly before it dies out, once again.

Some time around here I somehow manage to not pass out for three days, and 'Fix It' is made for a GMC Jam.  raocow picks it up to review and it's all good fun, except for the fact that, once again, the game is impossible and no one but me can beat it.  But I'm proud of the concept; it's a simple room-based platformer where walls and objects exist on separate layers, which can be flipped back and forth like pages in a book.

And, by this point, I've completely dropped the idea of serious game design.  Just, why?  It's so much more fun making games that absolutely suck and watching people react to them.  One that I enjoyed making, called 'The Bleed Man', has a guy that you click on constantly to draw blood spots on him as he slowly shrinks away in pain.  (I didn't even bother to restrain the blood spots to his body; they appear across the screen in empty space just as much).  'You Broke The Big Thing!' involves a boss that doesn't attack you and a completely irrelevant story (irrelevant everything, really).  'This Town (ABEFTTOU)!' involves the ludicrous setting of two people on a tiny globe, trying to shoot each other in the back and somehow being completely unable to turn around.  They throw energy-harvesting balloons in the air to make them run faster and drop dead babies to slow down the other.  And in the informal RDC's I become known as "that guy that makes the really shitty games that are somewhat funny anyways."

Year Seven:

Sometimes I look back at my old games and think, hahahahah, hahahah, ahah, wow.  How did I have the attention span to make that.

There is no reason I should've spent time on all of that.

No reason.

Just wow.

The Game-Design Normal Curve:
  1. Learn how to make games.
  2. Make good games.
  3. Forget how to make games.
  4. Make complete shit.

Thursday, September 20, 2012

Local Gamedev Group!

There's game designers at my school.

I don't think you understand the weight of this.  There are game designers at my school.  They must've been hiding in rocks and bushes because I've been looking for people to jam with for four years.  And these people are great.  Graphics designers/programmers/composers, the whole package.

I talked to them and they were cool with me joining them for a gamedev session this Sunday.  Will update with what we end up making when it happens, but this is good news.


Other news, I'm doing this essay thing about religion, so while I tend to stay relatively agnostic about religion, expect some more polarized posts one way or the other in the future.

Wednesday, September 19, 2012

C++ : Symbolic Regression - Part 2

Hey, remember that post I made forever ago about making some symbolic regression via genetic programming?  You probably thought I completely gave up on that, right?

Well I have a surprise for you, sillies.  I did.

But then with this new Auto-Generated Music project, I rewrote it from scratch and it actually works.

(Note: The final equation is written in Reverse Polish Notation, which is just a whole lot easier to work with).

But we're not done yet.  For one, the equations tend to converge to local maxima.  In simplespeak, they tend to mutate towards an optimal state, but occasionally the best equation will actually have a radically different structure.  Then, the equation will have to mutate to a state that's actually undesirable, before being able to adjust into the best possible equation.

Another thing you might notice is that it's unreadable as f-ck.  Part of it is because of reverse Polish, but really it's because of redundancy in the code.  The screenshot above doesn't show it, but often you'll get large sections of just adding 0 or multiplying 1.  These options are completely unnecessary, and bog down the code.  Therefore, optimally we'd simplify equations before storing or processing them.

A possible solution to this problem is to hardcode redundant node properties in, which works for very basic redundancies but not much else.  It's easy to do, say, 0 + x = x, or 1 * x = x and call it a day.  But what about sqr(sqrt(x)) = x?  Or i + i + x = x + 2i?  It's not trivial to cover all possible redundancies (although you'd certainly get a good chunk of them).

Another is to do it dynamically, with a second genetic algorithm beneath that takes into account the complexity of the equation.  Say you have x + x + 0 * 1 + x * 1.  Use that as a grading criteria, and mutate it constantly for a certain amount of time.  Then, the equation that matches the initial state exactly (graded by iterating over all possible values) with the fewest nodes replaces the initial.  Problem here is that it's computationally-expensive and also not completely guaranteed to work.

Something to look into is the MOSES algorithm.  Essentially, equations use a set of parameters called knobs, useful for tweaking the equation in mutations (think constants, or what-have-you).

But uh.  Bedtime for me.  'Night.

Sunday, September 9, 2012

Auto-generated Music : Time-Frequency Analysis

New side project!  Time to add it to my list of 20 other side projects.

Goal: Generate some nice instrument samples that don't just sound like A. waves, or B. random noise.

Big-Fish Goal: Use these instrument samples to generate music.

Partially because I'm lazy and can't make my own music.
Partially because it'd be pretty fucking cool.

The first arm of this project lies in something called time-frequency analysis.  Essentially, you're looking at the dominance of sound (time) and the dominance of pitch (frequency) throughout a sample.

The interesting thing is, "good" sounds tend to have something in common.  Look at the following frequencies of a sine wave at 440 Hz:

Sine Wave
 You can see it peaking at 440 Hz first of all (not surprising), but more important is that it slopes downwards in general.  Being a sine wave (and having a parallel frequency graph) makes it not-so-intuitive to see, but here's one of white noise:
It spikes up at random and stays uniform throughout every frequency.  It also sounds like murder to the ears.

Meanwhile, here's one of pink noise, which is a little more tolerable to listen to:
See the difference?  "Good" sounds tend to have dominance in the lower frequencies, and then pan out.

(If you're interested, brown noise does the same.  Didn't post a screenshot but it's very similar to that of pink noise).

Now, the problem I'm having is that frequencies are discrete here.  If I were to, say, average out the frequencies of 20 different sine waves, then I won't converge to a "good" frequency graph.  I'll just get random peaks everywhere.  Sine waves with different frequencies will have their peaks a bit over to the left or right of the others.

Same problem happens in the time (amplitude) domain.  A drum sound, for example, has a small attack phase, where the sound gets very loud, and then a long tail afterwards.  Snare sample:
Someone tell me how to crop images in Ubuntu :(
This goes for pretty much every basic drum.  But say the sample wasn't properly made, and it has a long piece of silence at the beginning that moves everything over a few 0.1 seconds or so.  When you average the sounds out, you'd get something fairly uniform rather than a straight downwards slope.

... I'm not sure how I'd remedy this but averaging out the derivatives between values rather than discrete points might work out?  Who knows.

Will keep you updated.