Idea for generating buildings with Nem's tools...

Started by Redskull, October 08, 2014, 02:55:59 PM

Previous topic - Next topic

Redskull

I'm currently working on a city map and I came up with an idea when I came across this greyscale city generator.
http://mithril94.free.fr/citymapper/index.php?lang=gb

I generated a terrain with nem's tools that literally looked like city building's. I noticed when I imported into hammer I could just delete the terrain on top of the nodraw brushes and keep the actual blocked out buildings. The only problem I have with it, is that it cuts up the brushes alot. Obviously it wasn't meant to generate cityscape's but it's still pretty neat.

For those not familiar with the terrain generator, you can find it here.
http://nemesis.thewavelength.net/index.php?p=8

wallworm

Thanks for the idea.

Actually, I already have a lot of ideas on doing this very thing quickly and natively in Max without any deleting of objects or going into Hammer, etc. I just don't always have time to share all of my ideas with everyone. I'll look into sharing simple processes with native Max functions when I can.

Redskull

Well I've experimented with the displacement modifier if that's what your talking about. I also found an interesting plugin you may be interested in called Greeble:http://max.klanky.com/plugins.htm

I was experimenting with that and found I could quickly generate low poly city buildings that could be easily used in my skybox. I really tried to make them convex by using convex hull script so I could get some good detail building in my level. Didn't really have much success thought. :/

I've also been experimenting with generating brushes in C++ so that I could potential make something to generate procedural buildings. I'm totally a noob to 3ds max so any idea's you have on how to do this process would be greatly appreciated.

wallworm

#3
Displace and Greeble are both exactly what I have been meaning to explain to people for a long time :)

For Greeble, you can already make brushes if you don't use the last 2 widgets.


  • Make your base geometry (probably a Plane with Quads converted to Editable Poly)
  • Apply a Poly Select Mod and choose the polygons that should spawn buildings.
  • Apply Greeble Modifier
  • Deselect the non-convex widgets in Greeble (last two icons).
  • Make the settings to your desired result
  • Add a Poly Select Modifier and deselect all sub-object selection.
  • Apply a Cap Holes Modifier and uncheck all settings in it.
  • Add a Poly Select Modifier and select all of the original plane Polygons (easiest in Element sub-object mode).
  • Apply a DeleteMesh modifier.
  • Go back down the stack to the original poly select, turn on show end results, and modify the base areas as needed.
  • Select the object, and click Wall Worm > Wall Worm Level Design > Set As Concave Brush.

Now the city will export as valid world geometry.

For the terrain, utilizing displace modifiers is my preferred way at least to start the geometry and match it to materials.

As for converting grayscale images to brushes, this is something I have considered too. But you can probably already figure out a way to do this by being creative with the kinds of steps outlined above and standard Max modifiers/tools :)

[EDIT] Note that I missed a step and added it in (the poly select before the CAP HOLES).

Redskull

That is exactly what I've been trying to do. Thank you! I'll have to test this out.

wallworm

One thing to keep in mind is that changes to the topology invalidate selections later in the stack. So if you edit the base geometry vertex/polygon ordering (by cutting, subdividing, etc) you now make the Poly Selects that follow select different Polygons. Likewise, if you change the Density of the Greeble, the Poly Select modifiers that come after it in the stack can become invalidated.

So keep in mind this essential nature of the modifier stack. The best thing is to plan ahead as much as possible... and then to remember this. You'll likely find that you'll need to reselect the base polygons for removal in the final poly select before the delete mesh more than the others, as it has both the original editable poly AND the Greeble modifier that can affect the vertex ordering. Experiment and you'll start to understand.

Redskull

Well that definitely did what I wanted it to but, just as I was previewing it in hammer it had to re-save because of invalid solids. :) I'm assuming that's what you were talking about with the poly select modifier. Should make things a ton easier when I'm filling out the city blocks in my map thought. I also had to reconfigure my max because I realized I didn't have that concave brush menu option. So I'm assuming this should work the same with the displacement modifier?(with city greyscale)

wallworm

Quote from: Redskull on October 09, 2014, 01:32:30 PM
Well that definitely did what I wanted it to but, just as I was previewing it in hammer it had to re-save because of invalid solids. :) I'm assuming that's what you were talking about with the poly select modifier.

Well I was mainly talking about stack selection and topology (vertex ordering). Topology dependent modifiers (like Edit Poly, Poly Select, Unwrap UVW etc) are dependent on the vertex order coming into them. So if you use an Edit Poly modifier and extrude Face 21 and later change something below that modifier so that the vertex order changes, then you may find that the extruded face changes. This is why you get a notice in Max when you go down the modifier stack with some modifiers.

In terms of invalid brushes... I've not had any caused by the steps I outlined above. In every test I've done, the geometry has remained valid. So maybe it was because there were holes in the geometry or because some of the elements were not self-contained and convex. In the steps above, the step on deleting the original polygons is to remove parts of the mesh that are still planar.

Quote from: Redskull on October 09, 2014, 01:32:30 PM
So I'm assuming this should work the same with the displacement modifier?(with city greyscale)

Actually, with Displace modifiers, I intended them to be used on WW's Sculpt Meshes (to drive actual Source Engine displacements). Letting textures control terrain is what I was getting at.

If you want to use textures to drive Greeble, you'll want to look into the Volume Select modifier and use a texture. My guess is that you may find that method a little awkward.  In the example above, replace the first Poly Select modifier with a Vol. Select modifier, set it to the Face stack selection level and add a texture.

Redskull

Just thought I'd share an update of what I did with greeble. Thanks again. :D

wallworm

Excellent!

I've got several test scenes that use Greeble and it can be a lot of fun.

Have you played with scattering WWMT Proxies yet?

Redskull

Do you mean proxies for things like streetlights? I was trying to figure out how to apply a random texture to each building. I don't know if WWMT proxies can be used for that. Have only been experimenting with exporting brushes and models so far.

I also made the streets with wallworm too. The textures for the street and sidewalk were in made in GIMP. I was also using this tutorial when I made them. https://www.youtube.com/watch?v=kc1lZ7fyaqs

It had pretty interesting building script mention in it too but my version max wouldn't support it.

wallworm

Quote from: Redskull on November 04, 2014, 05:22:04 PM
Do you mean proxies for things like streetlights?

Yes.

Quote from: Redskull on November 04, 2014, 05:22:04 PM
I was trying to figure out how to apply a random texture to each building. I don't know if WWMT proxies can be used for that. Have only been experimenting with exporting brushes and models so far.

No, WWMT Proxies are only for props.

Random textures for Greeble can be accomplished with the Materials inputs for both the  Panels and Widgets. You can enter a comma=separated list of Material IDs that will randomly get applied to the objects. Then just apply a MultiMaterial to the Greeble object with the materials to use in the slots.




For reference, the VMF Exporter now automatically applies a Cap Holes modifier to any object that has been tagged as a concave brush. This means that the Cap Holes setting above is not actually necessary.

wallworm

I wanted to add to this thread as I've answered the same question twice this last month and again today, and there is a step that makes it work even more efficiently: Generally, if there is any invalid geometry, it's because of non-planar polygons. As such, you may need to add a Turn To Poly modifier on the final result with Require Planar Polygons on (and I generally find a planar threshold of 2 works good with brushes).

SMF spam blocked by CleanTalk