Attempted Ludum Dare #16

December 15th, 2009

I attempted Ludum Dare #16 last weekend.  It’s very difficult to completely write from scratch a full game.  My project did not come near completion, but I had a lot of fun.  Instead of having writing sprites, animation, resource management, gui, tilemaps, etc. code it would have been much quicker to have started with a library or framework that had taken care of most of that stuff.

Here is a timelapse video of me working.  It is 22 hours of the 48 hour long competition.  The only parts not recorded was when my computer was off and when my screen was blank from inactivity.  Music is Escape Route by Corran on the Cave Story ReMix Project based on the music of Cave Story by Pixel.

Procedural Adventure Map Generation

April 26th, 2009

A few days ago I was thinking about how to procedurally generate interesting maps for an adventure game.  I did not want them to look like they were generated by an algorithm, but instead would be convincing enough to appear as if it had been designed by a human.  I wanted the maps to both have a natural appearance and a nice flow of game-play similar to a Zelda game.

This article will outline how such a procedurally generated map could be made.  Note, I have not yet written the program.  All the illustrations shown here were hand-drawn, but the results of a real implementation of this generater should be the same.

Room Seeds

Starting locations for rooms to grow from.

Starting locations for rooms to grow from.

The first thing to do is to randomly select starting locations to grow rooms from, as indicated as green circles.  These locations will be stored in a list of grid cells.

Grow Rooms

Rooms grown to fill cells.

Rooms grown to fill cells.

A cell will be randomly selected from the list of active cells.  If the cell has empty neighboring cell that will be activated, given the same room id, and added to the active cell list.  If the cell has no available empty neighboring cell it would be removed from the list.  This loops until all of the cells are filled, defining the shapes of each of the rooms.  The growth pattern is shown as blue lines and the room boundaries are indicated as black lines.

Connectivity

Finding how the rooms are connected.

Finding how the rooms are connected.

The cells of neighboring rooms will be noted and a list of possible door locations will created.  These possible door locations are indicated as short red lines.

A separate list will be generated noting what rooms are accessible to each other room.  The links between rooms are shown here as pale yellow lines.  No spacial information is needed, but for illustration purposes I’m using the room seeds to make the connectivity easier to see.

Flow of game-play

Flow of game-play connectivity.

Flow of game-play connectivity.

A starting location will be selected.  If this is the game’s over-world then the starting point may be any random room.  If this is an interior location, such as a castle, an outer room may be a better choice.  The starting location is shown as a little star here.

Starting from the start location connecting paths between rooms will be defined.  A running inventory of items obtained in rooms will be kept track of, such as the collecting of keys.  If a key is available then a locked door between rooms may be defined.  This will result in the creation of a new room group.  The room groups are shown as colored lines with the group id and group depth level also indicated.

Interlinking between rooms of the same group may be fairly common.  Cross linking between rooms of the same group depth level should be more rare to make sure rooms or whole groups are not skipped too often.

Keys will keep track of what room group id they were obtained in.  Keys should only be used in room groups of greater or equal group id to make sure the player doesn’t get stuck by choosing a different order of game-play — since any key can open any door and the key dissappears after use.  Use-once and infinite-use items do not need as much care since there is no risk of cutting off access to pathways.

Defining Doors

Choosing where doors will go.

Choosing where doors will go.

Doors will be selected from the possible door locations list.  In the above illustration unlocked doors are white and locked doors are yellow.  I also shown where keys may be obtained.

Doors do not need to be a single space.  Several doors may be selected, whole walls removed, or any other pattern of connectivity could be used depending on situation and desired result.

Using room growth info

Using room growth information.

Using room growth information.

Dead ends in the room growth process can be useful.  As long as the cell is not in front of a door, we know the player does not need to cross through these cells to reach other areas in the game.  These cells can safely be blocked off if we wanted them to be.

Beautification

Final map.

Final map.

We can now use all the information we had gathered in the previous steps to generate the final map.  Here I filled in the spaces between the rooms and the dead ends with trees.  I also added a few other decorations just to make it not look so sparse.

And there you have it — an intersting procedurally generated map ready to be explored.

Alien Game Prototype

February 12th, 2009
Alien Game Prototype

Alien Game Prototype

For one of the Ludum Dare mini competitions a few months back I started hacking together a simple arcade style game.  The human race is being attacked an eaten by a vicious alien species.  You play the role of a benevolent alien who comes to the rescue of the helpless humans.

Originally the only defence the hero had against the invading aliens was going to be a tractor beam — where you must grab and throw the aliens to get rid of them.  After showing it to the Pipe Cleaner Man he insisted that I added lasers and homing missiles, so I did.

I’m not certain what I’m going to do with this project.  As it began as a quick hack for a 48 hour competition, it is not very well designed.  It would need a considerable amount of rewriting before being able to transform it into a real game.

For the time being I think I’ll hold off before posting the actual game for download.  I would like to add at least a simple scoreboard and actually being able to win or lose before sharing it.

Random Neighborhood Generator

January 20th, 2009
Random Neighborhood Generator

Random Neighborhood Generator

I was wondering how visually interesting a randomly generated neighborhood could be a made by using simple binary subdivision.  Basically the algorithm starts with a square, cuts it in half, cuts those halves in half, and so on to produce streets and plots of land.

It is in no way how a real neighborhood would be laid out, but for such simplicity I am rather satisfied with the results.  Such a system could randomly produce results that are visually interesting enough for possibly a small, simple flying or driving based game — such as having to rush a firetruck to burning homes, for example.

Here is the source code: neighborhood.py

Towlr

January 20th, 2009
You Can't Have Your Towlr And Eat It Too

You Can't Have Your Towlr And Eat It Too

A bunch of people at a game development competition site was putting together short confusing games they called “Towlrs.”  The intent of a Towlr is to leave the player wondering, “What exactly am I suppose to do to beat this game?”  I decided to get in on the action.

You Can’t Have Your Towlr And Eat It Too was my attempt at a Towlr.  It may be considerably easier than many of the other Towlrs, but the concept is somewhat interesting.

You can download it at the Towlr website (which includes a Windows executable), or you can go to the page I quickly thrown up on my site (Which requires Python and Pygame because I’m too lazy to copy the compiled vesion to my site.  Also, in the future I may move this to a different directory on my site, so be warned!)

Catching Up

January 20th, 2009

I haven’t been very good at keeping this blog up-to-date.  A few things have happened since some of my previous posts, so I decided to try to bring this site up to speed.

The following posts will show off a few of the things I worked a little on in the past few weeks.  Most likely many of these projects will not amount to much in the future, but I thought I should share them anyway.

I’ve been meaning to write about pretty much everything I had worked on irregardless of their likeliness of completion.  Some things are simply done for fun without any real future plans for them.

I am now going to begin writing about the stuff I neglected to write about earlier.

2009 Plain-Text Calendars

January 4th, 2009

A new year has begun and I found myself wanting a small simple plain-text calendars, so I made a few.  Here they are for anybody who might find them useful.

Standard 2009 Calendar

====== January =====
Su Mo Tu We Th Fr Sa
.  .  .  .  1  2  3
4  5  6  7  8  9  10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Download Standard 2009 Calendar

Compressed 2009 Calendar

JAN      1111111111222222222233
1234567890123456789012345678901

Download Compressed 2009 Calendar

2009 List Calendar

JANUARY
 1 -
 2 -
 3 -
 4 -
 5 -
 6 -
 7 -
...

Download 2009 List Calendar

[edit]Corrected 2009 List Calendar so that the months have 10’s instead of 0’s.  If I wrote a script to make these instead of hand typing them this error may have been avoided![/edit]

Lizard and Bull Characters

November 26th, 2008
Bull and Lizard Characters

Bull and Lizard Character Concept Art

A couple of years ago I came up with an unusual video game idea where you have to help these two species of creatures get along.  They coexist on an island, but, for the most part, hate each other.  Your character, through some misfortune, find yourself stranded on the island and the only way to get home is by befriending the local inhabitants and get them to cooperate — sharing resources and skills — to construct a ship.

The game would have been heavily artificial intelligence driven so that everything that happens effects the emotions and decisions of the characters in an unscripted way (which would have been rather difficult to pull off.)  The characters were going to communicate with each other through simple sentence structures which would convey relationships between characters, objects, locations, items, etc.  If, for example, one character hears news that a friend of his was attacked he might seek out revenge.  The character’s personality traits, knowledge, and emotional states would affect the probability of a character making certain decisions and taking action.  The exact details were never really worked out, however tricking the characters or lying to them would have been possible — which would have made the game have a unique dynamic.  You could deliver a gift to one of the tribes and claim it was from the leader of the other — effecting the way they think and feel about their rivals.  The gameplay would not at all been simple and straight-forward.

Various Python Experiments

November 6th, 2008

Every so often I decide to write simple test programs in Python just for the fun of it.  Here are a few that I had written over in the past.  Please note, because these were originally just simple experiments the source code could be a little messy and poorly optimized in most of them.  Also note, these are not meant to be all that impressive.

All of the programs require Python and PIL (The Python Imaging Library.)

Simple Recursive Maze Generator

Simple Recursive Maze Generator

Simple Recursive Maze Generator

This is just a simple maze generator that uses a recursive function.  It creates a near-infinite number of random mazes.

Source: maze.py

Rectangle Packing

Rectangle Packing

Rectangle Packing

I wanted to figure out a simple and effective way of packing rectangle images in an OpenGL texture — which is useful for hardware accelerated 2D graphics.  The solution I came up with simply subdivides the availible free space and packs the rectangles from largest to smallest.  It may not produce the best packing results and there are quite a few wasted cycles in this implimentation, but, for being as simple as it is, it produces fairly reasonable results rather quickly.

Source: rect_packing.py

Simple Error Diffused Dithering

Error Diffuse Dithering

Error Diffuse Dithering

Just simple error diffusion based image dithering.  The above image is showing four color dithering.

Source: dither_test.py

Random Forest Path

Random Paths Through a Forest

Random Paths Through a Forest

I decided to try to see if I could easily produce a visual effect resembling erosion patterns in a forest area.  This was part of some preliminary work in trying to write a game that randomly generates a completely different world each time it’s played.  The results were very satisfying considering how simple the solution is.  Essentially it’s just squiggly lines of varying thickness with some textureing applied to it.

Source: forest_path.py

Image Outlining

Outlining an Image

Originally I wanted to see if I could have interesting features of an image identified and later used in some sort of image recoginition system.  Hilighting sharp edges brought out too many points to practically be used for comparing spacial relationships and proportions, but it did produce some nice results for drawing outlines on an image.

I wanted to test it on a picture of a person, so I found the above image online.  It is actually a composit of 32 american male faces averaged together.  I hope the creators of the website he’s from does’t mind.

Source: img_outline.py

MiniLD #2 – The Wizard

October 24th, 2008

MiniLD#2 - The Wizard

Way back in July I wrote this simplified Super Mario Brothers 3 game for the Mini Ludum Dare (a 48 hour mini-competition) that month.  The theme of the competition was a game based on a movie.  The movie that I picked was “The Wizard,” which is a movie about some kids who hitchhike across several states playing Nintendo games — so this would have been a video game about a movie about video games.

Originally I was going to have elements from Teenage Mutant Ninja Turtles and Double Dragon (both also featured in the movie) all tied together with an arcade style game where you control Jimmy and play these mini-games against people.  I figured if I made the Super Mario Brothers 3 part (which is the final showdown against Lucas) then I could easily adapt that to make the other parts.

All-in-all it was a little over ambitious, but I think I could have possibly pulled it off if I actually had two full days.  That saturday I went to watch a movie with friends, so I really only had one of the two days to work with.  I am, however, still very satisified with how much was accomplished in such a short amount of time.

Arrow Keys makes mario run, ‘x’ key makes him jump.

Download “The Wizard – The Game.”

Requires Python and PyGame.