As part of a test, I ended up building a 200-story, fully-loaded KludgeCity building. It tips the scales at 1,800,000 triangles including exterior details and interior geometry. The actual building took about three minutes to generate without UVs. I included balconies, but I somehow doubt you’d want those on a building this size.
Finished the first step of the UV workflow — the “unitize and randomize UV” script from the first KludgeCity. Now all buildings have their windows and interior dividers UV’d based on a random 8 by 8 grid. Also, I’ve added a “color” rollout that allows you to define what colors you want to have on your building shaders before they’re generated. This allows you to set a refraction/reflection tint for windows, and also lets you create a “variation grid” that controls a random value shift on the glass color. Below is an example of the window variation, and with nightscape workflow enabled. Starting to see the light at the end of the tunnel on version 0.2, but I’ve still got a lot of elbow grease to put in.
working on balconies. Not exactly realistic right now, but I’m trying a couple different variations.
In case anyone’s curious, I thought I’d let you know sort of what my process is when I’m working on Kludge.
Most importantly, I keep my eyes open when I’m out and about. I live in Dallas, so we’ve got a fairly decent variety in our skyline. I take photos when I can, and look at pictures of interesting buildings online. There is sort of a vocabulary of city architecture — some buildings have alternating stripes of material (what I call “buffers” in the script), some buildings have windows that wrap around, some have blank walls without windows, some are monolithic and flat on their facades, and others have all kinds of details extruding out from their surfaces. My job is to take those basic architectural ideas, and make a system that is capable of creating them on the fly, for any mixture of features.
It doesn’t always work.
The first step is always to model out the structure by hand. Everything you do in Maya has a corresponding command in MEL. In theory, if you can do it manually, you can do it in a script. I’ll work out a list of steps that are involved in creating a particular bit of geometry, and write out a sort of “pseudo-code” that summarizes the process. Then I figure out what MEL commands will give me the desired result. Usually this involves a lot of guess-and-check and many trips to the technical documentation. MEL is good at a lot of things, but it can be incredibly difficult to find a scripted solution that mimics human creative judgment. “select the faces that are facing outward from the building” is great if you’re talking to a modeler, but translating that into code can be tricky.
At the core of Kludge there is the default building — the only building that is guaranteed to work perfectly every time. Whenever I add a new feature, I work with this default building at default settings until I make it work correctly. The “ideal test case” is something I come back to throughout the testing process — every time I make a major change, the first thing I check is to see whether the default setup still works as expected.
After that, I try out a handful of other configurations. If all goes well, then I proceed to do everything I can to break the system. Most of the time, this is not difficult. Usually, I try to “user-proof” the system to the best of my imagination, but the truth is, there are more ways to break Kludge than there is time for me to fix them. All I can really do is try to make the system as flexible as possible.
A lot of the functionality of Kludge will eventually involve randomization, and I really can’t ensure that every combination of features will look good, or even work at all. But I guess that’s really the power of working procedurally — if you don’t like the result, in a couple minutes, you can have an entirely different building. There’s no reason not to try a bunch of different things and only keep what works.
Is it possibly the nightscape workflow that I promised but never delivered on in the first version? I think it might be. Still leagues from perfect, but so far so good!
Added new feature — now you can generate a low poly proxy (152 quads, compared to 70,000 for the full mesh)
You will eventually be able to toggle between the visibility of the proxy and the high-poly version, so you can place your buildings before render time, add a command as a pre-render MEL script, and the system will switch all of them out for the render.
New feature — I’m dubbing them “verticals” — sort of exterior columns between the windows. They make for some fine, imposing structures.
Just added this — I’m calling them “rounders” – they fill in sharp angles with a semi-cylindrical mesh.
Just about broke myself today trying some new-fangled approach for smaller, non-skyscraper style buildings. It failed pretty miserably, but I’m going to try again. I think I’m onto a good idea, but translating it into something that MEL can work with… well, that’s not so easy. In the meantime, I’ve added in a bit of code for creating railings in the gaps between building tiers.
I’m sure everyone’s run into this problem before… Maya doesn’t really have a feature for creating “nice” extrusions the way many other packages do. There are a couple Python-based plugin solutions out there, but for KludgeCity, I had to figure out a pure MEL way to get the same kind of result. The “fixed” extrusion tool I’ve come up with is a bit slow, but it works for almost every situation I’ve needed it for so far. This will allow me to UV entire buildings at a time, instead of the piecemeal floor-by-floor approach I’ve been going with. For now, it’s got a pretty narrow scope of usefulness, but I’ll probably try to expand it so that it will be an all-purpose tool.