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.


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.

Made with Haxe + OpenFL + Away3D.

Published 73 days ago
TagsCity Builder, mfcg, Procedural Generation, PROCJAM


Log in with your account to leave a comment.

(Edited 1 time)

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.

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. 

(Edited 1 time)

I love both the 2D and 3D maps! Is there any way to save a generated map so that you can come back to the village/town/city later on? Also, I noticed that the 3D generator tends to create the same size map. It doesn't like to create the large 3D image.

With the version of the generator you can copy an url to build exactly the same city later, given that you don't change layout settings. For example this will produce a small town with a river coming across it (river=on, coast=off, castle=on, walls=on).

Toy Town contains a limited version of the generator, which doesn't support url parameters (and it wouldn't work on anyway). And yes, it always builds medium-sized towns (12-23 districts), because the renderer is to slow for large ones.

Looks neat!

Cities are very similar though..

I think there are 2 main reasons for that: lack of terrain elevation and simplistic buildings. I'm not planning to address the latter right now, but the former will be the main focus of the further development.

Do you think you could include an option for people to use their own buildings that they make themselves instead of using the default buildings you provide?

Currently I don't see a way to do this, because I can't use a regular 3d-model, I need something that can be "intelligently" scaled to fit an arbitrary rectangle.

I remember this was one of my first thoughts upon seeing your generator; it would be so cool to generate 3D procedural medieval towns and then use it for roguelike gameplay or something. Love it!

Yeah, now I'm thinking about making a city-based rpg or something :)

Can you add some forests/trees which would be also generated randomly to make the towns look more alive?

You can enable (pretty ugly) trees by hitting "F".

This is super cool and as you said when working on the other generator 3d looks good!, Next thing to takle however is potensial elevation changes?


Totally looking forward to it!


This is amazing!

Put this and MFCG together, add some save function, the ability to draw rivers and walls...

...then shut up and take my money!

You could make the windows glow when selecting the night environmental opt

That would look nice, but with my current tools it's not trivial to implement. One more reason to think about switching to Unity3D


Super nice.

Would you be able to share the source code for this? Would love to leverage it but need to be able to configure how some of the random variables are structured (ie mapping of structures)

The source code of the generator itself is here.




This is cool, nice use of the city generator.


A suggestion: please generate an obj file of the city..

I would also love to have some sort of 3d file for importing into Blender or whatever. Maybe some industry standard like DWG? I would also be willing to contribute on development efforts. Let me know if this is something you want to pursue.


DWG sounds good too!


I agree 100%.