martin2k
ForumsVB6GamesSoftwareDirectoryHTMLArticlesBlogContact

November 2013

Blog

2017

Current Month

July

March

February

2014

August

May

January

2013

November

October

September

August

July

June

April

March

February

January

2012

December

October

September

August

2010

June

2009

August

May

February

2008

November

October

July

January

2007

December

November

October

Subscribe Subscribe

 

Friday 22nd November 2013

[Top]

Random Video Game Images

Recently I have been working on a program that generates random images of video games.  It works by placing 32x32 pixel tiles in a resizable grid ensuring that adjacent tiles 'fit' together or rather that they are compatible with other.  The compatibility between tiles is defined in a text file where all tiles are listed and where the top, left, bottom and right of each tile is given a reference.  If, for example, the top of one tile and the bottom of another is given the same reference, the first can be placed below the second.

An example of this is where one tile shows the top of a pipe and another, that can be placed below the first, is a vertical pipe piece.  Where it does not matter if one tile is placed against another i.e. a vertical pipe piece and a tile showing sky, the left and right of the pipe could have the reference '0' and all four sides of the sky would have the same reference, meaning that they are allowed to be placed together.

Here is a sample of one of the configuration files for a set of tiles for displaying random pipes from Super Mario Bros. 3:

Pieces=14
Blank=10
Folder=
Piece1=Cross.bmp
Top1=1
Bottom1=1
Left1=1
Right1=1
Piece2=Down.bmp
Top2=1
Bottom2=0
Left2=0
Right2=0
Bottomb2=1
Piece3=Horiz.bmp
Top3=0
Bottom3=0
Left3=1
Right3=1
Piece4=LD.bmp
Top4=0
Bottom4=1
Left4=1
Right4=0
Piece5=Left.bmp
Top5=0
Bottom5=0
Left5=0
Right5=1
Leftb5=1

The above shows three lines of configuration at the top and then the definition of five pieces.  Each piece is identified by its file name and then the reference of each side.  This file happens to use either '0' or '1' where '1' represents where a pipe can be joined and '0' is for anything else.  Note that 'LD' stands for left-down and is for a corner piece of pipe where the join is at the bottom and to the left.  'Leftb5=1' includes an addtional 'b' to indicate that a blank tile (i.e. where all four sides use the '0' reference) must be placed to the left.  This gives the effect in the generated image of a space to the left of a left pipe opening to give space for entry and exit for that pipe.

Here are some examples of 'green pipes'.  The program that generates these allows the user to turn tiles on and off as well as specifying those that are more likely to be chosen.

Green Pipes 1
Green Pipes 1

Green Pipes 2
Green Pipes 2

Green Pipes 3
Green Pipes 3

Green Pipes 4
Green Pipes 4

Green Pipes 5
Green Pipes 5

Green Pipes 6
Green Pipes 6

Green Pipes 7
Green Pipes 7

Here is the interface, showing an example of Super Mario Bros. 2 tiles.  The number 56 refers to the number of errors that were encountered and fixed while generating the image:

Random Image Generator
Random Image Generator

I have made a couple of videos so far showing images from the following games:

In addition to green pipes, I have so far created tile sets for the following games (as can be seen in the above videos):

Super Mario Bros. 3
Super Mario Bros. 3

The Legend of Zelda: A Link to the Past
The Legend of Zelda: A Link to the Past

Mega Man 2 (NES) - Bubble Man
Mega Man 2 (NES) - Bubble Man

Mega Man 2 (NES) - Crash Man
Mega Man 2 (NES) - Crash Man

Super Mario Land
Super Mario Land

 


blog comments powered by Disqus
Martin Allen 1999 - 2013.  Last updated Sunday 24 November 2013 09:51:12 PM.
Powered by Blog2k