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.
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:
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):