# All Posts

Most recent displayed first:

• ## Batman (NES) Pixel Art Study

I’m trying to improve my pixel art skill, so I thought it would be fun to take a closer look at one of the most beautiful NES games ever made – Batman!

I love the pixel art in Batman! Let’s dive in and bask in its glory. Feel free to ignore my commentary and just enjoy the art :-).

• ## FABRIK Algorithm (2D)

FABRIK stands for Forward-and-Backward Reaching Inverse Kinematics, and it’s a very simple, fast, and clever solution to the inverse kinematics problem.

Let’s inspect this interesting algorithm in 2D.

• ## This Isn't Normal

“That’s just the way it is!”

It amazes me how easily bad ideas fool humans.

• ## Super Trump Run

I’ve been depressed lately. I decided to make a game to make me laugh and vent some steam. Enjoy!

• ## The Failure of Being Right

Doesn’t it feel great to be right?

• ## NaN-Boxing

How do dynamicly typed languages allow any variable to hold any type? There are a few different techniques, but the one I use for sink is NaN-boxing.

• ## Growing Through Pain

Watching the children around me growing up, I am always amazed at the amount of pain they are forced to deal with. Illness, uncertainty, divorce, frustration, powerlessness, death…

A child experiences such extreme amounts of pain on a daily basis.

• ## Polygon Clipping (Part 2)

My previous polygon clipping tutorial dove into the Greiner-Hormann clipping algorithm. Unfortunately, this algorithm fails at common cases… so let’s revist the problem and try again.

The F. Martinez 2008 algorithm handles coincident edges (unlike Greiner-Hormann), but it still has some minor goofiness. Let’s solve this problem once and for all.

• ## Polygon Clipping (Part 1)

Polygon clipping is an interesting problem: how do you intersect, union, or diff two polygons?

The Greiner-Hormann clipping algorithm is quite beautiful and intuitive. Let’s dissect it and take a look.

• ## C Tricks

I’ve been coding in C99 quite a lot lately. I wanted to write down some of the tricks I’ve been using.

I don’t take credit for any of these ideas – I’ve either directly stolen these ideas from other coders, or rediscovered techniques that have probably been known for 40 years.

I will continue updating this document as I stumble across more useful tricks.

• ## De-Bug

Writing Prompt from /u/raybreezer:

The world as you know it has managed to exist without any free will whatsoever. One day you realize, you actually have the ability to control your own actions.

• ## Tri-Color Garbage Collector

Garbage collectors (GCs) feel like some sort of esoteric programming magic. What’s really funny is that a simple good-enough garbage collector is actually quite easy to write. The core functionality of a basic tri-color GC is only around 250 lines of C code.

• ## You Are The Cook

What a shame that so many people lead the same basic life.

• ## The Gray Sludge

Each paint stroke is death.

One more moment, lost to the abyss, never to be seen again.

Miniscule fragments claw themselves forward, trying to outrun their inevitable fate: the gray sludge.

• ## Genetic Algorithms

In my Ludum Dare 31 entry, Bunnies!, I used a very simple genetic algorithm to breed bunnies. It can seem like magic at first, but genetic algorithms are very simple at their core.

• ## Ludum Dare 31 Live-Blog!

Live-blogging my Ludum Dare 31 experience. Most recent entries are on top. I’ll plan to post about once an hour (while working). You’ll have to manually refresh the page to get updates. Follow and comment on twitter @velipso. All timestamps in EST.

• ## Shunting Yard (Part 3)

Let’s continue adding to our Shunting Yard code base.

In Part 2, we created operator precedence. This allowed us to delay application of operators indefinitely, using a stack. Next, we’ll focus on adding parentheses, so that the end-user can manually override precedence.

Series: Part 1, Part 2, Part 3, …

• ## Odyssey (LD30) Postmortem

Results are out for Ludum Dare 30, and my game Odyssey did pretty damn good!

Rank (of 1493) Category Rating
#13 Fun 4.11
#24 Theme 4.16
#34 Overall 4.00
#60 Innovation 4.00
#200 Mood 3.45
#269 Audio 3.22
#337 Humor 2.71
#484 Graphics 3.19

The #13 ranking in Fun just blows me away! My aggregate rating is 93.6% (+0.1% from last time).

• ## Jimmy Boy

Writing Prompt from /u/BS9966:

Suddenly various living dinosaurs start appearing all across the planet. No one knows how or where they are coming from.

• ## Everyone's Ludum Dare 30 Results

Like last time, I analyzed the Ludum Dare results.

• ## Shunting Yard (Part 2)

Let’s continue building a general purpose Shunting Yard algorithm.

We left off with bare-bones skeleton that implements a shunt to delay building of the abstract syntax tree (AST). Our skeleton left a lot to be desired. For this article, we’ll implement operator precedence.

Please read Part 1 first, since the code here builds directly on the source from that article.

Series: Part 1, Part 2, Part 3

• ## Procedurally Generated Planet Textures

For my Ludum Dare entry, I procedurally generate the textures for the planets. In the game, my math is a little off, and I didn’t have time to derive the correct formula – but now, with unlimited time, I can think a little more clearly :-).

• ## Ludum Dare 30 Live-Blog!

Live-blogging my Ludum Dare 30 experience. Most recent entries are on top. I’ll plan to post about once an hour (while working). You’ll have to manually refresh the page to get updates. Follow and comment on twitter @velipso. All timestamps in EST.

• ## Everyone's Ludum Dare 29 Results

I became slightly annoyed at the analysis and accessibility of the Ludum Dare 29 results. So I decided to write a program that would scrape all the pages and extract the necessary data.

You can now download the LD29 results in a convenient CSV or JSON format, here:

Or, for even more fun, I made a page that analyzes results:

Have fun!

• ## Shunting Yard (Part 1)

The Shunting Yard Algorithm is, quite possibly, my favorite algorithm. It transforms a series of tokens into an abstract syntax tree, taking into account operator type, precedence, and parenthesis.

Through the next series of articles, I want to build a general purpose expression parser using the algorithm. By the end, we’ll have an algorithm that can be easily extended to add many different types of operators… any arity (unary, binary, ternary, etc), prefix, infix, and postfix.

Series: Part 1, Part 2, Part 3

• ## Inner Demons (LD29) Postmortem

Voting has officially ended for Ludum Dare 29. My entry was ranked as follows:

Rank (of 1493) Category Rating Percent Improvement
#63 Mood 3.88 95.8% +31.9%
#70 Humor 3.64 95.3% +22.0%
#101 Innovation 3.88 93.2% +26.5%
#116 Overall 3.76 92.2% +23.3%
#148 Fun 3.60 90.1% +10.9%
#149 Audio 3.50 90.0% N/A
#227 Theme 3.64 84.8% +52.3%
#551 Graphics 3.17 63.1% -8.0%

Average score: 88.1% (+23.0% improvement from previous entry)

If you’re curious, you can play my game, Inner Demons! Let’s dive into the postmortem…

• ## Ludum Dare 29 Live-Blog!

Live-blogging my Ludum Dare 29 experience. Most recent entries are on top. I’ll plan to post about once an hour (while working). You’ll have to manually refresh the page to get updates. Follow and comment on twitter @velipso. All timestamps in EST.

• ## Winter Olympics Game Jam

I decided to challenge myself this weekend, with a faux-game-jam. I came up with a theme on Friday (Winter Olympics), and built Sled Drifter! over the course of the long weekend.

• ## Diner Devil! (LD28) Postmortem

Voting has officially ended for Ludum Dare 28. My entry was ranked as follows:

Rank (of 1284) Category Rating Percent
#267 Fun 3.22 79.2%
#343 Humor 2.61 73.3%
#371 Graphics 3.17 71.1%
#399 Overall 3.13 68.9%
#427 Innovation 3.00 66.7%
#464 Mood 2.81 63.9%
#867 Theme 2.14 32.5%

Average score: 65.1%

If you’re curious, you can play my game, Diner Devil! Let’s dive into the postmortem…

• ## Two-Dimensional Bin Packing

Two-dimensional bin packing turns out to be quite a pickle.

I was introduced to the problem as a 13 year old. My Dad’s friend, Keith, noticed I was taking a knack to programming, and wanted to see if I could help him. Keith was (and still is) a carpenter.

Keith wanted me to write a program where he could input a list of shapes, and the program would figure out the best way to cut a board of wood into those shapes, while minimizing scrap wood. Seems reasonable.

My 13 year old mind quickly exploded… I couldn’t figure out one simple, obvious way to do it. Eventually I gave up, to my ego’s dismay (and Keith’s disappointment!).

• ## Ludum Dare 28 Live-Blog!

Live-blogging my Ludum Dare 28 experience. Most recent entries are on top. I’ll plan to post about once an hour (while working). You’ll have to manually refresh the page to get updates. Follow and comment on twitter @velipso. All timestamps in EST.

• ## How to Fix Banding in Gradients

Photoshop’s gradient algorithm is quite disappointing. It is notorious for creating gradients with banding. Here is an example, attempting to create a gradient from `#222` to `#333`: