Download

City Blocks - A tool to create your custom city conveniently

Hi Guys ,

Inspired from the Autodesk’s learning channel for creating City Blocks in 3ds max , as shown in the below link ,
https://www.youtube.com/playlist?list=PLnKw1txyYzRmwWJ1K7tlBSjiy42YVZ86K

I thought why not take this a level further and implement something like this within Unreal Engine. So I started working on this , and my first week was totally focussed on automating the creation of road structure. I will be preparing video demonstration in few days, but here are few screenshot to better explain how it works.

Step 1 : A simple crossroad junction is created , with all the mathematical logic for placing the meshes and splines at correct location totally written in C++

Capture.JPG

Step 2 : You can place the junction at any location and increase the width and height as you wish.

Capture.JPG

Step 3 : Create other junctions as well. Do not try to place the junctions manually!! Use the respective parameters to change the position.

Capture.JPG

In the above picture , you are duplicating the road intersection blueprint and changing horizontal position to 4750 to place it to the extreme left , and deleting the left connector to remove the extra mesh , using the “Delete Left Connector” parameter

Step 4 : Duplicate this junction 4 times , each with 90 degree rotation , to place them at the correct location from the axis.
Capture.JPG

Step 5 : Create junctions at the extreme corners , this time deleting two unwanted meshes from two sides

Capture.JPG

Step 6 : You can change the default texture of the mesh at any section of the road , as shown below :

32b23d2cbe0f2fe4889f641e6969681990353579.jpeg

Create varieties of textures in Photoshop, according to your project requirement.
If you feel like the texture is in the wrong direction , you can rotate each road mesh , as shown below :

b4109e2b0c42a726de181d87aebcf5d776b6f431.jpeg

By default the four meshes at four end will have 0 , 90 , 180 and 270 rotation respectively , for usual alignment.

Step 7 : Create connecting roads by dragging the road placeholder at each side.

50f2d31d07f05ed35026fb03a2fabf1db2690615.jpeg

The texture tiling will adjust according to the length of the road mesh you are dragging

891d4f8cb0ff13386e94a0fcfd45dea039a86f6f.jpeg

[FONT=Arial Narrow]Step 8 : Adding extra road branches. See below

very nice cannot wait to see more!

Intersections!! Finally a way to create proper intersections, nice work man!

The spline tool is great for roads but intersections (in my experience) had to be separate meshes lined up properly in the editor, this is what I wanted instead. This is really cool, looking forward to seeing your progress with this! :slight_smile:

really interesting, good work , keep it up

Very nice! This would be great to have inside the editor. :slight_smile:

Creating Road Branches is simple as well. Just create a duplicate of the intersection , move it to your desired location , change its height and width by setting its HWidth and VWidth parameters , and extend the roads to connect to the main branch by dragging the placeholder respectively.

Capture.JPG

Capture.JPG

Capture.JPG

Forgot to add a rotation controller for the junctions :stuck_out_tongue: Will do that now.

Is that an Unreal MVP worthy contribution I see there? Quite possibly.

Thanks a lot , and all these days I was literally breaking my head trying to learn shader development in unreal engine, when I should have used my programming skills to develop several nice automation tools long time ago.

Looks really good. Can’t wait till you upload more.

Here are a couple of things I will be working on before I work on building generation and urban components creation, and will update soon , but I will highly appreciate any suggestion on these :
1> Rotating the road junctions without breaking the alignment -> this is highly convenient with something similar to Skew modifier in 3ds max , but I would like to know the logic behind that , so that I can implement similar technique for rotation along the alignment. (Simple “Yaw” adjustment is quite different from how Skew modifier works)
2>Adding pavements in single click -> While I can do this by adding additional static meshes along the spline borders, this gets highly simple with something similar to Sweep modifier in 3ds max. :frowning: unfortunately I couldn’t find how sweep modifier works.

This is brilliant, can’t wait to see more.
Good job!

Oh, c’mon now, you’re showing off!!!
Just kidding Sameek, this is awesome!!!

Are you snapping vertex on the terrain? I’m thinking about slopes and the possibility to shrink-wrap the road to the terrain, so it’ll follow the slope, but I guess you should do a proportional calculation of the lenght of the road and the angle of the terrain in order to set the subdivision on the road itself, so basically the higher the slope > more subdivision every “n” lenght ( hope its clear )
I guess you could apply the same principle to rotate the junction, means that the more you rotate the junction the more accurate the curve from the junction will be ( so it’ll keep the alignment ).

I guess ( don’t know how complicated will be with C++ ) but using a spline as a guide will allows you to have a better control on the overall road…but this will require to rebuild everything…or you could set the spline as a “proxy” guide for the road to follow

Anyway brilliant concept!

Hi ,

Thanks for the feedback :smiley: Currently I am not thinking about the slope and keeping it flat, as this is urban development , I believe I will concentrate on the slope later if possible. And also I am trying to keep this 100% C++ and no blueprint , so it just got incredibly difficult but is also keeping my interest, as blueprint is a bit difficult to debug for me , with so many nodes. yesterday I recreated everything in C++. Regarding the rotation , when I do rotate the junction , few vertices of the part of the junction which do not rotate, also have to rotate , for proper alignment.
And these are the following things I will work on , before going to the slope :
1>Currently creating road branches is a bit manual and takes at least an hour to create huge road infrastructure , but I will automate them, keeping two seperate C++ classes , one for intersection with adding branches functionality, and the other one will be a combination of several such intersections , so that you dont have to worry duplicating many instances of the class. the last picture I posted is a combination of 15-20 blueprints :smiley: , I will reduce that to single class.

2>Setting up the pavement area( i just need the sweep modifier here to lesson up this effort :()
3>Adding mesh between the roads , for grasses , dirts , whatever you like to put (don’t worry , also a C++ implementation , not manual)
4>Adding Plots using spline as guide line for buildings
5>Adding buildings. Just drag the placeholder upwards , set the number of floors , the building will follow the guide line of the spline for the base structure.
6>Options for Low poly and high poly building. In low poly versions , the doors and windows will be made of textures mostly , but high poly will have real doors and windows (I just love playing Sims gives me lots of construction ideas :D)
7>Ranodmizing the building creation , so the creation of guiding spline and the buildings will be handled in the C++ code , and in this case , you may avoid creating buildings one by one, and set the constraint parameters instead.
8> Creating urban elements ->stop signal , traffic like , Bus-Stop , benches , lightposts , those kind of things.
9>Populate the city with people and vehicles :smiley: -> Not possible with my current skill , but would like to research on that

Awesome work -As someone who has modeled a number of roads, I can truly appreciate this innovation.

Thank you all for the positive feedbacks on this. I will be providing further updates by the end of this week.

Added Sidewalk parameter for each section of the road , and we now have spline component placed at every section , to drag and extend the road branches at your will.

64b4cb75fac53e4d320c03de5413da8ccf0a1213.jpeg

4e2cacdd27b662b57c7ffbbd11978f72d3063318.jpeg

This is just what I’ve always wanted. A lot of assets on the store charge crazy prices, but this is something that truly deserves it. If this thing can do curved roads at varying heights and lay flush with the terrain, I am so in. Keep up the great work, Sameek!

The roads do bend in all directions, but I am yet to figure out how to bend the sidewalks, as the sidewalks are made procedurally, and not some physical assets. But I am working on it. Thanks a lot for your feedback.

Please do. This is something I sorely need and very much want to see come to fruition. I’ve been using Autodesk infraworks 360 for my roads and the situation is less than ideal. If I can contribute to your continued progress, please show me the donation link!

Can’t wait to get my hands on it (if you planned to release it in the future). Very useful tool I could need for my current project! Keep on the great work. :slight_smile:

best regards