Saturday, March 29, 2008

Remaking Old Games

The past couple of months I have been working on a secret project. I don't want to say much yet, but what I can say is that it is a remake of my favorite computer game ever.

Why Remakes?


Working on this project made me think about the process of remaking an old computer game. To remake an old game is a relatively easy way to make a fun game, because you only have to solve what I'd like to call "local problems". With a local problem I mean a problem whose solution does not affect any other problem. That is, local problems can be solved one by one without worrying about the big picture. Designing a whole new game on the other hand, is a global problem, since many decisions you make in the beginning will have a huge influence on what your game will look like in the end. I think a large project has a much bigger chance of completion when it is clear at all times what needs to be done next, especially when working with a team.

Besides this, most of the technical restrictions the original developers struggled with are gone, allowing for easy improvements in many different areas. For example, back in the early eighties developers were very limited as to what kind of music could be played from a home computer, not in the least because of memory restrictions. Yet by restricting to the essence of the songs the composers had in mind, they still managed to create very catchy game music. And this music is just screaming to be accompanied by that deep base line that would never have been heard through those PC-speakers, a call for creativity through restriction. This is similar for graphics and sound effects.

A third great thing about remaking an old game is that your game automatically has an audience. Many people will like to play the game for reasons of nostalgia. And this is what makes it a lot of fun to remake it as well!

In short, it is relatively easy to complete a remake and many people will be interested in playing it.

Recreating Tile Maps


When I was working on my project there was one area in particular that consumed a lot of time: assembling building pieces (tiles) into tile maps. It is not that I really mind doing it, normally I would be laying a large puzzle in the Christmas holiday, and this year I decided that I would instead reassemble forty tile maps. However, when I had completed about two thirds, I discovered losslessly compressed images of these tile maps that were created directly from the game (as it turns out, for most old computer games such map images are floating around on the internet, often created from screen shots by obsessed gamers ;) ). Only then I decided that I would write a tool that would automatically assemble the pieces into a tile map file.


An example of a losslessly compressed tile map image.


I had chosen to make my maps in the Tile Map XML-format, a format that is used in Tiled, a tile editor written by my friend Bjørn Lindeijer and Adam Turk. From this open format, it should be easy to export it to any other tile map file. However, the hardest part would not be to assemble the tiles in a Tile Map XML-file, but to find a way to arrange the unique tiles in a way that a human could work with it. After all, at some point these tiles will need to be redrawn, and then it would be convenient if they are arranged in a coherent way. Together with Bjørn, I created a heuristic that uses how often tiles are found to be adjacent in the image of the tile map.


An example of a unique tile image.


The Python program Image2Map.py uses this heuristic to create an image of the unique tiles. There is a separate program MapWriter.py that uses this image and the original tile map image to create a Tile Map XML-file. The heuristic does a quite decent job for the information that can be extracted from a tile map image. We realized that it would be impossible to come up with an algorithm that would create a unique tile image just like a human does, because we humans recognize the objects in the tile map image, while the computer only recognizes the relationship between the tiles. We therefore split the functionality up into these two command line programs to give the user the opportunity to adjust the unique tile image before creating a Tile Map XML-file.

Example Usage


The above picture was created from the tile map image JansHouse.png by typing python Image2Map 8 8 JansHouse.png. Here the argument 8 8 corresponds to the 8 x 8-tile size. After this, a Tile Map XML-file can be created by typing python MapWriter.py 8 8 JansHouse.png JansHouse-Tileset.png. Of course, you need to have Python installed for this to work at all, and you additionally need the python-networkx package (in Ubuntu/Debian, type sudo apt-get install python-networkx).

If you have Sun Java Webstart installed, the resulting file JansHouse.tmx can then be opened by going to Tiled's Website and clicking on "Start Now!". Alternatively, if you have a Java Virtual Machine installed, downloading Tiled 0.6.1 and running it with java -jar tiled.jar should do the job.

Labels: ,

36 Comments:

At 9:22 AM, Anonymous Anonymous said...

I got this error when run Image2Map.py:

File "Image2Map.py", line 188, in graphFromList
self.G = networkx.XDiGraph(selfloops = False, multiedges = True)
AttributeError: 'module' object has no attribute 'XDiGraph'

 
At 1:05 AM, Blogger konsumer said...

yeh, I get the same error. Looks like networkx API changed. Shame, this looks really cool.

 
At 9:44 AM, Blogger Michael said...

Hi, just read your blog because I'm also trying to remake an old game. My concern is with the rights of those titles. Let's assume I finish it, I wouldn't want to be the only one playing it, but if I "publish" it, even for free I could be sued, right? Did you think about this? I was thinking on contacting the company that did this, but of course they don't exist anymore and have been bought several times. I guess that the big Games Company that now ownes the rights, don't care about me. Any suggestions?

 
At 10:35 AM, Blogger Georg Muntingh said...

@konsumer: I seem to have skipped over your comment, but I updated the script some time ago to solve this problem.

@Michael: I am not a lawyer, but as far as I know you can indeed be sued (in some countries). In practice, it seems to depend on how old the game is, whether it is part of an active franchise, etc. Nobody will sue you for remaking Pacman or Tetris, for instance, but there have been fantastic fan projects that have received Cease and Desist letters and needed to stop developing, most notoriously Chrono Trigger: Resurrection.

 
At 11:54 PM, Blogger MJ said...

Hi,
I'm traying to run the .py scripts but I'm having problems. I have Python v3.3.1 and networkx 1.7 on windows 7. When I want to run using this command: python Image2Map.py 88 JansHouse.png I always have the following error:
File "Image2Map.py", line 19
print "Opening the map image file: " + file
^
SyntaxError: invalid syntax


Well, I tried to solve that replacing the print by the print() method (using the parenthesis, for example -> print("Opening the map image file:) ) but when I do this, I get other error with the identation of the if sentences..

You know, I'm not familiarized with python, but I wanted to use your scripts to generate some tilesets...

Please, if you can help me with that I will appreciate it so much.

Thank you so much in advanced.

Regards,
MJ

 
At 11:54 PM, Blogger MJ said...

I hope you can help me. Thanks!

 
At 10:57 AM, Blogger Georg Muntingh said...

Hi MJ,

Your Python version, which part of the Python 3000 series, is unfortunately not backwardscompatible with the version (e.g. 2.7) these scripts were written for. This might be the reason for your error.

 
At 4:04 PM, Blogger MJ said...

Oh well... So I think I should install a previous python version. I wonder what version of Python and Networkx should work?

I appreciate your help.

Thanks!

MJ

 
At 5:57 PM, Blogger Georg Muntingh said...

A recent version of Networkx and of (the classic) Python should work.

 
At 6:44 PM, Blogger MJ said...

Yeah! It finally worked in a winxp environment using Python v2.7.4 and networkx v0.36. Just an important note: I needed to install the PIL library, otherwise it won't work; you can find that library here: http://www.pythonware.com/products/pil/

Thanks a lot!

MJ

 
At 6:50 PM, Blogger Georg Muntingh said...

MJ, that's great. And thanks for reminding me that the Python Imaging Library also needs to be installed. I had completely forgotten to mention that.

Good luck with your project!

 
At 11:00 AM, Blogger Alex said...

This comment has been removed by the author.

 
At 11:01 AM, Blogger Alex said...

I updated the script to work with the latest version of networkx. View here:

Generate Map Tiles From Image

 
At 11:14 AM, Blogger Georg Muntingh said...

Great, thanks!

 
At 7:25 AM, Blogger keerthisuresh said...


I think it's awesome someone is finally taking notice of our vet's and doing something to help them. I hope all goes well with these articles. More new information i will get after refer that post.

Salesforce Training in Chennai

 
At 3:29 PM, Blogger Suseela Susiee said...


Great and useful article. Creating content regularly is very tough. Your points are motivated me to move on.


SEO Company in Chennai

 
At 12:06 PM, Blogger deeksha said...

wow great,nowadays this type of blog is more important and informative technology,it was more impressive to read ,which helps to design more in effective ways.


Salesforce Training in Chennai Adyar

 
At 10:45 AM, Blogger Shalini said...

Thank you for your post. This was really an appreciating one. You done a good job. Keep on blogging like this unique information with us.

Email Marketing Chennai

 
At 11:01 AM, Blogger Abiya Carol said...

This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.

Branding Services in Chennai

 
At 2:04 PM, Blogger Aashi siva said...

I simply want to say I’m very new to blogs and actually loved you’re blog site. Almost certainly I’m going to bookmark your blog post . You absolutely come with great well written articles. Thanks a lot for sharing your blog.

Online Training in Chennai

 
At 3:05 PM, Blogger kanchana said...

Truely a very good article on how to handle the future technology. After reading your post,thanks for taking the time to discuss this, I feel happy about and I love learning more about this topic. keep sharing your information regularly for my future reference. This content creates a new hope and inspiration with in me. Thanks for sharing article like this. The way you have stated everything above is quite awesome. Keep blogging like this. Thanks.
Hadoop training in Chennai

 
At 3:08 PM, Blogger Geetha said...

Provides great information about all the concepts. one of the important concept which helps the person to gain knowledge about technical things
android Training in Chennai

 
At 3:27 PM, Blogger raphael said...

Here i had read the content you had posted. It is much interesting so please keep update like this.

SEO Training in Chennai

 
At 12:43 PM, Blogger Maani kamili said...

Someone essentially lend a hand to make severely posts I would state. That is the very first time I frequented your website page and thus far? I surprised with the analysis you made to create this particular submit incredible. Fantastic job!
Digital marketing course in Chennai

 
At 3:35 PM, Blogger Aasha said...

Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving..

App Store Optimization Services in Chennai

 
At 3:02 PM, Blogger Rekhila said...

There are lots of information about latest technology and how to get trained in them, like this have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies. By the way you are running a great blog. Thanks for sharing this.
Hadoop training in Chennai

 
At 3:02 PM, Blogger Rekhila said...

There are lots of information about latest technology and how to get trained in them, like this have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies. By the way you are running a great blog. Thanks for sharing this.
Hadoop training in Chennai

 
At 11:30 AM, Blogger rek Pk said...

Thank you for the fresh content and information you provide. This really helps learner like me. Keep sharing knowledge. Happy to read.
SEO training in Chennai

 
At 9:34 AM, Blogger Maha Ravi said...

thanks for shared wonderful information of giving best information.its more useful and more helpful. great doing keep sharing
Sharepoint Training in Chennai

 
At 2:39 PM, Blogger Geetha said...

Great information shared in this blog. Helps in gaining concepts about new information and concepts.Awsome information provided.Very useful for the beginners.
SEO training in Chennai

 
At 2:42 PM, Blogger Geetha said...

Great information shared in this blog. Helps in gaining concepts about new information and concepts.Awsome information provided.Very useful for the beginners.
SEO training in Chennai

 
At 3:00 PM, Blogger kalai said...

Great information,i like this kind of blog information really very nice and more new skills to develop after reading that post.


Best Dot Net Training Institutes in Chennai

 
At 8:50 AM, Blogger deeksha said...

I think this is interesting articles and Business ethics for new information's, and i like that kind of information.So the i like that post,because all of given information was very excellent.

Best Android Training Institute in Chennai

 
At 1:35 PM, Blogger kalai said...

wow great,nowadays this type of blog id more important and informative technology,it was more impressive to read ,which helps to design more in effective ways

Dot Net training in chennai

 
At 8:41 AM, Blogger Jeffy said...

Thank you for sharing such a nice and interesting blog with us. I have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle. please keep on updates. hope it might be much useful for us. keep on updating...
seo company in chennai
Digital Marketing company in chennai

 
At 8:42 AM, Blogger Jeffy said...

Thank you for sharing such a nice and interesting blog with us. I have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle. please keep on updates. hope it might be much useful for us. keep on updating...
seo company in chennai
Digital Marketing company in chennai

 

Post a Comment

<< Home