Free procedural building generator: Building Generator v.01


#321

Hey, the diffuse color for all the buildings will be the same if you use the default settings. Of course, with the new material settings rollout in version .52 you can change the diffuse color to whatever you like.

As for textures, once you assign groups of textures to matID channels, it should choose a texture randomly from the list if there’s more than 1 to choose from. I just tried it and it seems to be working fine.

Note: new materials are always put in the material editor slot #1. So, if you use the “generate material” button, make sure you copy your new material into another slot before hitting “generate material” again.


#322

Sooo…I’m working on a new aspect of the generation system…right now you can only generate along paths…but I’m going to make it so that you can generate along surfaces too :slight_smile:

The most difficult part so far (for me at least, probably not for a more math-saavy scripter)…has been aligning buildings to face normals regardless of object orientation. Also, getting the object to scale to the width/length of the face, even if the width/length are not the same.

Originally I thought I was going to just use the square root of the face area, but that doesn’t work if the face is oblong (which they usually are). So I wrote some conditions that test for the width/length of the distance between edges on the face…then corresponded those distances to the face/width length, and matched up the width/length of the building generated to the width/length values calculated for each face,

Once this is implemented into the next release, there will be options to do things like constrain proportions of buildings to keep the width/height ratio the same while still matching the building up to the face size…scale buildings down once they’re matched up to faces (so that they won’t all touch each other when they’re scattered on parallel faces)…and options to scatter over the whole surface, or just selected faces.

When this is implemented, Building Generator is going to be like Greeble on crack. Plus…with the new preset manager, making a whole city will take literally seconds. Imagine…just load in a dozen preset files, click your surface…set the generator to create buildings based on a random selection of the presets…his generate, and voila…you’ve got a whole randomized city made with like 5 mouse clicks. Of course, you won’t need to use presets to use the surface generation feature, but that would speed things up a hell of a lot.

Here is an example image to show some tests I did with the surface generation settings:


#323

That is it. I refuse to be impressed anymore… :slight_smile:


#324

THAT’S SO INCREDIBLY AMAZING!!! :bowdown:

Thank you so much for this awesome piece of life-saving software!!!

Just a little suggestion btw.: in real life houses are built in a vertical order (at least very often). Regardless of the ground orientation. So it would be great if there could be an option to change the buildings orientation from “along surface normal” to “along world ‘z’ direction”.


#325

Here’s a test I did, with 4 building-types scattered over a sphere using the surface-generation feature. Imagine how it would look with 20-30 different buildings, amongst streets and roads :smiley: Btw…this has about 3100 buildings total, bringing the total poly count up to 530 million polys (the buildings have quite a lot of the details enabled, even though you can’t see them from this distance). I used Vray proxies so the render took about 10 minutes. There’s also some tiling in the flat roof textures because I didn’t bother adjusting any of the texture settings.

Notice how none of the buildings overlap each other, and each one fits exactly to the face it’s sitting on (even though you can’t see the faces, you can tell where they are). This has an advantage over scattering buildings with pflow, because by default pflow can’t scale particles to match the face they’re sitting on…so you’d have to script that manually.

As I said in my last post, I’m setting it up so that you can have buildings scatter only over selected faces, but I’m also going to add a “scatter by texture” option that’ll allow you to defined building placement using a texture map :slight_smile:

Balu: Yep, there will definitely be options to maintain a world_z lookup :slight_smile: As well as other options like flip z_axis, type-in scale, etc.


#326

One option for the City Generating ;). (Maybe you’re doing his anyway, but I figured I could ask)

Is it possible to make the height of the buildings dependent of a grayscale map on the distribution object? With a user defined jitter?

It would be really easy to create a quite realistic city, for example by just using a radial gradient for the distribution map. You can of course also do this by varying the Face-size in the distribution mesh, but a grayscale map would be much easier…at least or the user ;).


#327

That is a GREAT idea. Especially since I was wondering how I’d implement the “conform height to surface” option with surface generation. It’s easy with path generation because paths are flat…but surfaces can be round, or concave, etc…your suggestion will make it easy :smiley:


#328

Hi Tyson,

you probably already know this, but you can get quite good building distribution surfaces if you use the quadify modifier on a closed editable spline shape.

There have been a couple of greeble threads where they used this, and the quads it generates look quite city like…

Cheers

Steve


#329

Thanks for the reply ivanisavich. I ran your script and i get no errors and a magical teapot appears.

In answer to your other question i am using max 9 currently. I dont believe i have any conflicting plugins but im not 100% sure of that. It tends to happen when i generate a preview of something. I get the error pop up then a red box appears next to the preview button and basically locks me out from using it again.


#330

Hmmm…not sure what’s causing this. I have max 8 on my other machine so I’ll see what I can do to test and fix it.

My first question, is does max 9 have probooleans built in? There’s a ton of boolean operations that the script makes use of…and they’re all meant to use probooleans. That being said, I did make the boolean functions backwards compatible, so that if a version of max doesn’t have probooleans, it’ll use regular booleans…but I wonder if that’s messing things up since regular booleans are awful.

I can’t work on the script anymore today…but I’ll try to test this tommorow.


#331

The face generation is going to be fantastic. I can’t wait. Great demo images too Tyson. Also, great pick up by balu, because yep, most buildings are built vertical, despite how undulating the land is. Still, for cartoon type cities (with some skin mesh deforming) you’ll have near instant ‘dancing’ buildings. I’m seeing this plugin in music videos already.

Combine the ‘build on selected faces’ function with the new Graphite modelling and selection tools (and the speed they add) and you’ll have buildings laid out on a city grid with roads in between before you know it!


#332

bejeez us…

are we talking about a new scatter system. here…wow… imagine scattering other procedural things… Lawd Have Mercy!

Go guy… keep Going…

davis


#333

I’ve been able to reproduce the bug in Max 8…it appears to be a maxscript bug, since the line of code that’s been executed is:

polyop.chamferedges val edgelist chamferwidth

yet the error message is regarding the chamferverts function, which isn’t being used.

I’ll see what I can do…I’ll try using a mesh operation instead of a poly operation.

-t


#334

Hey Frubes,

I did some digging and it turns out the problem is a known maxscript bug in older versions of max, when using the polyop.chamferedges function.

I replaced the instances in the script where that code was used, and now it should work for your max version. I just overwrote the download file on my server with the bug-fixed version, so you can grab the update from the same link:

http://tysonibele.com/Main/BuildingGenerator/buildingGen_v052_01.mse

Let me know if that works for you. And if anyone else was trying to use the script on max 9 or below, you should re-download the script as well!


#335
         Thanks, works great now! :)
         
         Been playing around with the script (instead of working, ha). Here are some things I wrote down:
         
         [b]Bugs/problems[/b]
         - When previewing a wall with type 2 shutters, my Max seems to freeze seven times out of ten. I haven't been able to isolate any single cause or combination of settings for this.
         - I was wondering about "missing" drain pipes and noticed they are  sometimes generated [pointing towards the same corner on different sides of the building](http://gaso.1g.fi/bg/drainpipes.jpg).
        
     [b]Feature ideas, mainly related to modeling[/b]
         - Floor selection for doors. A similar system as for walls would be optimal. In buildings on heavy slopes you might want to have a basement floor and doors on the second floor.
         - Separate ledge control for each floor.
    - New window shapes: round, semispherical
          - Negative offset for windows (for lowering). Now offset can be only positive.
    - Option to skip window generation on beveled faces or inverted corners. Useful if you have small bevels/inverts.
     - Option to create open/closed/half-open shutters at the same time. Now they're either open or closed.
      - Rounded indents for doorways
     - Custom pillar outline by drawing (like ledges now)
     - Separate pillar control for building's corners
     - [Extrusions](http://gaso.1g.fi/bg/extrusions.jpg) (rounded, square, hexagonal...) Negative extrusions might also be useful.
    - Custom roof shape by drawing (like ledges now)
   
   A long list. Thanks for the awesome work you've done so far, Tyson! This is one of the best scripts I've seen in a long time. Now back to generating citie-- uh, work, I mean...

#336

Thank you very much for the feedback, Gaso! Your comments are extremely helpful.

          [b]Bugs/problems[/b]
          - When previewing a wall with type 2 shutters, my Max seems to freeze seven times out of ten. I haven't been able to isolate any single cause or combination of settings for this.

Very odd…I’ll look into this. I found a problem yesterday regarding boolean options on shutters, but that was fixed in 52_01, which you are apparently using…so I guess that the problem you’re having is something else. Also, if you could tell me what version of max you are using that will help me isolate the problem, since the boolean operation being used by the script is different for max 8 and below.

          - I was wondering about "missing" drain pipes and noticed they are  sometimes generated [pointing towards the same corner on different sides of the building](http://gaso.1g.fi/bg/drainpipes.jpg).

This isn’t a bug :wink: The drain pipe algorithm takes the side of the wall you chose, and then randomly assigns a wall corner to have the drain pipe travel down. If you’re getting 2 drains of 2 adjacent walls travelling down the same corner, like in your pic, that just means that the same corner was chosen for both walls.

I’ll put an option in the next version to allow you to choose either left side, right side, or random.

      [b]Feature ideas, mainly related to modeling[/b]
          - Floor selection for doors. A similar system as for walls would be optimal. In buildings on heavy slopes you might want to have a basement floor and doors on the second floor.

Good idea. Will implement.

          - Separate ledge control for each floor.

Yep…this was going to be in the next version already :slight_smile:

     - New window shapes: round, semispherical

This would be tricky, since I’m using max’s built-in window types for the windows…and they have no option for spherical windows, meaning to implement this I’d have to code up my own window algorithm. Not that difficult of course, just kind of time consuming. I’ll keep this in mind for future versions, although it might not appear in the next release. The closest you can get to this now, is by turning indents on and settings indents to rounded.

           - Negative offset for windows (for lowering). Now offset can be only positive.

Good idea. Will implement.

     - Option to skip window generation on beveled faces or inverted corners. Useful if you have small bevels/inverts.

You can already do this :slight_smile: In the window layer manager, just uncheck “Bevel front/back” on the layer that is generating windows.

      - Option to create open/closed/half-open shutters at the same time. Now they're either open or closed.

I was originally going to implement this, but the problem I was having was that when they’re partially open they have the potential to intersect with covers/ledge-rails/other things…so I played it safe and just had the open/closed option.

If this is something you’d find useful though, I’ll implement it into the next version.

       - Rounded indents for doorways

Good idea…will try to implement.

      - Custom pillar outline by drawing (like ledges now)

I was definitely thinking about doing this. I was holding off on it for now but I’ll be making it a feature soon.

      - Separate pillar control for building's corners

This is a tricky one, due to the way the pillars are generated. I’ll see what I can do though.

      - [Extrusions](http://gaso.1g.fi/bg/extrusions.jpg) (rounded, square, hexagonal...) Negative extrusions might also be useful.

This might be something I can do…can’t make any promises now though since it would be difficult, with regards to the way details are currently created on walls.

     - Custom roof shape by drawing (like ledges now)

Do you mean, roof shape as in the overall perimeter of the roof? Or do you mean, the ledge contour of the roof?


#337

(Type 2 shutters crashing) Very odd…I’ll look into this. I found a problem yesterday regarding boolean options on shutters, but that was fixed in 52_01.

 I'll get back to you on this one, I'll run some additional tests.

I’ll put an option in the next version to allow you to choose either left side, right side, or random.

 Excellent... I thought it might be a feature, just wasn't sure. :)

[QUOTE]- Option to skip window generation on beveled faces or inverted corners. Useful if you have small bevels/inverts.

  You can already do this :) In the window layer manager, just uncheck "Bevel front/back" on the layer that is generating windows.[/QUOTE]
 Ah! Sorry, my bad... I kind of thought it might be possible but couldn't locate the option.

(Shutters) If this is something you’d find useful though, I’ll implement it into the next version.

Didn't think about the issue with intersecting... However, I think this might be useful for houses with a lot of shutters.

(Corner pillars)This is a tricky one, due to the way the pillars are generated. I’ll see what I can do though.

Don't know if this is very useful, though... Might be nice for some older houses. [This is what I had in mind.](http://gaso.1g.fi/bg/corner_pillars.jpg)

Do you mean, roof shape as in the overall perimeter of the roof? Or do you mean, the ledge contour of the roof?

I was thinking of drawing the shape of the roof and extruding along it. After making the picture below I realized, that the roof isn't actually shaped like this, it's just the top end of the wall. So this would actually be drawing the  outline for it... Again, I don't know if this is very useful in general, only suitable for certain types of buildings.


#338

Hi Tyson,

Just wondering if it would be possible to include:

  • a scaler feature so building height can be displayed (numerically in the UI) before creation (I don’t understand the units that are used to know if they are real world or not. I seem to have to scale for real world as a default storey is 762mm?).

  • a divide ceiling into polys option (resolution user specified) for assigning polys to emitters or VRayMtl for lighting night scenes? Even just a few basic interior walls for realistic night shots - you know the ones where everyone leaves the lights on and goes home?

Also is this as high poly as it gets? No complaint :slight_smile: - you mentioned earlier that you would have a high resolution mesh option for closeups. Something about loading user window objects etc.?

Love your work :slight_smile: :slight_smile:


#339

Hi Steve,

  Building units are in generic world units. So, if you set your building wall width to 50, that means each wall/facade will be 50 units across and a wall composed of 3 facades will be 150 units across. If you have your world units set to cm, mm, inches, etc...I have no idea what that will translate to.
   * a divide ceiling into polys option (resolution user specified) for assigning polys to emitters or VRayMtl for lighting night scenes?  Even just a few basic interior walls for realistic night shots - you know the ones where everyone leaves the lights on and goes home?
  I'm planning to add proxy interiors, similar to the lightwave plugin "vroom" (although mine won't be rendertime-only). You'll be able to choose textures for these, meaning you can have little rooms behind the windows. Not sure when this will be implemented though.
   Also is this as high poly as it gets?  No complaint  :)  - you mentioned earlier that you would have a high resolution mesh option for closeups.  Something about loading user window objects etc.?
  Any higher poly than what it is right now, and things get unruly. For example, a default-sized building with all details applied to all 4 walls using the latest version of the script, will give you a building with a total poly count over 600k+.

Eventually I will be adding features, like a pillar-contour draw tool similar to the way you can draw ledge contours, so you can better define pillar shapes, but otherwise the state it is in right now represents the highest level of detail you can add. Maybe if you have some specific suggestions pertaining to areas of detail you’d like to see, I can look into adding them.

Anyways, the purpose of the script is not to generate buildings so detailed that you could stick a camera right up to a wall and see the screws that attach the balcony to the wall, or the bevel on the edge of a railing…for that your best bet would be to just model the things manually. By “close up” I meant more like a short distance…like if you were looking at the building from across a road. So if you had a character walking down a road, and a building visible on the other side of the street, the building would “hold up”, so to speak (assuming it was textured and such). Basically about the LOD that City Engine offers.

  Someday I hope to incorporate a custom object feature, but that's a long ways away.

#340

WOW! All the improvements look GREAT! Just downloaded the latest version and can’t wait to give it a go.

I had one feature suggestion for the generation of buildings on surface faces. Do you think it would be possible to have one building on multiple faces? I’m thinking it would be cool if there was a parameter to set the max number of surface faces per building. That way buildings could take one (like your current images show) or two polygons or four or more. So during generation some buildings would take one ploy while others would take 2+. Seems like it might be kind of difficult but could add a lot more variation in building footprints without having to do a lot of poly editing. Oh, if it is possible it might be good to put some kind of curve or bias control so you get more or less buildings from the min to max. For example you might want to get most of your buildings on 1 poly and only a few that take 2 or more polys.

Again this script ROCKS!