[AddOn]Tile Based Landscape/Cityscape Generator (Steering, Birds, UFOs and more!)

Here are some more preliminary test for a layer based system as tin2tin suggested above. By breaking major element types out into their own layer it becomes possible to use previously generated layers as masks for roads and rivers.

By generating water first, roads can then avoid it.


Here are rivers avoiding grass.


When rivers are super imposed over water they become water.


I have added a 0.0-1.0 float area control for both grass and water. This is the overall coverage that each feature can have on the grid. Each layer type has it’s own grid such as roads, rivers, canals, grass, water etc… The layers are stacked on top of one another.

In this scene grass area is set to 1.0 (maximum value) and water is set lower. The grass is added to the master tile grid first. Then the water is added on top of grass and then the roads on top of water and grass. In this image series, as the water area is decreased the roads gain more area and grow into the previously unavailable space.


And now when I add all the layers together the grass area does indeed control the number of houses generated. A low grass area makes more houses. A high grass area makes less houses.

Here is a shot with the canals integrated back into the mix. They have been revised to work like the rivers and roads and now have their own layer and branch rate.


In this image the canal_branch_rate is set very low to produce only vertical or horizontal canals while the road_branch_rate is set very high to produce curvy roads.


Thanks for spending your time on developing this. It is really fascinating to follow your steps.

So now you’ve made a golfing estate! Lots of water hazards.

I was having the same idea :slight_smile:

I have revised the Tile Proc AddOn and made a major update to how it works. It now supports layers on top of the original Tile Proc 1 generation. Each layer can be turned on or off as needed. You can download the new Tile Proc 2 AddOn from post #1. Overwrite the original version. Each layer has it’s own random seed to you can shuffle various elements “underneath” a current generation.

You must use the new BLEND (provided in ZIP download) with the new Tile Proc 2 AddOn
, there are new tiles to support new features such as drivable roads and wandering rivers. You should experience less dead end roads and rivers in general.



Hi All,

I have been working on a way to re-introduce some of the “high roads” tiles that got set aside in the new roads as maze feature. The first draft of maze roads left all road elements on the ground. I am going down the path of using the solution for the maze road map as the construction grid for high road elements. High road elements are simply road pieces that are elevated either via a hill, canal or bridge.

Here is the ASCII representation of the initial road map maze and it’s solution.


And here is the resulting output.


This solution has required me to make a few more connection tiles not available in the original set.

Attachments


I have added three more layers to the system to support plants. The layers are named Trees, Bushes, Flowers although you can assign any mesh you like to each of these layers. The distribution method is similar to pick randomly from group in the standard particle system. To support the new layers three new tile connection types were added too.

House and Rivers are avoided automatically by this first draft code. You can also use a map to control where the plants appear.

Here are some shots with trees, bushes and flowers using the inverted road map for their area. The roads determine where the plants can not grow.




Oh wow.
I never saw my assets generate such cool landscapes… I mean I imagined it. I build build the separate tiles. but never really build one my self… to much work :slight_smile:
But this Atom, is amazing. a great great improvement on the first version.
I will reserve some time to improve on the assets just to see the script make it more awesome :slight_smile: I think a couple of more houses… and finally my other city assets.
As you requested I will try to make the missing tiles look good.

I have an idea though.
Could it be possible to make a layer that makes the road parts drivable. by that I mean that a pathfinding script could navigate the map so car can drive on it.
And… is there a way to “finalize” the map to be able to export it to say… unity with all layer applied.
I think that you made yourself a good mapeditor then :slight_smile:

Implementing cars as a layer does make sense to me.

by that I mean that a pathfinding script could navigate the map so car can drive on it
I think I can re-prupose the high-roads maze solver for this. Basically each car would traverse the maze (i.e. road map) from a random start point to a random end point. The maze solver would return a path for the car to follow. In a practical sense, this would probably just make a curve that can be used by any object. So multiple cars could follow a single path.

And… is there a way to “finalize” the map to be able to export it to say… unity with all layer applied.
This has been in the back of my mind as well. Today I added in a few parameters, looking ahead, to support not only all tiles as single mesh but also including modifiers that are applied to source tiles (most typically might be sub-surf) in both Preview and Render resolutions.

Attachments




cool…
It seems you’ll have a lot of updates coming soon them. I’m made some notes on tiles that are still needed after I saw you updates.
a city assets pack will complement what you are allready using. prepare yourself to make some extra layers and customizability :stuck_out_tongue:

I have had some success with using the solveMaze algorithm to produce driveable roads so I thought I’d share a sneak peak of the new layer.

Here is a preview from the 1st draft.


Vehicles is now a layer with a few parameters. You can specify vehicles count, over 12 rigs and the whole Blender interface seems to slow down a bit. Each vehicle finds it’s own way through the maze of roads. You can make the roads bumpy as well. The rig supports animated wheel rotation. Translation along the path, however, is done at the object level of the rig, using multiple Follow Path constraints which cross-fade influence between road segments. There is no translation of the Base bone at the pose level. There is no collision detection at this time and all paths run down the center of the road.

I reviewed the vehicle asset pack published by eRacoon and have included 5 vehicle types from that pack that the Vehicle layer can randomly choose from. These 5 all have the same wheel base distance. Currently only one wheel base is supported but that restriction may be lifted in future versions. Also a random color is picked from the asset pack for each new vehicle generated.



wow. cool to see all my assets being used to create awesomeness :slight_smile:

I think I am getting close to another release. There is always room for improvement, but here is an attempt at lanes and rounded curve paths for road turns. You can specify Left, Right, Center or Alternate for lane generation. What alternate does is take a look at the car count index and if it is an odd number it uses the right lane, if it is even numbered index it uses the left lane for generation of the vehicle on that layer. This does not eliminate collisions, but it certainly cuts it in half.

Here is a 7 vehicle generation with curve guides shown in the 3D viewport.


Here is a twilight scene with 32 cars on the road.



That’s very very cool! Can we use it with our own assets?
Cheers!

Very Very nice addon. this is great for making levels that I can export to other game engines. Congrats.

Thanks,

I am releasing the next version of TileProc. Pull down the tile_poc_kit-3.zip from post #1 to try out the new features.

This release includes 4 new layers. Trees, Bushes, Flowers and Vehicles. Select a layer, adjust the parameters and click Generate. There are still some minor bugs in roads such as the occasional road cliff or road curve terminators that might be off but there should be enough “good” areas within any single generation to do shot planning. Also don’t be afraid to change the random seed for each layer. You can re-generate different vehicle paths along the same roadways using this technique. A good vehicle count for a balanced scene seems to be around grid width + grid height. So an 8x8 grid could hold 16 vehicles. When you add too many vehicles to a grid lots of collisions can occur. Vehicle speed does have some built-in randomness so each vehicle will travel at a slightly different speed along its course.

There is no memory cleanup on vehicles at this time of you reduce the vehicle count. Old vehicles will be left in the scene. So that is on the todo list. But the code is smart enough to re-use existing rigs if they are detected in memory so regeneration using the same vehicle count or larger is fine.

Can we use it with our own assets?

@vitorbalbio: Sure you can. On layer 10 of the BLEND file that comes with the AddOn you will find the entire tile set used to generate the scenes. Replace any or all of those elements with your own models.

Attachments




I pulled in a cc0 street lamp from Blendswap by simonrepp and added a new layer to the system called Street Assets.

Here is a preview of street lamp lighting.


I have also added spotlights as headlights to the car rig. Any lamp object that is detected as a child of the master rig now gets duplicated into all cloned car rigs as a new object that is instancing the source datablock. This means you can edit all headlights from a single lamp source. Other lights, such as running lights or under carriage glows can be added as needed to the master rig and the clones will inherit them as well.



I have included thecc0 Blendswap Toon Tree, by rohwedder, into the Tile Proc tree layer. Now the system will randomly pick between the two tree models.

Here is a short video that shows the self driving vehicles in motion. For this shot I generated a long narrow roadway and kept the camera close to the vehicle to prevent the lack of surrounding terrain from being revealed.

Attachments


I have added another layer to the system and another scene with the supporting armature system. This time for birds. You can reference an animated armature and deploy it within a tile layer. Standard area_map controls allow you to filter where birds show up in the scene. You could restrict them to over water for instance.




The birds you see in this scene are the cc0 Crow from Blendswap by Nodelete.