Toy Town is a 3d-visualizer* for Medieval Fantasy City Generator.  One day it may become a separate native application or a part of the generator itself, or both.

*锔忊儯That's not entirely correct. Toy Town includes its own generator, which is actually a pretty old version of MFCG. If you want to see a 3D model of a particular city generated in MFCG, please use a moder modern City Viewer.


For me it works in Chrome, Opera and Safari on Mac and in Chrome and Edge on Windows. It works on Android and iPad, but not on iPhone (although it may be an glitch).

Press Enter to build a new city.

Camera keys:

  • 1 - Street level perspective view
  • 2 - Default perspective view
  • 3 - 45 orthogonal view (RTS view)
  • 4 - Top-down orthogonal view (map view)
  • ` - Toggle auto-rotation

First person keys:

  • W, A, S, D - Walking
  • +/- Moving up/down
  • Click and drag mouse to turn the camera. Unfortunately "mouse lock" is not implemented in OpenFL for HTML, so it's not as comfortable as it should be.

"Environmental" keys:

  • 5 - Frost
  • 6 - Desert
  • 7 - Winter fog
  • 8 - Europe
  • 9 - Night
  • 0 - Random

Other settings:

  • H - Turn on/off shadows. Shadows double the number of polygons in the scene.
  • T - Turn on/off textures (windows)
  • F - Turn on/off trees. Trees greatly reduce FPS.
  • P - Turn on/off "plots". Makes secondary streets slightly more visible.

馃憠 For development news and related stuff please check a dedicated reddit community.

Made with Haxe + OpenFL + Away3D.

Rated 4.8 out of 5 stars
(145 total ratings)
Made withOpenFL
TagsCity Builder, mfcg, Procedural Generation, PROCJAM


Log in with to leave a comment.

Viewing most recent comments 1 to 40 of 51Next pageLast page

WOA! beautiful

great tool


I've made over a dozen maps in the City Generator, how do I import them into this viewer so I can have a 3D model of my city?

To get a 3D view of a generated city you need a different application - the City Viewer:

  • Export the city as JSON
  • Drag and drop that JSON file onto the City Viewer.

That's it.

I don't have JSON files, I have PNG files.

RIP. you need the .json


c'est possible d'exporter le r茅sulta en 3d?

It's possible to do in the new version.


How do you import a city from the other Medieval City generator? I understand we can walk around a city we generatored in the other city generator.

I suggest in future perhaps adding a popup window perhaps when we press F1 or ? key in Toy Town to display the hotkeys.

I am sure you have thought about this already and has been suggested before, but I think if you combined Toy Town with Medieval City Generator into one app and put it on Steam you would get lots of sales. The high appeal would be of course being abkle to seeminglessly switch between top down and tweak a city to your liking then explore it on foot and explore would be a huge draw card.

Plus being a creative tool for D&D GM and authors who want to use it for reference for writing and literally being able to visualize what it looks like from street level for their book or text adventure. In the past i know some writers have used Minecraft to do that, visualize interior and space of a ship or whatever. 

Seriously. The ease of being able to gen a city as per Medieval Gen then instantly walk around it as per Toy Town, switch back to 2d and place a new spawn marker to explore another area. Apparently we can do that already between the two, but not very inituitative as to how to import a city into Toy Town. 

If you add some basic NPC models in basic clothing in 2-3 colours milling about, each slightly different in height, weight and maybe slightly different walking gait and pace. Maybe some props carts, barrels, trees. I dont mean to the degree you would need to in a full blown game, just enough to be a tad immersive. 

Add moving clouds that cast shadow and player can choose time of day for different sun placement etc.

Add a basic screen shot mode with a focus ring and maybe tilt-shift mode with that. 

Anyway sorry about the ramble, i initially meant to just ask how to import a map into Toy Town lol

You can't import cities into Toy Town, but you can import them into City Viewer.

How do you import a city from the other Medieval City generator?

Click "Export" in MFCG, then choose "JSON" from the menu. The city will be saved as a JSON-file on your computer. You need to drag and drop that file onto the City Viewer. Yeah, I know it's neither convenient, nor intuitive, but it's versatile and this way I can avoid spending disproportionately much time on UI. Most likely this will change in the future.

I think if you combined Toy Town with Medieval City Generator into one app and put it on Steam you would get lots of sales.

I agree, that it would be nice to have Toy Town as an in-built 3D mode right in MFCG to skip the whole import-export thing. That's what I planned long ago when the original Toy Town was created and I still intend to do so. But right now both MFCG and City Viewer are under active development, so at this moment it's easier for me to support them as separate programs. Another benefit of having City Viewer independent is that I can try to import villages from Village Generator.

If you add some basic NPC models... Maybe some props carts, barrels, trees... Add moving clouds that cast shadow... Add a basic screen shot mode with a focus ring and maybe tilt-shift mode with that...

As much as I'd like to play with such niceties, I guess it would be a waste of time from the users' point of view. 3D stuff is not exactly my thing and every small feature takes long time for me to implement. Actually, when I added JSON export I hoped that someone else would try making something like you described.


Sorry for my late reply. Thanks for the instructions. :)


I just install this and it looks awesome especially the night view. Is there a way to reduce the how numbers? (no matter how many times i hit "Enter" I always got a bit too many houses).

No, sorry. But soon a new (and separate) version will be released, which will be able to import maps from MFCG with any parameters you need:


Thank you for getting back to me so fast, I'm sorry that I was not able to reply sooner. I'm looking forward to the new version shown on that link and also to start supporting your products because they are so amazing !!!


Hey! this is without a doubt very useful and you seem to be still active! Nice. Do you have an ETA on when or how we can save these files? Also, a suggestion, could you also add elevation to the mix. Stairs up and down, terraces, etc. This would add another layer of depth into it. Gardens and parks and various small landmarks. I want to use this generator as a reference for building large scale fantasy cities in Minecraft and various other building games like Dragon Quest Builders. The terrain and layout really elevate a town/city to new heights. Instead of side by side in plots, winding alleys and looping streets, uphill fancy districts, slums, docks, etc. Really bring a city to life yet most people don't know how to plan it all out. If this project of yours reaches that level, no doubt DND map makers, game builders, writers, and various other people from different corners of the internet will flock to this generator.

Good luck, I'll be checking in once every few months. Hope you make progress!


I'm sorry to tell you this, but while I'm still active, this project is not :) It was created for a jam as a proof of concept. I have updated it a couple of times, but 3D is not really my thing. I was going to make a new 3D visualizer, because this one falls too far behind MFCG, and to add some improvements, but I doubt it will as beautiful as you described.


Hello! All of your projects at Itch don't work for some reason (at least for me). My browser shows: "Connection reset". Is it my fault and what can I do to fix it?


No idea to be honest. Could you make a screenshot of it?


Is there a way to save the map or export it?

Nope, sorry


it would be great if this can be export as a unity scene

If only I knew anything about unity :)


Basically, if it can export to any standard 3D format - .obj, .fbx or whatever - then Unity will be able to import it.

Export to some 3D format is on my todo list for MFCG, but its priority is pretty low, to be honest. I'm going to remake Toy Town at some point in the future (maybe as a part of MFCG) - then I'll get back to this.


Loving this so I donated a buck, if I would wish for one thing it is that the movement was improved(and added to those views that don't have it.)
As it is, you can move forward and backwards and you can strafe (to use FPS terms) but you can only turn the camera with the mouse (as far as I can tell) and the mouse doesn't lock to the game window so after a few degrees you stop turning.Loving all your proc-gen stuff by the way, it's the kind of tech that has always fascinated me.


Yeah,  it's a bug of OpenFL (the framework I use) - they don't support mouse lock on the html5 platform. Maybe they have fixed this already, I'll check it.


great program,the different random textures are perfect for my D&D,the world of Polytopia campaighn,where everything is in low-poly art


That is so cool.


Great program - any way to save as a mine craft map (LOL)




Is there a way to save a specific generation?

Nope, sorry


With both this and the City Generator, it would be great to be able to change the name of the city manually as well as make it possible to creation collections of previous made cities, making a way to go back to it, if we wanted to.


How can I load a  a map from Medieval Fantasy City Generator? This would be great.

No way to do it, sorry. Also Toy Town has a much older "generation base", so there are some features in MFCG, which are absent in Toy Town (like farms and neighborhoods).

(1 edit) (+2)

Hey, this is really great. I am curious, is this still under development? I see in the comments you were looking to merge this and your fantasy town generator. Simply having some of the same parameters to change city size/water etc would be amazing. Is that still in the works?


This is not under development as it was just a toy for a jam. But yes, I'm still planning to make it a part of MFCG someday and then it will get its share of love :)


This would be awsome as part as MFCG.  What can we do to help?


Looking forward to it getting some love ;)

Any plans on when it will be?


Actually I'm planning to revisit this code really soon to check some ideas. It doesn't necessarily mean Toy Town will be updated, but who knows...

how to change the size of the city, or anything for that matter?

Unlike in MFCG here you can't change city parameters, it's only possible to change visualization parameters.


How exciting!

How Can I rec when I'm walking on the city? 



How can I save the maps??


Damn, this is splendid. Can't wait to see it fully working alongside Medieval Fantasy City Generator


I was hoping he would answer why it don't work.  This author cannot answer bugs. So I hope he's not looking at selling this!

Full image its not working. 


How do you put the medieval fantasy city generator city's in toy town

I really like to know that too.

There is no way to do it, sorry.


Your work is amazing!

This works, however Medieval Fantasy City Generator doesn't


How exactly it doesn't work? Blank "screen"? 


Exporting this as a 3D file would be terrific, you could add these cities to 3D printed terrain.

How do I get a copy of this?


How can I export my maps from medieval fantasy city generator to here (toy town)?


Currently there is no way to do it. Later Toy Town will become a part of MFCG and it will be possible just to switch view modes - Map/3D.


Any updates on a schedule for this implementation? I'm also hugely impressed by the integration of FMCG with Azgaar's FMG, some great work!

Hello, I am great fan of you great tools to make fantasy city maps. Is there a way how to make these 3D look of city previusly generated with medieval fantasy city generator. I mean thah I will have the map of this city, and also ths beautiful 3D images? Thank you very much for reply.


I'm planning to merge Toy Town and MFCG at some point in future (probably soon) so it will be possible to toggle map view/3d view, but for now there is no way to do it, sorry.


This is neat. Would it be alright to use some screenshots for a text adventure game? 

I think with more features; and more building types etc you could make something worth charging for.  This would appeal to those who make text adventure games and wants nice looking city maps, D&D tabletop players who wants whip up something for a homebrew game etc. Writers who want to visualize their cities and towns etc. 

Some more suggestions:

1# Export options > PNG, Gif, PDF (maybe last one would be tricky to implement?)

2# Overlay options? More for top down view > Square grid and Hex Grid this could be useful for D&D table top games.

3# Polygon Stickmen like population? Toggled off and On. Some will be still and others moving in groups or/and individually, probably suit a smaller city. Topdown view could just be dots. If Exporting is in and GIF format is one of the options; it would be cool if you had polygon stickmen that you could generate a 15sec gif of them moving about. 

4# More zones; like farmland type zones that could have wavey lines and straight line squares as fields. 

5# Rivers

6# Walk speed slider or when at street level moving cam around will be at walking speed, unless you hold LShift to make it feel like you are walking around rather than zooming around too fast. A toggle key could switch back to normal cam speed if desired.

7# In light of my initial suggestion of making a commerical product with this to help fund to get in more features, i can see a continent option where one is generated. To save on CPU resources rendering a continent in 3d why not make the continent world map 2d.  And then you can place upon it city maps the Toy Town generated in RTS form upon it. This could be a 3d image that is placed on the map, when the user double clicks on this on the world map the 3d town version loads in.   

You could have a side panel that pops out with the list of placed towns so you can jump to them- the camera will fly across 2d world map to it and then load it.  So in short the world map cannot be walked on or viewed in first person. But the cities made as per normal can. The world map just gives a means to visualise where the cities and towns are in relation to one another.  

Also there could be clipart like images that can be placed on the world map (custom import option to) such as icons to depict types of terrain, mountains, forests etc. 


That's a lot of suggestions :) There are some other ideas I'm considering (link), but rivers are already implemented.

(1 edit) (+1)

This is awesome. Nice procedural generation.

I think that it would be cool if your work was implemented in Unreal Engine's blueprint (visual scripting). I also think the map created by the medieval fantasy city generator can be modeled using modular medieval village packs in a procedural way(like toy town). It would be best if you could walk around the town with HTC vive! Unfortunately, I do not know much about procedural generation(perlin noise is everything i know). So, if you can, can you give me some advice on what to learn to make this wonderful work? I really want to move your nice generator to the Unreal Engine.

Here is the source code of the generator itself:

and my very old comment about how it all works:

The only special pcg-related thing there is Voronoi diagram, which I think now is not really necessary. So it's mostly generic geometric stuff and random numbers :)


Is there a way to export the 3D model to sketchup? I would loved to make some renderings


Not yet, but probably I will add it later (because I'd like to try it too :))



This would be awesome to have as a tool for the Unity 3D game engine. How difficult would it be to do that?

Ah, I see! I've just answered "kind of no" to your question about using non-default buildings, but in the context of Unity 3D it is possible I guess.  Unfortunately my knowledge of the engine is virtually zero...


There are a bunch of courses on Udemy, any one of which could teach you what you need to know.




This is really amazing, and has incredible potential for TRPG expansion (labeling houses, etc.) - very cool!


This is so awesome! How do we save and load a Seed? I plan to use it to procedurally generate locations for when running TRPGs. 
Planning to use Libreoffice Calc to save the screenshots so I can hyperlink descriptions with cell references. I'd like to know whats your plans regarding the city builder. 

Thank you. Right now there is no way to run this thing with a specific seed. Later when it is merged with MFCG, it will be possible to do it similarly - using the seed parameter in url.


Thanks! That is awesome! looking forward to it!



This is so great. 

Viewing most recent comments 1 to 40 of 51Next pageLast page