Hello everybody! Playing Terraria I always kept wondering about how the maps actually are generated and as time passed I decided to take a closer look at the code (which classifies as fair use). I was surprised when I found that there was merely a single class handling all the generation and this class is still used at runtime to represent the world. It all seemed rather messy to me. Of course it is hard to tell whether a piece of code is understandable or not when you do not have the sources yourself - but in this particular case the code itself seems to be okay, the structure on the other hand is not (IMHO it is not only the WorldGen class but the whole game, e.g. having a single item class to represent all kinds of items, using lots of string comparisons to find the right item, lots of special cases [e.g. tree tops] spread all over the rendering code etc.). Nonetheless, I really like the game and so I asked myself what might be the reason for this coding style and I remembered having read that Red used to develop Flash games which usually are somewhat simpler and smaller than projects such as Terraria. Simpler projects normally work perfectly well even if their internal structure is messy; it is the natural product of growing software (instead of constructing it which is not necessary for smaller projects). Another reason, I thought, could be that it is simply impossible to write a proper map generator without throwing it all together into a single class. Please do not get my wrong, I am not trying to 'bash' Red or anything, Terraria is a great game which I really enjoy. I am offering constructive criticism. @Red: If you need someone to do a code-review do not hesitate to ask, there are lots of people out there willing to help you (for free!) . However, I felt I needed to prove that it is possible to do it properly and started a custom map generator. It is not completely finished (far from finished!) yet but until now it worked out rather well. I'm not currently feeling motivated to continue this project which is why I decided to release my current version in order to get some feedback - and maybe a reason to continue this project. I'd like to point out that I have read the forum rules and I do not see how such a project could possibly violate them. Reading the forums it seemed to me that even talking about custom map tools is a no-no but they actually don't break any of the rules: Custom map generators are not hacks as hacks normally intend to provide an unfair advantage in multiplayer games which map generators frankly do not; they do not classify as custom clients either as they are completely separate from the client and provide no way of connecting to servers. Finally, they are not mods as they do not modify content from the game, they merely create new 'input' for the game. If you feel that this thread conflicts with the forum rules, feel free to report it. Why would anyone use a custom map generator?, you might ask. Terraria already has an inbuilt map generator which creates great worlds. Yes, it does, and I never complaint about the worlds generated by the game's world generator. But custom map generators have some advantages as well: In my case the main advantage is that the user can change a lot of parameters to create a map which is suited to his needs and likings. The map generator itself also is easily expandable which allows for the addition of new content which is not present in the standard Terraria worlds. There is a disadvantage though: My map generator currently only generates surfaces. Depending on the feedback I get I will either continue the project or head off to do something else. The world is created by combining chunks of terrain which are randomized to some extent. You can control various parameters allowing you to create very different worlds: These three worlds have all been created using the tool; the first has a lot of cliffs (which doesn't actually look good or realistic but still somebody out there might like it) while the second features steep mountains and plateaus. The third picture shows a mixed map with different kind of features (though it is rather plain). You can change the generator's behavior via map definition files which are in XML-format. These files allow you to change aspects such as resource deposit placement, terrain generation and zone placement (currently only very basic work has been done on Jungle and Desert). You can download an early version of the generator here. The download includes a commented map definition file. If the generator should crash, you can always take a look into the logfile (log.txt in the same directory as the generator). The generator itself should be self-explanatory. Regards, -cope.